Skip to content

Commit

Permalink
Fix server crash and render wigwag weirdness
Browse files Browse the repository at this point in the history
  • Loading branch information
CSX8600 committed Mar 15, 2024
1 parent c8ec6d3 commit c89870a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public abstract class BlockLampBase extends Block {
public static final PropertyEnum<EnumState> STATE = PropertyEnum.create("state", EnumState.class);
Expand Down Expand Up @@ -55,6 +57,7 @@ public abstract IBlockState getStateForPlacement(World world, BlockPos pos, Enum

public abstract IProperty<?> getRotationalProperty();

@SideOnly(Side.CLIENT)
public void initModel()
{
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.EnumFacing;
Expand Down Expand Up @@ -51,6 +52,8 @@ public void render(VerticalWigWagTileEntity te, double x, double y, double z, fl
GlStateManager.translate(0.5, 0.4375, 0.27);
GlStateManager.rotate(te.getRotation(), 0, 0, 1);

Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);

Tessellator tess = Tessellator.getInstance();
BufferBuilder builder = tess.getBuffer();
builder.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM);
Expand Down

0 comments on commit c89870a

Please sign in to comment.