Jump to content

[1.8.9] [UNSOLVED] Tile Entity Rendering


Bektor

Recommended Posts

Hi,

 

I've got some problems:

 

b9Eh6za.png

 

How can I tell Minecraft to use the block rotations while rendering and how can I tell it to render also the custom model in my inventory?

 

Model code:

 

package com.minecolonies.client.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;

public class ModelScarecrowBoth extends ModelBase
{
    //fields
    ModelRenderer Head;
    ModelRenderer Post;
    ModelRenderer LeftArmPeg;
    ModelRenderer RightArmPeg;
    ModelRenderer Torso;
    ModelRenderer RightLegPeg;
    ModelRenderer LeftLegPeg;
    ModelRenderer LeftArm;
    ModelRenderer RightArm;
    ModelRenderer RightLeg;
    ModelRenderer LeftLeg;
    
    public ModelScarecrowBoth()
    {
        textureWidth = 128;
        textureHeight = 64;
        
        Head = new ModelRenderer(this, 0, 0);
        Head.addBox(-8.2F, -35.6F, -4.2F, 8, 8, ;
        Head.setRotationPoint(7F, 24F, -1F);
        Head.setTextureSize(128, 64);
        Head.mirror = true;
        setRotation(Head, 0F, 0.1858931F, -0.1092638F);
        Post = new ModelRenderer(this, 0, 32);
        Post.addBox(-1F, -16F, -1F, 2, 16, 2);
        Post.setRotationPoint(0F, 24F, 0F);
        Post.setTextureSize(128, 64);
        Post.mirror = true;
        setRotation(Post, 0F, 0F, 0F);
        LeftArmPeg = new ModelRenderer(this, 9, 33);
        LeftArmPeg.addBox(23.5F, 1F, -1F, 2, 2, 2);
        LeftArmPeg.setRotationPoint(7F, 24F, 0F);
        LeftArmPeg.setTextureSize(128, 64);
        LeftArmPeg.mirror = true;
        setRotation(LeftArmPeg, 0F, 0F, -1.351339F);
        RightArmPeg = new ModelRenderer(this, 9, 33);
        RightArmPeg.addBox(-28F, 15.8F, -1F, 2, 2, 2);
        RightArmPeg.setRotationPoint(7F, 24F, 0F);
        RightArmPeg.setTextureSize(128, 64);
        RightArmPeg.mirror = true;
        setRotation(RightArmPeg, 0F, 0F, 1.351339F);
        Torso = new ModelRenderer(this, 16, 16);
        Torso.addBox(-10.3F, -27.6F, -2F, 8, 12, 4);
        Torso.setRotationPoint(7F, 24F, 0F);
        Torso.setTextureSize(128, 64);
        Torso.mirror = true;
        setRotation(Torso, 0F, 0F, -0.0349066F);
        RightLegPeg = new ModelRenderer(this, 9, 33);
        RightLegPeg.addBox(-11F, -4F, -1F, 2, 2, 2);
        RightLegPeg.setRotationPoint(7F, 24F, 0F);
        RightLegPeg.setTextureSize(128, 64);
        RightLegPeg.mirror = true;
        setRotation(RightLegPeg, 0F, 0F, 0.0872665F);
        LeftLegPeg = new ModelRenderer(this, 9, 33);
        LeftLegPeg.addBox(-4.5F, -5F, -1F, 2, 2, 2);
        LeftLegPeg.setRotationPoint(7F, 24F, 0F);
        LeftLegPeg.setTextureSize(128, 64);
        LeftLegPeg.mirror = true;
        setRotation(LeftLegPeg, 0F, 0F, -0.0872665F);
        LeftArm = new ModelRenderer(this, 40, 16);
        LeftArm.addBox(22.5F, -10F, -1.99F, 4, 12, 4);
        LeftArm.setRotationPoint(7F, 24F, 0F);
        LeftArm.setTextureSize(128, 64);
        LeftArm.mirror = true;
        setRotation(LeftArm, 0F, 0F, -1.351339F);
        RightArm = new ModelRenderer(this, 40, 16);
        RightArm.addBox(-29F, 4.8F, -1.99F, 4, 12, 4);
        RightArm.setRotationPoint(7F, 24F, 0F);
        RightArm.setTextureSize(128, 64);
        RightArm.mirror = true;
        setRotation(RightArm, 0F, 0F, 1.351339F);
        RightLeg = new ModelRenderer(this, 0, 16);
        RightLeg.addBox(-12F, -15F, -1.99F, 4, 12, 4);
        RightLeg.setRotationPoint(7F, 24F, 0F);
        RightLeg.setTextureSize(128, 64);
        RightLeg.mirror = true;
        setRotation(RightLeg, 0F, 0F, 0.0872665F);
        LeftLeg = new ModelRenderer(this, 0, 16);
        LeftLeg.addBox(-5.5F, -16F, -1.98F, 4, 12, 4);
        LeftLeg.setRotationPoint(7F, 24F, 0F);
        LeftLeg.setTextureSize(128, 64);
        LeftLeg.mirror = true;
        setRotation(LeftLeg, 0F, 0F, -0.0872665F);
    }
    
    public void render(float scaleFactor)
    {
        Head.render(scaleFactor);
        Post.render(scaleFactor);
        LeftArmPeg.render(scaleFactor);
        RightArmPeg.render(scaleFactor);
        Torso.render(scaleFactor);
        RightLegPeg.render(scaleFactor);
        LeftLegPeg.render(scaleFactor);
        LeftArm.render(scaleFactor);
        RightArm.render(scaleFactor);
        RightLeg.render(scaleFactor);
        LeftLeg.render(scaleFactor);
    }
    
    private void setRotation(ModelRenderer model, float x, float y, float z)
    {
        model.rotateAngleX = x;
        model.rotateAngleY = y;
        model.rotateAngleZ = z;
    }
}

 

 

Render code:

 

package com.minecolonies.client.render;

import com.minecolonies.client.model.ModelScarecrowBoth;
import com.minecolonies.lib.Constants;
import com.minecolonies.tileentities.ScarecrowTileEntity;

import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
* Class to render the scarecrow.
*/
@SideOnly(Side.CLIENT)
public class TileEntityScarecrowRenderer extends TileEntitySpecialRenderer<ScarecrowTileEntity>
{
    private final ModelScarecrowBoth model;

    public TileEntityScarecrowRenderer() { 
        this.model = new ModelScarecrowBoth();
    }
    
    @Override
    public void renderTileEntityAt(ScarecrowTileEntity te, double posX, double posY, double posZ, float partialTicks, int destroyStage) {
        GlStateManager.pushMatrix(); // store the transformation 
        GlStateManager.translate(posX, posY, posZ); // set viewport to tile entity position to render it
        
        /* ============ Rendering Code goes here ============ */
        
        this.bindTexture(this.getResourceLocation(te));
        this.model.render(.0625f);
        
        /* ============ Rendering Code stops here =========== */
        
        GlStateManager.popMatrix(); // restore the transformation, so other renderer's are not messed up
    }
    
    private ResourceLocation getResourceLocation(ScarecrowTileEntity tileentity) { 
        String loc;
        
        if(tileentity.getType())
            loc = "textures/blocks/blockScarecrowPumpkin.png";
        else
            loc = "textures/blocks/blockScarecrowNormal.png";
        
        return new ResourceLocation(Constants.MOD_ID + ":" + loc);
    }
}

 

 

I also hope it's correct how I try getting the texture. Not quite sure about this.

 

Thx in advance.

Bektor

Developer of Primeval Forest.

Link to comment
Share on other sites

Hi,

 

I've got some problems:

 

b9Eh6za.png

 

How can I tell Minecraft to use the block rotations while rendering and how can I tell it to render also the custom model in my inventory?

 

Model code:

 

package com.minecolonies.client.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;

public class ModelScarecrowBoth extends ModelBase
{
    //fields
    ModelRenderer Head;
    ModelRenderer Post;
    ModelRenderer LeftArmPeg;
    ModelRenderer RightArmPeg;
    ModelRenderer Torso;
    ModelRenderer RightLegPeg;
    ModelRenderer LeftLegPeg;
    ModelRenderer LeftArm;
    ModelRenderer RightArm;
    ModelRenderer RightLeg;
    ModelRenderer LeftLeg;
    
    public ModelScarecrowBoth()
    {
        textureWidth = 128;
        textureHeight = 64;
        
        Head = new ModelRenderer(this, 0, 0);
        Head.addBox(-8.2F, -35.6F, -4.2F, 8, 8, ;
        Head.setRotationPoint(7F, 24F, -1F);
        Head.setTextureSize(128, 64);
        Head.mirror = true;
        setRotation(Head, 0F, 0.1858931F, -0.1092638F);
        Post = new ModelRenderer(this, 0, 32);
        Post.addBox(-1F, -16F, -1F, 2, 16, 2);
        Post.setRotationPoint(0F, 24F, 0F);
        Post.setTextureSize(128, 64);
        Post.mirror = true;
        setRotation(Post, 0F, 0F, 0F);
        LeftArmPeg = new ModelRenderer(this, 9, 33);
        LeftArmPeg.addBox(23.5F, 1F, -1F, 2, 2, 2);
        LeftArmPeg.setRotationPoint(7F, 24F, 0F);
        LeftArmPeg.setTextureSize(128, 64);
        LeftArmPeg.mirror = true;
        setRotation(LeftArmPeg, 0F, 0F, -1.351339F);
        RightArmPeg = new ModelRenderer(this, 9, 33);
        RightArmPeg.addBox(-28F, 15.8F, -1F, 2, 2, 2);
        RightArmPeg.setRotationPoint(7F, 24F, 0F);
        RightArmPeg.setTextureSize(128, 64);
        RightArmPeg.mirror = true;
        setRotation(RightArmPeg, 0F, 0F, 1.351339F);
        Torso = new ModelRenderer(this, 16, 16);
        Torso.addBox(-10.3F, -27.6F, -2F, 8, 12, 4);
        Torso.setRotationPoint(7F, 24F, 0F);
        Torso.setTextureSize(128, 64);
        Torso.mirror = true;
        setRotation(Torso, 0F, 0F, -0.0349066F);
        RightLegPeg = new ModelRenderer(this, 9, 33);
        RightLegPeg.addBox(-11F, -4F, -1F, 2, 2, 2);
        RightLegPeg.setRotationPoint(7F, 24F, 0F);
        RightLegPeg.setTextureSize(128, 64);
        RightLegPeg.mirror = true;
        setRotation(RightLegPeg, 0F, 0F, 0.0872665F);
        LeftLegPeg = new ModelRenderer(this, 9, 33);
        LeftLegPeg.addBox(-4.5F, -5F, -1F, 2, 2, 2);
        LeftLegPeg.setRotationPoint(7F, 24F, 0F);
        LeftLegPeg.setTextureSize(128, 64);
        LeftLegPeg.mirror = true;
        setRotation(LeftLegPeg, 0F, 0F, -0.0872665F);
        LeftArm = new ModelRenderer(this, 40, 16);
        LeftArm.addBox(22.5F, -10F, -1.99F, 4, 12, 4);
        LeftArm.setRotationPoint(7F, 24F, 0F);
        LeftArm.setTextureSize(128, 64);
        LeftArm.mirror = true;
        setRotation(LeftArm, 0F, 0F, -1.351339F);
        RightArm = new ModelRenderer(this, 40, 16);
        RightArm.addBox(-29F, 4.8F, -1.99F, 4, 12, 4);
        RightArm.setRotationPoint(7F, 24F, 0F);
        RightArm.setTextureSize(128, 64);
        RightArm.mirror = true;
        setRotation(RightArm, 0F, 0F, 1.351339F);
        RightLeg = new ModelRenderer(this, 0, 16);
        RightLeg.addBox(-12F, -15F, -1.99F, 4, 12, 4);
        RightLeg.setRotationPoint(7F, 24F, 0F);
        RightLeg.setTextureSize(128, 64);
        RightLeg.mirror = true;
        setRotation(RightLeg, 0F, 0F, 0.0872665F);
        LeftLeg = new ModelRenderer(this, 0, 16);
        LeftLeg.addBox(-5.5F, -16F, -1.98F, 4, 12, 4);
        LeftLeg.setRotationPoint(7F, 24F, 0F);
        LeftLeg.setTextureSize(128, 64);
        LeftLeg.mirror = true;
        setRotation(LeftLeg, 0F, 0F, -0.0872665F);
    }
    
    public void render(float scaleFactor)
    {
        Head.render(scaleFactor);
        Post.render(scaleFactor);
        LeftArmPeg.render(scaleFactor);
        RightArmPeg.render(scaleFactor);
        Torso.render(scaleFactor);
        RightLegPeg.render(scaleFactor);
        LeftLegPeg.render(scaleFactor);
        LeftArm.render(scaleFactor);
        RightArm.render(scaleFactor);
        RightLeg.render(scaleFactor);
        LeftLeg.render(scaleFactor);
    }
    
    private void setRotation(ModelRenderer model, float x, float y, float z)
    {
        model.rotateAngleX = x;
        model.rotateAngleY = y;
        model.rotateAngleZ = z;
    }
}

 

 

Render code:

 

package com.minecolonies.client.render;

import com.minecolonies.client.model.ModelScarecrowBoth;
import com.minecolonies.lib.Constants;
import com.minecolonies.tileentities.ScarecrowTileEntity;

import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
* Class to render the scarecrow.
*/
@SideOnly(Side.CLIENT)
public class TileEntityScarecrowRenderer extends TileEntitySpecialRenderer<ScarecrowTileEntity>
{
    private final ModelScarecrowBoth model;

    public TileEntityScarecrowRenderer() { 
        this.model = new ModelScarecrowBoth();
    }
    
    @Override
    public void renderTileEntityAt(ScarecrowTileEntity te, double posX, double posY, double posZ, float partialTicks, int destroyStage) {
        GlStateManager.pushMatrix(); // store the transformation 
        GlStateManager.translate(posX, posY, posZ); // set viewport to tile entity position to render it
        
        /* ============ Rendering Code goes here ============ */
        
        this.bindTexture(this.getResourceLocation(te));
        this.model.render(.0625f);
        
        /* ============ Rendering Code stops here =========== */
        
        GlStateManager.popMatrix(); // restore the transformation, so other renderer's are not messed up
    }
    
    private ResourceLocation getResourceLocation(ScarecrowTileEntity tileentity) { 
        String loc;
        
        if(tileentity.getType())
            loc = "textures/blocks/blockScarecrowPumpkin.png";
        else
            loc = "textures/blocks/blockScarecrowNormal.png";
        
        return new ResourceLocation(Constants.MOD_ID + ":" + loc);
    }
}

 

 

I also hope it's correct how I try getting the texture. Not quite sure about this.

 

Thx in advance.

Bektor

Developer of Primeval Forest.

Link to comment
Share on other sites

How can I tell Minecraft to use the block rotations while rendering
glRotate

.

how can I tell it to render also the custom model in my inventory?
ForgeHooksClient.registerTESRItemStack

.

 

Why is this is a TESR though?

 

What is a TESR? And when I have glRotate, I have to get somehow the rotations from the block itself which where set with a PropertyDirection in the block class.

 

EDIT: When I've got ForgeHooksClient.registerTESRItemStack, do I need any json file? And if I need them, what to put in them?

Developer of Primeval Forest.

Link to comment
Share on other sites

How can I tell Minecraft to use the block rotations while rendering
glRotate

.

how can I tell it to render also the custom model in my inventory?
ForgeHooksClient.registerTESRItemStack

.

 

Why is this is a TESR though?

 

What is a TESR? And when I have glRotate, I have to get somehow the rotations from the block itself which where set with a PropertyDirection in the block class.

 

EDIT: When I've got ForgeHooksClient.registerTESRItemStack, do I need any json file? And if I need them, what to put in them?

Developer of Primeval Forest.

Link to comment
Share on other sites

What is a TESR?

TileEntitySpecialRenderer

 

And when I have glRotate, I have to get somehow the rotations from the block itself which where set with a PropertyDirection in the block class.

Use

World#getBlockState

to get the current state and

IBlockState#getValue

to get the facing from that state.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

What is a TESR?

TileEntitySpecialRenderer

 

And when I have glRotate, I have to get somehow the rotations from the block itself which where set with a PropertyDirection in the block class.

Use

World#getBlockState

to get the current state and

IBlockState#getValue

to get the facing from that state.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Ah, ok.

@diesieben07 It's a TESR because the team I'm working with want's it so and they got only the java code for the model from their modeller.

ForgeHooksClient.registerTESRItemStack is deprecated. Is there a replacement for it, because I don't like deprecated stuff.

 

        EnumFacing facing = te.getWorld().getBlockState(te.getPos()).getValue(BlockHutField.FACING);
        
        this.bindTexture(this.getResourceLocation(te));
        GlStateManager.rotate(angle, x, y, z);
        this.model.render(.0625f);

What do I have to put in there now, so in the GlStateManager.rotate method?

Just to mention, the complete model must also always be rotated around 180 degrees cause it's up side down.

 

EDIT: Ok, I've got now jsons because I render it with the rendering class. I've got also that code ForgeHooksClient#registerTESRItemStack as a replacement for the json loading stuff and now it's not drawing in the inventory. :(

Developer of Primeval Forest.

Link to comment
Share on other sites

Ah, ok.

@diesieben07 It's a TESR because the team I'm working with want's it so and they got only the java code for the model from their modeller.

ForgeHooksClient.registerTESRItemStack is deprecated. Is there a replacement for it, because I don't like deprecated stuff.

 

        EnumFacing facing = te.getWorld().getBlockState(te.getPos()).getValue(BlockHutField.FACING);
        
        this.bindTexture(this.getResourceLocation(te));
        GlStateManager.rotate(angle, x, y, z);
        this.model.render(.0625f);

What do I have to put in there now, so in the GlStateManager.rotate method?

Just to mention, the complete model must also always be rotated around 180 degrees cause it's up side down.

 

EDIT: Ok, I've got now jsons because I render it with the rendering class. I've got also that code ForgeHooksClient#registerTESRItemStack as a replacement for the json loading stuff and now it's not drawing in the inventory. :(

Developer of Primeval Forest.

Link to comment
Share on other sites

package com.minecolonies.client.render;

import com.minecolonies.blocks.BlockHutField;
import com.minecolonies.client.model.ModelScarecrowBoth;
import com.minecolonies.lib.Constants;
import com.minecolonies.tileentities.ScarecrowTileEntity;

import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
* Class to render the scarecrow.
*/
@SideOnly(Side.CLIENT)
public class TileEntityScarecrowRenderer extends TileEntitySpecialRenderer<ScarecrowTileEntity>
{
    private final ModelScarecrowBoth model;

    public TileEntityScarecrowRenderer() { 
        this.model = new ModelScarecrowBoth();
    }
    
    @Override
    public void renderTileEntityAt(ScarecrowTileEntity te, double posX, double posY, double posZ, float partialTicks, int destroyStage) {
        GlStateManager.pushMatrix(); // store the transformation 
        GlStateManager.translate(posX, posY, posZ); // set viewport to tile entity position to render it
        
        /* ============ Rendering Code goes here ============ */
        EnumFacing facing = te.getWorld().getBlockState(te.getPos()).getValue(BlockHutField.FACING);
        
        this.bindTexture(this.getResourceLocation(te));
        //GlStateManager.rotate(angle, x, y, z);
        this.model.render(.0625f);
        
        /* ============ Rendering Code stops here =========== */
        
        GlStateManager.popMatrix(); // restore the transformation, so other renderer's are not messed up
    }
    
    private ResourceLocation getResourceLocation(ScarecrowTileEntity tileentity) { 
        String loc;
        
        if(tileentity.getType())
            loc = "textures/blocks/blockScarecrowPumpkin.png";
        else
            loc = "textures/blocks/blockScarecrowNormal.png";
        
        return new ResourceLocation(Constants.MOD_ID + ":" + loc);
    }
}

Also, the texture seems also not to be loaded....

 

ClientRegistry.bindTileEntitySpecialRenderer(ScarecrowTileEntity.class, new TileEntityScarecrowRenderer());
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.blockHutField), 0, ScarecrowTileEntity.class);

This is in Client Proxy.

 

Developer of Primeval Forest.

Link to comment
Share on other sites

package com.minecolonies.client.render;

import com.minecolonies.blocks.BlockHutField;
import com.minecolonies.client.model.ModelScarecrowBoth;
import com.minecolonies.lib.Constants;
import com.minecolonies.tileentities.ScarecrowTileEntity;

import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
* Class to render the scarecrow.
*/
@SideOnly(Side.CLIENT)
public class TileEntityScarecrowRenderer extends TileEntitySpecialRenderer<ScarecrowTileEntity>
{
    private final ModelScarecrowBoth model;

    public TileEntityScarecrowRenderer() { 
        this.model = new ModelScarecrowBoth();
    }
    
    @Override
    public void renderTileEntityAt(ScarecrowTileEntity te, double posX, double posY, double posZ, float partialTicks, int destroyStage) {
        GlStateManager.pushMatrix(); // store the transformation 
        GlStateManager.translate(posX, posY, posZ); // set viewport to tile entity position to render it
        
        /* ============ Rendering Code goes here ============ */
        EnumFacing facing = te.getWorld().getBlockState(te.getPos()).getValue(BlockHutField.FACING);
        
        this.bindTexture(this.getResourceLocation(te));
        //GlStateManager.rotate(angle, x, y, z);
        this.model.render(.0625f);
        
        /* ============ Rendering Code stops here =========== */
        
        GlStateManager.popMatrix(); // restore the transformation, so other renderer's are not messed up
    }
    
    private ResourceLocation getResourceLocation(ScarecrowTileEntity tileentity) { 
        String loc;
        
        if(tileentity.getType())
            loc = "textures/blocks/blockScarecrowPumpkin.png";
        else
            loc = "textures/blocks/blockScarecrowNormal.png";
        
        return new ResourceLocation(Constants.MOD_ID + ":" + loc);
    }
}

Also, the texture seems also not to be loaded....

 

ClientRegistry.bindTileEntitySpecialRenderer(ScarecrowTileEntity.class, new TileEntityScarecrowRenderer());
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.blockHutField), 0, ScarecrowTileEntity.class);

This is in Client Proxy.

 

Developer of Primeval Forest.

Link to comment
Share on other sites

ClientProxy

package com.minecolonies.proxy;

import com.minecolonies.blocks.ModBlocks;
import com.minecolonies.client.gui.WindowBuildTool;
import com.minecolonies.client.gui.WindowCitizen;
import com.minecolonies.client.render.EmptyTileEntitySpecialRenderer;
import com.minecolonies.client.render.RenderBipedCitizen;
import com.minecolonies.client.render.RenderFishHook;
import com.minecolonies.client.render.TileEntityScarecrowRenderer;
import com.minecolonies.colony.CitizenData;
import com.minecolonies.entity.EntityCitizen;
import com.minecolonies.entity.EntityFishHook;
import com.minecolonies.event.ClientEventHandler;
import com.minecolonies.items.ModItems;
import com.minecolonies.tileentities.ScarecrowTileEntity;
import com.minecolonies.tileentities.TileEntityColonyBuilding;
import com.schematica.client.events.TickHandler;
import com.schematica.client.renderer.RendererSchematicGlobal;
import com.schematica.world.SchematicWorld;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.util.BlockPos;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry;

public class ClientProxy extends CommonProxy
{
    private RendererSchematicGlobal rendererSchematicGlobal;
    private SchematicWorld          schematicWorld          = null;

    @Override
    public boolean isClient()
    {
        return true;
    }

    @Override
    public void registerKeyBindings()
    {
//        for(KeyBinding keyBinding : KeyInputHandler.KEY_BINDINGS)
//        {
//            ClientRegistry.registerKeyBinding(keyBinding);
//        }
    }

    @Override
    public void registerEvents()
    {
        super.registerEvents();

        MinecraftForge.EVENT_BUS.register(new ClientEventHandler());

        //Schematica
        MinecraftForge.EVENT_BUS.register(new TickHandler());
        this.rendererSchematicGlobal = new RendererSchematicGlobal();
        MinecraftForge.EVENT_BUS.register(this.rendererSchematicGlobal);
    }

    @Override
    public void registerEntityRendering()
    {
        RenderingRegistry.registerEntityRenderingHandler(EntityCitizen.class, RenderBipedCitizen::new);
        RenderingRegistry.registerEntityRenderingHandler(EntityFishHook.class, RenderFishHook::new);

    }

    @Override
    public void registerTileEntityRendering()
    {
        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityColonyBuilding.class, new EmptyTileEntitySpecialRenderer());
        ClientRegistry.bindTileEntitySpecialRenderer(ScarecrowTileEntity.class, new TileEntityScarecrowRenderer());
    }

    @Override
    public void showCitizenWindow(CitizenData.View citizen)
    {
        WindowCitizen window = new WindowCitizen(citizen);
        window.open();
    }

    @Override
    public void openBuildToolWindow(BlockPos pos)
    {
        WindowBuildTool window = new WindowBuildTool(pos);
        window.open();
    }

    //Schematica
    @Override
    public void setActiveSchematic(SchematicWorld world)
    {
        this.schematicWorld = world;
    }

    @Override
    public SchematicWorld getActiveSchematic()
    {
        return this.schematicWorld;
    }
    
    @Override
    public void registerRenderer() {
    	super.registerRenderer();
    	
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutBaker), 0, new ModelResourceLocation(ModBlocks.blockHutBaker.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutBlacksmith), 0, new ModelResourceLocation(ModBlocks.blockHutBlacksmith.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutBuilder), 0, new ModelResourceLocation(ModBlocks.blockHutBuilder.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutCitizen), 0, new ModelResourceLocation(ModBlocks.blockHutCitizen.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutFarmer), 0, new ModelResourceLocation(ModBlocks.blockHutFarmer.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutFisherman), 0, new ModelResourceLocation(ModBlocks.blockHutFisherman.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutLumberjack), 0, new ModelResourceLocation(ModBlocks.blockHutLumberjack.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutMiner), 0, new ModelResourceLocation(ModBlocks.blockHutMiner.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutStonemason), 0, new ModelResourceLocation(ModBlocks.blockHutStonemason.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutTownHall), 0, new ModelResourceLocation(ModBlocks.blockHutTownHall.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutWarehouse), 0, new ModelResourceLocation(ModBlocks.blockHutWarehouse.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockSubstitution), 0, new ModelResourceLocation(ModBlocks.blockSubstitution.getRegistryName(), "inventory"));
        //Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutField), 0, new ModelResourceLocation(ModBlocks.blockHutField.getRegistryName(), "inventory"));
    	
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.buildTool, 0, new ModelResourceLocation(ModItems.buildTool.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.caliper, 0, new ModelResourceLocation(ModItems.caliper.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.scanTool, 0, new ModelResourceLocation(ModItems.scanTool.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.supplyChest, 0, new ModelResourceLocation(ModItems.supplyChest.getRegistryName(), "inventory"));
    	ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.blockHutField), 0, ScarecrowTileEntity.class);
    }
}

 

Main class:

package com.minecolonies;

import com.minecolonies.blocks.ModBlocks;
import com.minecolonies.colony.Schematics;
import com.minecolonies.configuration.ConfigurationHandler;
import com.minecolonies.configuration.Configurations;
import com.minecolonies.items.ModItems;
import com.minecolonies.lib.Constants;
import com.minecolonies.network.messages.*;
import com.minecolonies.proxy.IProxy;
import com.minecolonies.util.Log;
import com.minecolonies.util.RecipeHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.relauncher.Side;


@Mod(modid = Constants.MOD_ID, name = Constants.MOD_NAME, version = Constants.VERSION, certificateFingerprint = Constants.FINGERPRINT,
	dependencies = Constants.FORGE_VERSION, acceptedMinecraftVersions = Constants.MC_VERSION)
public class MineColonies
{
    private static          SimpleNetworkWrapper network;

    @Mod.Instance(Constants.MOD_ID)
    public static           MineColonies         instance;

    @SidedProxy(clientSide = Constants.CLIENT_PROXY_LOCATION, serverSide = Constants.SERVER_PROXY_LOCATION)
    public static           IProxy               proxy;

    public static SimpleNetworkWrapper getNetwork()
    {
        return network;
    }

    @Mod.EventHandler
    public void invalidFingerprint(FMLFingerprintViolationEvent event)
    {
        if(Constants.FINGERPRINT.equals("@FINGERPRINT@"))
        {
            Log.logger.error("No Fingerprint. Might not be a valid version!");
        }
    }

    @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
        //not needed, code already in init
        //logger = event.getModLog();

        ConfigurationHandler.init(event.getSuggestedConfigurationFile());

        ModBlocks.init();

        ModItems.init();

        proxy.registerKeyBindings();//Schematica
        
        proxy.registerEntities();

        proxy.registerEntityRendering();
    }

    @Mod.EventHandler
    public void init(FMLInitializationEvent event)
    {
        network = NetworkRegistry.INSTANCE.newSimpleChannel(Constants.MOD_NAME);
        //  ColonyView messages
        getNetwork().registerMessage(ColonyViewMessage.class,                ColonyViewMessage.class,                1,  Side.CLIENT);
        getNetwork().registerMessage(ColonyViewCitizenViewMessage.class,     ColonyViewCitizenViewMessage.class,     2,  Side.CLIENT);
        getNetwork().registerMessage(ColonyViewRemoveCitizenMessage.class,   ColonyViewRemoveCitizenMessage.class,   3,  Side.CLIENT);
        getNetwork().registerMessage(ColonyViewBuildingViewMessage.class,    ColonyViewBuildingViewMessage.class,    4,  Side.CLIENT);
        getNetwork().registerMessage(ColonyViewRemoveBuildingMessage.class,  ColonyViewRemoveBuildingMessage.class,  5,  Side.CLIENT);
        getNetwork().registerMessage(PermissionsMessage.View.class,          PermissionsMessage.View.class,          6,  Side.CLIENT);
        getNetwork().registerMessage(ColonyStylesMessage.class,              ColonyStylesMessage.class,              7,  Side.CLIENT);
        //  Permission Request messages
        getNetwork().registerMessage(PermissionsMessage.Permission.class,    PermissionsMessage.Permission.class,    10, Side.SERVER);
        getNetwork().registerMessage(PermissionsMessage.AddPlayer.class,     PermissionsMessage.AddPlayer.class,     11, Side.SERVER);
        getNetwork().registerMessage(PermissionsMessage.RemovePlayer.class,  PermissionsMessage.RemovePlayer.class,  12, Side.SERVER);
        getNetwork().registerMessage(PermissionsMessage.SetPlayerRank.class, PermissionsMessage.SetPlayerRank.class, 13, Side.SERVER);
        //  Colony Request messages
        getNetwork().registerMessage(BuildRequestMessage.class,              BuildRequestMessage.class,              20, Side.SERVER);
        getNetwork().registerMessage(OpenInventoryMessage.class,             OpenInventoryMessage.class,             21, Side.SERVER);
        getNetwork().registerMessage(TownHallRenameMessage.class,            TownHallRenameMessage.class,            22, Side.SERVER);
        getNetwork().registerMessage(MinerSetLevelMessage.class,             MinerSetLevelMessage.class,             23, Side.SERVER);
        getNetwork().registerMessage(FarmerCropTypeMessage.class,            FarmerCropTypeMessage.class,            24, Side.SERVER);
        getNetwork().registerMessage(RecallCitizenMessage.class,             RecallCitizenMessage.class,             25, Side.SERVER);
        getNetwork().registerMessage(BuildToolPlaceMessage.class,            BuildToolPlaceMessage.class,            26, Side.SERVER);
        getNetwork().registerMessage(ToggleJobMessage.class,                 ToggleJobMessage.class,                 27, Side.SERVER);
        getNetwork().registerMessage(HireFireMessage.class,                  HireFireMessage.class,                  28, Side.SERVER);

        //Client side only
        getNetwork().registerMessage(BlockParticleEffectMessage.class,       BlockParticleEffectMessage.class,       50, Side.CLIENT);

        proxy.registerTileEntities();

        RecipeHandler.init(Configurations.enableInDevelopmentFeatures, Configurations.supplyChests);

        proxy.registerEvents();

        proxy.registerTileEntityRendering();
        
        proxy.registerRenderer();

        Schematics.init();
    }

    @Mod.EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
    }

    /**
     * Returns whether the side is client or not
     *
     * @return      True when client, otherwise false
     */
    public static boolean isClient()
    {
        return proxy.isClient() && FMLCommonHandler.instance().getEffectiveSide().isClient();
    }

    /**
     * Returns whether the side is client or not
     *
     * @return      True when server, otherwise false
     */
    public static boolean isServer()
    {
        return !proxy.isClient() && FMLCommonHandler.instance().getEffectiveSide().isServer();
    }
}

Developer of Primeval Forest.

Link to comment
Share on other sites

ClientProxy

package com.minecolonies.proxy;

import com.minecolonies.blocks.ModBlocks;
import com.minecolonies.client.gui.WindowBuildTool;
import com.minecolonies.client.gui.WindowCitizen;
import com.minecolonies.client.render.EmptyTileEntitySpecialRenderer;
import com.minecolonies.client.render.RenderBipedCitizen;
import com.minecolonies.client.render.RenderFishHook;
import com.minecolonies.client.render.TileEntityScarecrowRenderer;
import com.minecolonies.colony.CitizenData;
import com.minecolonies.entity.EntityCitizen;
import com.minecolonies.entity.EntityFishHook;
import com.minecolonies.event.ClientEventHandler;
import com.minecolonies.items.ModItems;
import com.minecolonies.tileentities.ScarecrowTileEntity;
import com.minecolonies.tileentities.TileEntityColonyBuilding;
import com.schematica.client.events.TickHandler;
import com.schematica.client.renderer.RendererSchematicGlobal;
import com.schematica.world.SchematicWorld;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.util.BlockPos;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry;

public class ClientProxy extends CommonProxy
{
    private RendererSchematicGlobal rendererSchematicGlobal;
    private SchematicWorld          schematicWorld          = null;

    @Override
    public boolean isClient()
    {
        return true;
    }

    @Override
    public void registerKeyBindings()
    {
//        for(KeyBinding keyBinding : KeyInputHandler.KEY_BINDINGS)
//        {
//            ClientRegistry.registerKeyBinding(keyBinding);
//        }
    }

    @Override
    public void registerEvents()
    {
        super.registerEvents();

        MinecraftForge.EVENT_BUS.register(new ClientEventHandler());

        //Schematica
        MinecraftForge.EVENT_BUS.register(new TickHandler());
        this.rendererSchematicGlobal = new RendererSchematicGlobal();
        MinecraftForge.EVENT_BUS.register(this.rendererSchematicGlobal);
    }

    @Override
    public void registerEntityRendering()
    {
        RenderingRegistry.registerEntityRenderingHandler(EntityCitizen.class, RenderBipedCitizen::new);
        RenderingRegistry.registerEntityRenderingHandler(EntityFishHook.class, RenderFishHook::new);

    }

    @Override
    public void registerTileEntityRendering()
    {
        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityColonyBuilding.class, new EmptyTileEntitySpecialRenderer());
        ClientRegistry.bindTileEntitySpecialRenderer(ScarecrowTileEntity.class, new TileEntityScarecrowRenderer());
    }

    @Override
    public void showCitizenWindow(CitizenData.View citizen)
    {
        WindowCitizen window = new WindowCitizen(citizen);
        window.open();
    }

    @Override
    public void openBuildToolWindow(BlockPos pos)
    {
        WindowBuildTool window = new WindowBuildTool(pos);
        window.open();
    }

    //Schematica
    @Override
    public void setActiveSchematic(SchematicWorld world)
    {
        this.schematicWorld = world;
    }

    @Override
    public SchematicWorld getActiveSchematic()
    {
        return this.schematicWorld;
    }
    
    @Override
    public void registerRenderer() {
    	super.registerRenderer();
    	
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutBaker), 0, new ModelResourceLocation(ModBlocks.blockHutBaker.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutBlacksmith), 0, new ModelResourceLocation(ModBlocks.blockHutBlacksmith.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutBuilder), 0, new ModelResourceLocation(ModBlocks.blockHutBuilder.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutCitizen), 0, new ModelResourceLocation(ModBlocks.blockHutCitizen.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutFarmer), 0, new ModelResourceLocation(ModBlocks.blockHutFarmer.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutFisherman), 0, new ModelResourceLocation(ModBlocks.blockHutFisherman.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutLumberjack), 0, new ModelResourceLocation(ModBlocks.blockHutLumberjack.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutMiner), 0, new ModelResourceLocation(ModBlocks.blockHutMiner.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutStonemason), 0, new ModelResourceLocation(ModBlocks.blockHutStonemason.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutTownHall), 0, new ModelResourceLocation(ModBlocks.blockHutTownHall.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutWarehouse), 0, new ModelResourceLocation(ModBlocks.blockHutWarehouse.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockSubstitution), 0, new ModelResourceLocation(ModBlocks.blockSubstitution.getRegistryName(), "inventory"));
        //Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.blockHutField), 0, new ModelResourceLocation(ModBlocks.blockHutField.getRegistryName(), "inventory"));
    	
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.buildTool, 0, new ModelResourceLocation(ModItems.buildTool.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.caliper, 0, new ModelResourceLocation(ModItems.caliper.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.scanTool, 0, new ModelResourceLocation(ModItems.scanTool.getRegistryName(), "inventory"));
    	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.supplyChest, 0, new ModelResourceLocation(ModItems.supplyChest.getRegistryName(), "inventory"));
    	ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.blockHutField), 0, ScarecrowTileEntity.class);
    }
}

 

Main class:

package com.minecolonies;

import com.minecolonies.blocks.ModBlocks;
import com.minecolonies.colony.Schematics;
import com.minecolonies.configuration.ConfigurationHandler;
import com.minecolonies.configuration.Configurations;
import com.minecolonies.items.ModItems;
import com.minecolonies.lib.Constants;
import com.minecolonies.network.messages.*;
import com.minecolonies.proxy.IProxy;
import com.minecolonies.util.Log;
import com.minecolonies.util.RecipeHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.relauncher.Side;


@Mod(modid = Constants.MOD_ID, name = Constants.MOD_NAME, version = Constants.VERSION, certificateFingerprint = Constants.FINGERPRINT,
	dependencies = Constants.FORGE_VERSION, acceptedMinecraftVersions = Constants.MC_VERSION)
public class MineColonies
{
    private static          SimpleNetworkWrapper network;

    @Mod.Instance(Constants.MOD_ID)
    public static           MineColonies         instance;

    @SidedProxy(clientSide = Constants.CLIENT_PROXY_LOCATION, serverSide = Constants.SERVER_PROXY_LOCATION)
    public static           IProxy               proxy;

    public static SimpleNetworkWrapper getNetwork()
    {
        return network;
    }

    @Mod.EventHandler
    public void invalidFingerprint(FMLFingerprintViolationEvent event)
    {
        if(Constants.FINGERPRINT.equals("@FINGERPRINT@"))
        {
            Log.logger.error("No Fingerprint. Might not be a valid version!");
        }
    }

    @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
        //not needed, code already in init
        //logger = event.getModLog();

        ConfigurationHandler.init(event.getSuggestedConfigurationFile());

        ModBlocks.init();

        ModItems.init();

        proxy.registerKeyBindings();//Schematica
        
        proxy.registerEntities();

        proxy.registerEntityRendering();
    }

    @Mod.EventHandler
    public void init(FMLInitializationEvent event)
    {
        network = NetworkRegistry.INSTANCE.newSimpleChannel(Constants.MOD_NAME);
        //  ColonyView messages
        getNetwork().registerMessage(ColonyViewMessage.class,                ColonyViewMessage.class,                1,  Side.CLIENT);
        getNetwork().registerMessage(ColonyViewCitizenViewMessage.class,     ColonyViewCitizenViewMessage.class,     2,  Side.CLIENT);
        getNetwork().registerMessage(ColonyViewRemoveCitizenMessage.class,   ColonyViewRemoveCitizenMessage.class,   3,  Side.CLIENT);
        getNetwork().registerMessage(ColonyViewBuildingViewMessage.class,    ColonyViewBuildingViewMessage.class,    4,  Side.CLIENT);
        getNetwork().registerMessage(ColonyViewRemoveBuildingMessage.class,  ColonyViewRemoveBuildingMessage.class,  5,  Side.CLIENT);
        getNetwork().registerMessage(PermissionsMessage.View.class,          PermissionsMessage.View.class,          6,  Side.CLIENT);
        getNetwork().registerMessage(ColonyStylesMessage.class,              ColonyStylesMessage.class,              7,  Side.CLIENT);
        //  Permission Request messages
        getNetwork().registerMessage(PermissionsMessage.Permission.class,    PermissionsMessage.Permission.class,    10, Side.SERVER);
        getNetwork().registerMessage(PermissionsMessage.AddPlayer.class,     PermissionsMessage.AddPlayer.class,     11, Side.SERVER);
        getNetwork().registerMessage(PermissionsMessage.RemovePlayer.class,  PermissionsMessage.RemovePlayer.class,  12, Side.SERVER);
        getNetwork().registerMessage(PermissionsMessage.SetPlayerRank.class, PermissionsMessage.SetPlayerRank.class, 13, Side.SERVER);
        //  Colony Request messages
        getNetwork().registerMessage(BuildRequestMessage.class,              BuildRequestMessage.class,              20, Side.SERVER);
        getNetwork().registerMessage(OpenInventoryMessage.class,             OpenInventoryMessage.class,             21, Side.SERVER);
        getNetwork().registerMessage(TownHallRenameMessage.class,            TownHallRenameMessage.class,            22, Side.SERVER);
        getNetwork().registerMessage(MinerSetLevelMessage.class,             MinerSetLevelMessage.class,             23, Side.SERVER);
        getNetwork().registerMessage(FarmerCropTypeMessage.class,            FarmerCropTypeMessage.class,            24, Side.SERVER);
        getNetwork().registerMessage(RecallCitizenMessage.class,             RecallCitizenMessage.class,             25, Side.SERVER);
        getNetwork().registerMessage(BuildToolPlaceMessage.class,            BuildToolPlaceMessage.class,            26, Side.SERVER);
        getNetwork().registerMessage(ToggleJobMessage.class,                 ToggleJobMessage.class,                 27, Side.SERVER);
        getNetwork().registerMessage(HireFireMessage.class,                  HireFireMessage.class,                  28, Side.SERVER);

        //Client side only
        getNetwork().registerMessage(BlockParticleEffectMessage.class,       BlockParticleEffectMessage.class,       50, Side.CLIENT);

        proxy.registerTileEntities();

        RecipeHandler.init(Configurations.enableInDevelopmentFeatures, Configurations.supplyChests);

        proxy.registerEvents();

        proxy.registerTileEntityRendering();
        
        proxy.registerRenderer();

        Schematics.init();
    }

    @Mod.EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
    }

    /**
     * Returns whether the side is client or not
     *
     * @return      True when client, otherwise false
     */
    public static boolean isClient()
    {
        return proxy.isClient() && FMLCommonHandler.instance().getEffectiveSide().isClient();
    }

    /**
     * Returns whether the side is client or not
     *
     * @return      True when server, otherwise false
     */
    public static boolean isServer()
    {
        return !proxy.isClient() && FMLCommonHandler.instance().getEffectiveSide().isServer();
    }
}

Developer of Primeval Forest.

Link to comment
Share on other sites

Well, but it does not:

latnT5p.png

 

As you can see there, in the inventory it's rendering a missing texture thing as a block. But it should not be a block and not be a missing texture thing.

And for some reason, I commented out the json file loading, but it's still rendering the chest.

And the 3d model itself is rendered in black instead of using the texture. And no, the texture is not black.

Developer of Primeval Forest.

Link to comment
Share on other sites

Well, but it does not:

latnT5p.png

 

As you can see there, in the inventory it's rendering a missing texture thing as a block. But it should not be a block and not be a missing texture thing.

And for some reason, I commented out the json file loading, but it's still rendering the chest.

And the 3d model itself is rendered in black instead of using the texture. And no, the texture is not black.

Developer of Primeval Forest.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.