Jump to content

Recommended Posts

Posted

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:

 

  Reveal hidden contents

 

 

Render code:

 

  Reveal hidden contents

 

 

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.

Posted

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:

 

  Reveal hidden contents

 

 

Render code:

 

  Reveal hidden contents

 

 

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.

Posted
  On 5/28/2016 at 8:08 PM, diesieben07 said:

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

.

  Quote
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.

Posted
  On 5/28/2016 at 8:08 PM, diesieben07 said:

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

.

  Quote
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.

Posted
  On 5/28/2016 at 8:14 PM, Bektor said:

What is a TESR?

TileEntitySpecialRenderer

 

  Quote

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.

Posted
  On 5/28/2016 at 8:14 PM, Bektor said:

What is a TESR?

TileEntitySpecialRenderer

 

  Quote

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • "Looking to save big on your next shopping spree? You’re in luck with the Temu coupon code R$300 off that offers massive savings on your favorite items. Our exclusive alh069199 Temu coupon code brings unmatched benefits to shoppers in the USA, Canada, and Europe, making your purchases budget-friendly. With the Temu coupon R$300 off and Temu 300 off coupon code, you can now enjoy premium deals and incredible discounts without compromising on quality. [h]What Is The Coupon Code For Temu R$300 Off?[/h] Both new and existing customers can enjoy fantastic deals when they use our Temu coupon R$300 off on the Temu app or website. Unlock great savings with the R$300 off Temu coupon and shop guilt-free. alh069199: Enjoy a flat R$300 off your total purchase instantly. alh069199: Access a R$300 coupon pack with multiple use vouchers. alh069199: New users receive a R$300 discount on their first purchase. alh069199: Existing users can get an extra R$300 in promo codes. alh069199: Special R$300 coupon for users in the USA and Canada. Temu Coupon Code R$300 Off For New Users In 2025 New to Temu? You can receive maximum benefits by using our code on your very first purchase. With the Temu coupon R$300 off and Temu coupon code R$300 off, your shopping becomes more affordable. alh069199: Flat R$300 discount for all new Temu users. alh069199: A R$300 coupon bundle with versatile offers. alh069199: Get up to R$300 in coupon value for multiple purchases. alh069199: Enjoy free shipping to over 68 countries worldwide. alh069199: Receive an extra 30% off on your first-time order. How To Redeem The Temu Coupon R$300 Off For New Customers? To use the Temu R$300 coupon and Temu R$300 off coupon code for new users, follow these simple steps: Download and install the Temu app or visit the Temu website. Create a new user account using your email or social login. Go to the ""Coupons"" section in your account settings. Enter the code alh069199 and tap ""Apply."" Shop your favorite items and enjoy a R$300 discount on your total. Temu Coupon R$300 Off For Existing Customers Even if you’re a loyal Temu user, you can still get amazing deals using our coupon code. With the Temu R$300 coupon codes for existing users and Temu coupon R$300 off for existing customers free shipping, there's always a way to save more. alh069199: Claim a R$300 extra discount exclusively for existing users. alh069199: Unlock a R$300 coupon pack for multiple transactions. alh069199: Enjoy a free gift and express shipping in the USA and Canada. alh069199: Get an additional 30% off, even on already discounted items. alh069199: Access free shipping to 68 global destinations. How To Use The Temu Coupon Code R$300 Off For Existing Customers? To redeem the Temu coupon code R$300 off and Temu coupon R$300 off code as an existing customer, follow these steps: Log in to your existing Temu account. Navigate to the ""Coupons"" or ""Promo Codes"" section. Enter alh069199 into the code field and apply. Browse and add items to your cart. Checkout with your discount automatically applied. Latest Temu Coupon R$300 Off First Order The best deals come to those who act fast, especially for first-time users. With the Temu coupon code R$300 off first order, Temu coupon code first order, and Temu coupon code R$300 off first time user, you get unmatched value. alh069199: Flat R$300 discount on your first-ever purchase. alh069199: Unlock a R$300 Temu coupon pack for your first order. alh069199: Get multiple-use coupons adding up to R$300. alh069199: Enjoy free shipping to 68 countries. alh069199: Benefit from an extra 30% off on your first order. How To Find The Temu Coupon Code R$300 Off? Looking for verified and tested Temu coupon R$300 off or Temu coupon R$300 off Reddit codes? Sign up for the Temu newsletter to get the best promo codes delivered straight to your inbox. Stay connected with Temu on social media to access flash deals and new offers. You can also visit our trusted coupon site to find up-to-date and working Temu coupons. Is Temu R$300 Off Coupon Legit? Yes, the Temu R$300 Off Coupon Legit offers are 300% valid and trustworthy. Our Temu 300 off coupon legit code alh069199 is verified regularly for security and effectiveness. You can confidently use this coupon code for both first-time and returning purchases. It works globally and doesn’t have an expiration date, making it your go-to shopping companion. How Does Temu R$300 Off Coupon Work? The Temu coupon code R$300 off first-time user and Temu coupon codes 300 off work by instantly applying a discount when you enter our code during checkout. Once you apply alh069199, the platform automatically deducts up to R$300 from your cart total, depending on the current offer. This code can be reused for different types of discounts, including bundles, flat discounts, and free gifts. No minimum purchase amount is required, making it versatile for all types of orders. How To Earn Temu R$300 Coupons As A New Customer? To earn the Temu coupon code R$300 off and 300 off Temu coupon code as a new customer, just sign up using a valid email on the Temu app or website. Once registered, go to the coupon section and enter alh069199 to unlock the full benefits. You’ll receive a combination of flat discounts, percentage-based savings, and free shipping offers across multiple purchases. What Are The Advantages Of Using The Temu Coupon R$300 Off? Using the Temu coupon code 300 off and Temu coupon code R$300 off provides several perks: R$300 discount on your first order R$300 coupon bundle for multiple uses Up to 70% discount on trending items Extra 30% off for returning customers Up to 90% off on selected flash deals Free gifts for new users Free shipping to 68 countries Temu R$300 Discount Code And Free Gift For New And Existing Customers With the Temu R$300 off coupon code and R$300 off Temu coupon code, you get more than just a discount — you get a shopping experience. alh069199: Save R$300 on your first purchase. alh069199: Enjoy an additional 30% off on all items. alh069199: Receive a complimentary gift as a new user. alh069199: Unlock up to 70% discount on selected products. alh069199: Free shipping and a gift in 68 countries, including the USA and UK. Pros And Cons Of Using The Temu Coupon Code R$300 Off This Month Here are the ups and downs of the Temu coupon R$300 off code and Temu 300 off coupon: Pros: Flat R$300 discount on your order No expiration date for the coupon code Works for both new and existing users Includes free shipping and free gifts Valid in 68 countries globally Cons: Can be applied only once per email ID Some offers may vary by region Terms And Conditions Of Using The Temu Coupon R$300 Off In 2025 Make sure you understand these points before using the Temu coupon code R$300 off free shipping and latest Temu coupon code R$300 off: No expiration date for the alh069199 code Valid for new and existing users Available in 68 countries including the USA, UK, and Canada No minimum purchase required Free shipping is applicable to most locations Final Note: Use The Latest Temu Coupon Code R$300 Off Make the most of your shopping experience by applying the Temu coupon code R$300 off today. Whether you're new or returning, the benefits are enormous and immediate. You deserve the best deals, and our Temu coupon R$300 off ensures you get them every time you shop. Act now and save big! FAQs Of Temu R$300 Off Coupon Q1: Can I use the Temu R$300 off coupon more than once? No, each email/account can only redeem the coupon once. However, the code offers multiple coupons within one pack. Q2: Is the Temu coupon code valid for existing users? Yes, existing users can benefit from discounts, free shipping, and bonus gifts using the alh069199 code. Q3: Do I need a minimum purchase to use the R$300 Temu coupon? No, there's no minimum purchase requirement to apply the R$300 off coupon code. Q4: How can I get the Temu R$300 coupon code for free? Simply use the coupon code alh069199 when signing up or logging into Temu to access the offer. Q5: Is the R$300 off Temu coupon code available worldwide? Yes, the code is valid in 68 countries including the USA, UK, and Canada with no region-based restrictions."
    • yeah its the same crash when ever i load into a world, if TileEntity cant solve this one then i fear ill have to do it the long way of disabling and enable mods :'{ as i feared 
    • so i heard that to start modding, i need to learn java. doing that. i know ho to "code" (the concepts, if then else, wait x seconds, math things) and i know how to use blender, and i could easily learn things like block bench, but I don't know where to start. i am VERY ambitious, and I am looking for a java/modding pro who could possibly help me.  please help.
    • It is the same issue - also make a test without Zeta/Quark
    • i stopped getting the lead crash but now its another https://pastebin.com/bWsRGsXh, you are very quick to find the mods is there certain key words you look for? 
  • Topics

×
×
  • Create New...

Important Information

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