Finished changes to ClientProxy
This commit is contained in:
parent
88a5f573a0
commit
4f94735c79
5 changed files with 20 additions and 23 deletions
|
@ -19,11 +19,6 @@ import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||||
|
|
||||||
public class CommonProxy {
|
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() {}
|
public void registerRenderers() {}
|
||||||
|
|
||||||
|
@ -74,8 +69,7 @@ public class CommonProxy {
|
||||||
|
|
||||||
public void updateDoorTE(BaseDimDoor door, World world, BlockPos pos) {
|
public void updateDoorTE(BaseDimDoor door, World world, BlockPos pos) {
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
if (tile instanceof TileEntityDimDoor)
|
if (tile instanceof TileEntityDimDoor) {
|
||||||
{
|
|
||||||
IBlockState state = world.getBlockState(pos);
|
IBlockState state = world.getBlockState(pos);
|
||||||
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
|
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
|
||||||
dimTile.openOrClosed = door.isDoorOnRift(world, pos) && door.isUpperDoorBlock(state);
|
dimTile.openOrClosed = door.isDoorOnRift(world, pos) && door.isUpperDoorBlock(state);
|
||||||
|
|
|
@ -8,24 +8,29 @@ import com.zixiken.dimdoors.tileentities.TileEntityDimDoor;
|
||||||
import com.zixiken.dimdoors.tileentities.TileEntityTransTrapdoor;
|
import com.zixiken.dimdoors.tileentities.TileEntityTransTrapdoor;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
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.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
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.client.registry.RenderingRegistry;
|
||||||
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||||
|
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy {
|
public class ClientProxy extends CommonProxy {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerRenderers() {
|
public void registerRenderers() {
|
||||||
//MinecraftForgeClient.preloadTexture(BLOCK_PNG);
|
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDimDoor.class, new RenderDimDoor());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDimDoor.class, new RenderDimDoor());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTransTrapdoor.class, new RenderTransTrapdoor());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTransTrapdoor.class, new RenderTransTrapdoor());
|
||||||
|
|
||||||
//MinecraftForgeClient.preloadTexture(RIFT2_PNG);
|
RenderingRegistry.registerEntityRenderingHandler(MobMonolith.class, new IRenderFactory<MobMonolith>() {
|
||||||
RenderingRegistry.registerEntityRenderingHandler(MobMonolith.class, new RenderMobObelisk(.5F));
|
@Override
|
||||||
RenderingRegistry.registerBlockHandler(new PrivatePocketRender(RenderingRegistry.getNextAvailableRenderId()));
|
public Render<? super MobMonolith> createRenderFor(RenderManager manager) {
|
||||||
|
return new RenderMobObelisk(manager);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -33,7 +38,7 @@ public class ClientProxy extends CommonProxy {
|
||||||
ClientOnlyHooks hooks = new ClientOnlyHooks(DDProperties.instance());
|
ClientOnlyHooks hooks = new ClientOnlyHooks(DDProperties.instance());
|
||||||
MinecraftForge.EVENT_BUS.register(hooks);
|
MinecraftForge.EVENT_BUS.register(hooks);
|
||||||
MinecraftForge.TERRAIN_GEN_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());
|
PocketManager.getLinkWatcher().registerReceiver(new PocketManager.ClientLinkWatcher());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class RenderDimDoor extends TileEntitySpecialRenderer
|
public class RenderDimDoor extends TileEntitySpecialRenderer<TileEntityDimDoor>
|
||||||
{
|
{
|
||||||
private FloatBuffer buffer = GLAllocation.createDirectFloatBuffer(16);
|
private FloatBuffer buffer = GLAllocation.createDirectFloatBuffer(16);
|
||||||
private ResourceLocation warpPath= new ResourceLocation(DimDoors.modid + ":textures/other/WARP.png");
|
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 final int NETHER_DIMENSION_ID = -1;
|
||||||
private static DDProperties properties = null;
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public RenderDimDoor()
|
public RenderDimDoor() {
|
||||||
{
|
|
||||||
if (properties == null)
|
if (properties == null)
|
||||||
properties = DDProperties.instance();
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.zixiken.dimdoors.ticking.MobMonolith;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
@ -18,13 +19,12 @@ import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class RenderMobObelisk extends RenderLiving
|
public class RenderMobObelisk extends RenderLiving<MobMonolith>
|
||||||
{
|
{
|
||||||
protected ModelMobObelisk obeliskModel;
|
protected ModelMobObelisk obeliskModel;
|
||||||
|
|
||||||
public RenderMobObelisk(float f)
|
public RenderMobObelisk(RenderManager manager) {
|
||||||
{
|
super(manager, new ModelMobObelisk(), 0.5F);
|
||||||
super(new ModelMobObelisk(), f);
|
|
||||||
this.obeliskModel = (ModelMobObelisk)this.mainModel;
|
this.obeliskModel = (ModelMobObelisk)this.mainModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
public class RenderTransTrapdoor extends TileEntitySpecialRenderer<TileEntityTransTrapdoor> {
|
||||||
{
|
|
||||||
private FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
private FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
||||||
private static DDProperties properties = null;
|
private static DDProperties properties = null;
|
||||||
private ResourceLocation riftPath= new ResourceLocation(DimDoors.modid+":textures/other/RIFT.png");
|
private ResourceLocation riftPath= new ResourceLocation(DimDoors.modid+":textures/other/RIFT.png");
|
||||||
|
|
Loading…
Reference in a new issue