Finished changes to ClientProxy

This commit is contained in:
zangamj 2016-06-18 12:28:16 -04:00
parent 88a5f573a0
commit 4f94735c79
5 changed files with 20 additions and 23 deletions

View file

@ -19,11 +19,6 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
public class CommonProxy {
public static String BLOCK_PNG = "/PocketBlockTextures.png";
public static String ITEM_PNG = "/PocketItemTextures.png";
public static String RIFT_PNG = "/RIFT.png";
public static String RIFT2_PNG = "/RIFT2.png";
public static String WARP_PNG = "/WARP.png";
public void registerRenderers() {}
@ -74,8 +69,7 @@ public class CommonProxy {
public void updateDoorTE(BaseDimDoor door, World world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileEntityDimDoor)
{
if (tile instanceof TileEntityDimDoor) {
IBlockState state = world.getBlockState(pos);
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
dimTile.openOrClosed = door.isDoorOnRift(world, pos) && door.isUpperDoorBlock(state);

View file

@ -8,24 +8,29 @@ import com.zixiken.dimdoors.tileentities.TileEntityDimDoor;
import com.zixiken.dimdoors.tileentities.TileEntityTransTrapdoor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
public class ClientProxy extends CommonProxy {
@Override
public void registerRenderers() {
//MinecraftForgeClient.preloadTexture(BLOCK_PNG);
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDimDoor.class, new RenderDimDoor());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTransTrapdoor.class, new RenderTransTrapdoor());
//MinecraftForgeClient.preloadTexture(RIFT2_PNG);
RenderingRegistry.registerEntityRenderingHandler(MobMonolith.class, new RenderMobObelisk(.5F));
RenderingRegistry.registerBlockHandler(new PrivatePocketRender(RenderingRegistry.getNextAvailableRenderId()));
RenderingRegistry.registerEntityRenderingHandler(MobMonolith.class, new IRenderFactory<MobMonolith>() {
@Override
public Render<? super MobMonolith> createRenderFor(RenderManager manager) {
return new RenderMobObelisk(manager);
}
});
}
@Override
@ -33,7 +38,7 @@ public class ClientProxy extends CommonProxy {
ClientOnlyHooks hooks = new ClientOnlyHooks(DDProperties.instance());
MinecraftForge.EVENT_BUS.register(hooks);
MinecraftForge.TERRAIN_GEN_BUS.register(hooks);
PocketManager.getDimwatcher().registerReceiver (new PocketManager.ClientDimWatcher());
PocketManager.getDimwatcher().registerReceiver(new PocketManager.ClientDimWatcher());
PocketManager.getLinkWatcher().registerReceiver(new PocketManager.ClientLinkWatcher());
}

View file

@ -26,7 +26,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderDimDoor extends TileEntitySpecialRenderer
public class RenderDimDoor extends TileEntitySpecialRenderer<TileEntityDimDoor>
{
private FloatBuffer buffer = GLAllocation.createDirectFloatBuffer(16);
private ResourceLocation warpPath= new ResourceLocation(DimDoors.modid + ":textures/other/WARP.png");
@ -39,8 +39,7 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
private static final int NETHER_DIMENSION_ID = -1;
private static DDProperties properties = null;
public RenderDimDoor()
{
public RenderDimDoor() {
if (properties == null)
properties = DDProperties.instance();
}

View file

@ -5,6 +5,7 @@ import com.zixiken.dimdoors.ticking.MobMonolith;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
@ -18,13 +19,12 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderMobObelisk extends RenderLiving
public class RenderMobObelisk extends RenderLiving<MobMonolith>
{
protected ModelMobObelisk obeliskModel;
public RenderMobObelisk(float f)
{
super(new ModelMobObelisk(), f);
public RenderMobObelisk(RenderManager manager) {
super(manager, new ModelMobObelisk(), 0.5F);
this.obeliskModel = (ModelMobObelisk)this.mainModel;
}

View file

@ -20,8 +20,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderTransTrapdoor extends TileEntitySpecialRenderer
{
public class RenderTransTrapdoor extends TileEntitySpecialRenderer<TileEntityTransTrapdoor> {
private FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
private static DDProperties properties = null;
private ResourceLocation riftPath= new ResourceLocation(DimDoors.modid+":textures/other/RIFT.png");