Skip to content

Commit 411148f

Browse files
Fix server crash with variant active blocks. (GregTechCEu#1253)
1 parent 847ce4f commit 411148f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/gregtech/api/block/VariantActiveBlock.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import net.minecraft.block.state.IBlockState;
1717
import net.minecraft.client.Minecraft;
1818
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
19-
import net.minecraft.client.renderer.block.statemap.IStateMapper;
2019
import net.minecraft.item.Item;
2120
import net.minecraft.util.BlockRenderLayer;
2221
import net.minecraft.util.IStringSerializable;
@@ -40,7 +39,6 @@
4039
public class VariantActiveBlock<T extends Enum<T> & IStringSerializable> extends VariantBlock<T> implements IModelSupplier {
4140

4241
public static final ModelResourceLocation MODEL_LOCATION = new ModelResourceLocation(new ResourceLocation(GTValues.MODID, "active_blocks"), "inventory");
43-
public static final IStateMapper mapper = new SimpleStateMapper(MODEL_LOCATION);
4442
public static final Object2ObjectOpenHashMap<Integer, ObjectSet<BlockPos>> ACTIVE_BLOCKS = new Object2ObjectOpenHashMap<>();
4543
public static final PropertyBool ACTIVE_DEPRECATED = PropertyBool.create("active");
4644
public static final UnlistedBooleanProperty ACTIVE = new UnlistedBooleanProperty("active");
@@ -120,7 +118,7 @@ public void onTextureStitch(TextureStitchEvent.Pre event) {
120118
@Override
121119
@SideOnly(Side.CLIENT)
122120
public void onModelRegister() {
123-
ModelLoader.setCustomStateMapper(this, mapper);
121+
ModelLoader.setCustomStateMapper(this, new SimpleStateMapper(MODEL_LOCATION));
124122
for (IBlockState state : this.getBlockState().getValidStates()) {
125123
//ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), this.getMetaFromState(state), new ModelResourceLocation(this.getRegistryName(), "active=true," + statePropertiesToString(state.getProperties())));
126124
//ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), this.getMetaFromState(state), new ModelResourceLocation(this.getRegistryName(), "active=false," + statePropertiesToString(state.getProperties())));

0 commit comments

Comments
 (0)