Skip to content

Commit

Permalink
Merge branch 'architectury-1.17.1' into architectury-1.16.5
Browse files Browse the repository at this point in the history
# Conflicts:
#	common/src/main/resources/pfm.accesswidener
  • Loading branch information
UnlikePaladin committed Jan 2, 2024
2 parents 660ec0c + 1c14c2c commit c3ba6ca
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@

import com.unlikepaladin.pfm.data.materials.DynamicBlockRegistry;
import com.unlikepaladin.pfm.data.materials.WoodVariantRegistry;
import com.unlikepaladin.pfm.mixin.PFMPointOfInterestTypeAccessor;
import com.unlikepaladin.pfm.registry.BlockEntityRegistry;
import com.unlikepaladin.pfm.registry.PaladinFurnitureModBlocksItems;
import com.unlikepaladin.pfm.registry.dynamic.LateBlockRegistry;
import com.unlikepaladin.pfm.runtime.PFMRuntimeResources;
import com.unlikepaladin.pfm.utilities.Version;
import dev.architectury.injectables.annotations.ExpectPlatform;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import net.minecraft.block.BlockState;
import net.minecraft.block.enums.BedPart;
import net.minecraft.item.ItemGroup;
Expand Down Expand Up @@ -82,7 +84,8 @@ public static void replaceHomePOI() {
newBedStates.addAll(originalBedStates);
newBedStates.addAll(addedBedStates);
PointOfInterestType.HOME.blockStates = ImmutableSet.copyOf(newBedStates);
addedBedStates.forEach(state -> PointOfInterestType.BLOCK_STATE_TO_POINT_OF_INTEREST_TYPE.put(state, PointOfInterestType.HOME));
addedBedStates.forEach(state -> PFMPointOfInterestTypeAccessor.getBlockStateToPointOfInterestType().put(state, PointOfInterestType.HOME));
PFMPointOfInterestTypeAccessor.setRegisteredStates(new ObjectOpenHashSet<>(PFMPointOfInterestTypeAccessor.getBlockStateToPointOfInterestType().keySet()));
}

@ExpectPlatform
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.unlikepaladin.pfm.mixin;

import net.minecraft.block.BlockState;
import net.minecraft.world.poi.PointOfInterestType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;

import java.util.Map;
import java.util.Set;

@Mixin(PointOfInterestType.class)
public interface PFMPointOfInterestTypeAccessor {
@Accessor("BLOCK_STATE_TO_POINT_OF_INTEREST_TYPE")
static Map<BlockState, PointOfInterestType> getBlockStateToPointOfInterestType() {
throw new AssertionError();
}

@Mutable
@Accessor("REGISTERED_STATES")
static void setRegisteredStates(Set<BlockState> states) {
throw new AssertionError();
}
}
1 change: 1 addition & 0 deletions common/src/main/resources/pfm-common.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"PFMAbstractTagProvider$ObjectBuilderMixin",
"PFMIngredientMatchingStacksAccessor",
"PFMPlayerInventoryMixin",
"PFMPointOfInterestTypeAccessor",
"PFMTextureKeyFactory"
],
"server": [
Expand Down
6 changes: 1 addition & 5 deletions common/src/main/resources/pfm.accesswidener
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
accessWidener v1 named

accessible class net/minecraft/recipe/CookingRecipeSerializer$RecipeFactory
accessible field net/minecraft/world/poi/PointOfInterestType BED_STATES Ljava/util/Set;
accessible method net/minecraft/world/poi/PointOfInterestType setup (Lnet/minecraft/world/poi/PointOfInterestType;)Lnet/minecraft/world/poi/PointOfInterestType;
mutable field net/minecraft/world/poi/PointOfInterestType HOME Lnet/minecraft/world/poi/PointOfInterestType;
accessible method net/minecraft/data/server/BlockLootTableGenerator drops (Lnet/minecraft/item/ItemConvertible;)Lnet/minecraft/loot/LootTable$Builder;
accessible method net/minecraft/data/server/BlockLootTableGenerator dropsWithProperty (Lnet/minecraft/block/Block;Lnet/minecraft/state/property/Property;Ljava/lang/Comparable;)Lnet/minecraft/loot/LootTable$Builder;
accessible class net/minecraft/data/server/AbstractTagProvider$ObjectBuilder
accessible method net/minecraft/client/render/item/ItemRenderer renderBakedItemModel (Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/item/ItemStack;IILnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;)V
accessible field net/minecraft/client/resource/language/LanguageManager field_25291 Lnet/minecraft/client/resource/language/LanguageDefinition;
accessible field net/minecraft/block/AbstractBlock$Settings material Lnet/minecraft/block/Material;
accessible field net/minecraft/world/poi/PointOfInterestType blockStates Ljava/util/Set;
mutable field net/minecraft/world/poi/PointOfInterestType blockStates Ljava/util/Set;
accessible field net/minecraft/world/poi/PointOfInterestType BLOCK_STATE_TO_POINT_OF_INTEREST_TYPE Ljava/util/Map;
mutable field net/minecraft/world/poi/PointOfInterestType blockStates Ljava/util/Set;

0 comments on commit c3ba6ca

Please sign in to comment.