mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Some import renames and compile error fixes, killed ~800.
This commit is contained in:
1 parent
1f80eb17df
commit
ac7c4d2f6c
90 files changed
+454
-441
No files matched your search
@@ -4,8 +4,8 @@ import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.resources.model.ModelBakery;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -14,10 +14,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
@@ -212,7 +212,7 @@ public class DynBucketTest
|
||||
IFluidHandler tank = (IFluidHandler) te;
|
||||
side = side.getOpposite();
|
||||
|
||||
ItemStack stack = playerIn.getHeldItem();
|
||||
ItemStack stack = playerIn.inventory.getCurrentItem();
|
||||
if (stack == null)
|
||||
{
|
||||
sendText(playerIn, tank, side);
|
||||
@@ -245,7 +245,7 @@ public class DynBucketTest
|
||||
{
|
||||
text = "empty";
|
||||
}
|
||||
player.addChatMessage(new ChatComponentText(text));
|
||||
player.addChatMessage(new TextComponentString(text));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -318,11 +318,11 @@ public class DynBucketTest
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeToNBT(tag);
|
||||
return new S35PacketUpdateTileEntity(this.getPos(), this.getBlockMetadata(), tag);
|
||||
return new SPacketUpdateTileEntity(this.getPos(), this.getBlockMetadata(), tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
|
||||
super.onDataPacket(net, pkt);
|
||||
readFromNBT(pkt.getNbtCompound());
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockWall;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
@@ -102,8 +102,8 @@ public class ForgeBlockStatesLoaderDebug {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, VARIANT);
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, VARIANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package net.minecraftforge.debug;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -14,12 +14,12 @@ import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.model.IFlexibleBakedModel;
|
||||
import net.minecraftforge.client.model.ISmartBlockModel;
|
||||
@@ -133,9 +133,9 @@ public class LayerBreakingTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(EnumWorldBlockLayer layer)
|
||||
public boolean canRenderInLayer(BlockRenderLayer layer)
|
||||
{
|
||||
return layer == EnumWorldBlockLayer.SOLID || layer == EnumWorldBlockLayer.TRANSLUCENT;
|
||||
return layer == BlockRenderLayer.SOLID || layer == BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -196,7 +196,7 @@ public class LayerBreakingTest
|
||||
solid = new TestBakedModel(models.getModelForState(Blocks.cobblestone.getDefaultState()).getParticleTexture(), false);
|
||||
}
|
||||
|
||||
if (net.minecraftforge.client.MinecraftForgeClient.getRenderLayer() == EnumWorldBlockLayer.SOLID)
|
||||
if (net.minecraftforge.client.MinecraftForgeClient.getRenderLayer() == BlockRenderLayer.SOLID)
|
||||
{
|
||||
return solid;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
@@ -9,20 +9,22 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -158,7 +160,7 @@ public class ModelBakeEventDebug
|
||||
if(te instanceof CustomTileEntity)
|
||||
{
|
||||
CustomTileEntity cte = (CustomTileEntity) te;
|
||||
Vec3 vec = revRotate(new Vec3(hitX - .5, hitY - .5, hitZ - .5), side).addVector(.5, .5, .5);
|
||||
Vec3d vec = revRotate(new Vec3d(hitX - .5, hitY - .5, hitZ - .5), side).addVector(.5, .5, .5);
|
||||
IUnlistedProperty<Integer> property = properties[side.ordinal()];
|
||||
Integer value = cte.getState().getValue(property);
|
||||
if(value == null) value = 0;
|
||||
@@ -182,7 +184,7 @@ public class ModelBakeEventDebug
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState(this, new IProperty[0], properties);
|
||||
}
|
||||
@@ -247,10 +249,10 @@ public class ModelBakeEventDebug
|
||||
|
||||
private BakedQuad createSidedBakedQuad(float x1, float x2, float z1, float z2, float y, TextureAtlasSprite texture, EnumFacing side)
|
||||
{
|
||||
Vec3 v1 = rotate(new Vec3(x1 - .5, y - .5, z1 - .5), side).addVector(.5, .5, .5);
|
||||
Vec3 v2 = rotate(new Vec3(x1 - .5, y - .5, z2 - .5), side).addVector(.5, .5, .5);
|
||||
Vec3 v3 = rotate(new Vec3(x2 - .5, y - .5, z2 - .5), side).addVector(.5, .5, .5);
|
||||
Vec3 v4 = rotate(new Vec3(x2 - .5, y - .5, z1 - .5), side).addVector(.5, .5, .5);
|
||||
Vec3d v1 = rotate(new Vec3d(x1 - .5, y - .5, z1 - .5), side).addVector(.5, .5, .5);
|
||||
Vec3d v2 = rotate(new Vec3d(x1 - .5, y - .5, z2 - .5), side).addVector(.5, .5, .5);
|
||||
Vec3d v3 = rotate(new Vec3d(x2 - .5, y - .5, z2 - .5), side).addVector(.5, .5, .5);
|
||||
Vec3d v4 = rotate(new Vec3d(x2 - .5, y - .5, z1 - .5), side).addVector(.5, .5, .5);
|
||||
return new BakedQuad(Ints.concat(
|
||||
vertexToInts((float)v1.xCoord, (float)v1.yCoord, (float)v1.zCoord, -1, texture, 0, 0),
|
||||
vertexToInts((float)v2.xCoord, (float)v2.yCoord, (float)v2.zCoord, -1, texture, 0, 16),
|
||||
@@ -317,30 +319,30 @@ public class ModelBakeEventDebug
|
||||
}
|
||||
}
|
||||
|
||||
private static Vec3 rotate(Vec3 vec, EnumFacing side)
|
||||
private static Vec3d rotate(Vec3d vec, EnumFacing side)
|
||||
{
|
||||
switch(side)
|
||||
{
|
||||
case DOWN: return new Vec3( vec.xCoord, -vec.yCoord, -vec.zCoord);
|
||||
case UP: return new Vec3( vec.xCoord, vec.yCoord, vec.zCoord);
|
||||
case NORTH: return new Vec3( vec.xCoord, vec.zCoord, -vec.yCoord);
|
||||
case SOUTH: return new Vec3( vec.xCoord, -vec.zCoord, vec.yCoord);
|
||||
case WEST: return new Vec3(-vec.yCoord, vec.xCoord, vec.zCoord);
|
||||
case EAST: return new Vec3( vec.yCoord, -vec.xCoord, vec.zCoord);
|
||||
case DOWN: return new Vec3d( vec.xCoord, -vec.yCoord, -vec.zCoord);
|
||||
case UP: return new Vec3d( vec.xCoord, vec.yCoord, vec.zCoord);
|
||||
case NORTH: return new Vec3d( vec.xCoord, vec.zCoord, -vec.yCoord);
|
||||
case SOUTH: return new Vec3d( vec.xCoord, -vec.zCoord, vec.yCoord);
|
||||
case WEST: return new Vec3d(-vec.yCoord, vec.xCoord, vec.zCoord);
|
||||
case EAST: return new Vec3d( vec.yCoord, -vec.xCoord, vec.zCoord);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Vec3 revRotate(Vec3 vec, EnumFacing side)
|
||||
private static Vec3d revRotate(Vec3d vec, EnumFacing side)
|
||||
{
|
||||
switch(side)
|
||||
{
|
||||
case DOWN: return new Vec3( vec.xCoord, -vec.yCoord, -vec.zCoord);
|
||||
case UP: return new Vec3( vec.xCoord, vec.yCoord, vec.zCoord);
|
||||
case NORTH: return new Vec3( vec.xCoord, -vec.zCoord, vec.yCoord);
|
||||
case SOUTH: return new Vec3( vec.xCoord, vec.zCoord, -vec.yCoord);
|
||||
case WEST: return new Vec3( vec.yCoord, -vec.xCoord, vec.zCoord);
|
||||
case EAST: return new Vec3(-vec.yCoord, vec.xCoord, vec.zCoord);
|
||||
case DOWN: return new Vec3d( vec.xCoord, -vec.yCoord, -vec.zCoord);
|
||||
case UP: return new Vec3d( vec.xCoord, vec.yCoord, vec.zCoord);
|
||||
case NORTH: return new Vec3d( vec.xCoord, -vec.zCoord, vec.yCoord);
|
||||
case SOUTH: return new Vec3d( vec.xCoord, vec.zCoord, -vec.yCoord);
|
||||
case WEST: return new Vec3d( vec.yCoord, -vec.xCoord, vec.zCoord);
|
||||
case EAST: return new Vec3d(-vec.yCoord, vec.xCoord, vec.zCoord);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.client.resources.model.ModelBakery;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -17,21 +17,21 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -86,26 +86,26 @@ public class ModelLoaderRegistryDebug
|
||||
B3DLoader.instance.addDomain(MODID.toLowerCase());
|
||||
Item item = Item.getItemFromBlock(CustomModelBlock.instance);
|
||||
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + CustomModelBlock.name, "inventory"));
|
||||
|
||||
|
||||
OBJLoader.instance.addDomain(MODID.toLowerCase());
|
||||
Item item2 = Item.getItemFromBlock(OBJTesseractBlock.instance);
|
||||
ModelLoader.setCustomModelResourceLocation(item2, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJTesseractBlock.name, "inventory"));
|
||||
|
||||
|
||||
Item item3 = Item.getItemFromBlock(OBJVertexColoring1.instance);
|
||||
ModelLoader.setCustomModelResourceLocation(item3, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJVertexColoring1.name, "inventory"));
|
||||
|
||||
|
||||
Item item4 = Item.getItemFromBlock(OBJDirectionEye.instance);
|
||||
ModelLoader.setCustomModelResourceLocation(item4, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJDirectionEye.name, "inventory"));
|
||||
|
||||
|
||||
Item item5 = Item.getItemFromBlock(OBJVertexColoring2.instance);
|
||||
ModelLoader.setCustomModelResourceLocation(item5, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJVertexColoring2.name, "inventory"));
|
||||
|
||||
|
||||
Item item6 = Item.getItemFromBlock(OBJDirectionBlock.instance);
|
||||
ModelLoader.setCustomModelResourceLocation(item6, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJDirectionBlock.name, "inventory"));
|
||||
|
||||
|
||||
Item item7 = Item.getItemFromBlock(OBJCustomDataBlock.instance);
|
||||
ModelLoader.setCustomModelResourceLocation(item7, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJCustomDataBlock.name, "inventory"));
|
||||
|
||||
|
||||
Item item8 = Item.getItemFromBlock(OBJDynamicEye.instance);
|
||||
ModelLoader.setCustomModelResourceLocation(item8, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJDynamicEye.name, "inventory"));
|
||||
}
|
||||
@@ -127,10 +127,10 @@ public class ModelLoaderRegistryDebug
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() { return false; }
|
||||
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() { return false; }
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
@@ -140,19 +140,19 @@ public class ModelLoaderRegistryDebug
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, getFacingFromEntity(world, pos, placer));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
@@ -174,13 +174,13 @@ public class ModelLoaderRegistryDebug
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState()
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{B3DLoader.B3DFrameProperty.instance});
|
||||
}
|
||||
|
||||
|
||||
public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn)
|
||||
{
|
||||
if (MathHelper.abs((float)entityIn.posX - (float)clickedBlock.getX()) < 2.0F && MathHelper.abs((float)entityIn.posZ - (float)clickedBlock.getZ()) < 2.0F)
|
||||
@@ -217,29 +217,29 @@ public class ModelLoaderRegistryDebug
|
||||
public static final OBJTesseractBlock instance = new OBJTesseractBlock();
|
||||
public static final String name = "OBJTesseractBlock";
|
||||
private ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
||||
|
||||
|
||||
private OBJTesseractBlock()
|
||||
{
|
||||
super(Material.iron);
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName(MODID + ":" + name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
return new OBJTesseractTileEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() { return false; }
|
||||
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
@@ -247,7 +247,7 @@ public class ModelLoaderRegistryDebug
|
||||
OBJModel.OBJState retState = new OBJModel.OBJState(tileEntity == null ? Lists.newArrayList(OBJModel.Group.ALL) : tileEntity.visible, true);
|
||||
return ((IExtendedBlockState) this.state.getBaseState()).withProperty(OBJModel.OBJProperty.instance, retState);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
@@ -262,7 +262,7 @@ public class ModelLoaderRegistryDebug
|
||||
{
|
||||
model = ModelLoaderRegistry.getMissingModel();
|
||||
}
|
||||
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
tileEntity.decrement();
|
||||
@@ -275,7 +275,7 @@ public class ModelLoaderRegistryDebug
|
||||
tileEntity.increment();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
OBJBakedModel objBaked = (OBJBakedModel) Minecraft.getMinecraft().getBlockRendererDispatcher().getModelFromBlockState(state, world, pos);
|
||||
@@ -284,25 +284,25 @@ public class ModelLoaderRegistryDebug
|
||||
world.markBlockRangeForRenderUpdate(pos, pos);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class OBJTesseractTileEntity extends TileEntity
|
||||
{
|
||||
private int counter = 1;
|
||||
private int max = 2;
|
||||
public List<String> visible = new ArrayList<String>();
|
||||
|
||||
|
||||
public OBJTesseractTileEntity()
|
||||
{
|
||||
this.visible.add(OBJModel.Group.ALL);
|
||||
}
|
||||
|
||||
|
||||
public void increment()
|
||||
{
|
||||
if (this.visible.contains(OBJModel.Group.ALL)) this.visible.remove(OBJModel.Group.ALL);
|
||||
@@ -313,10 +313,10 @@ public class ModelLoaderRegistryDebug
|
||||
}
|
||||
this.counter++;
|
||||
this.visible.add(Integer.toString(this.counter));
|
||||
ChatComponentText text = new ChatComponentText("" + this.counter);
|
||||
TextComponentString text = new TextComponentString("" + this.counter);
|
||||
if (this.worldObj.isRemote) Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(text);
|
||||
}
|
||||
|
||||
|
||||
public void decrement()
|
||||
{
|
||||
if (this.visible.contains(OBJModel.Group.ALL)) this.visible.remove(OBJModel.Group.ALL);
|
||||
@@ -327,10 +327,10 @@ public class ModelLoaderRegistryDebug
|
||||
}
|
||||
this.visible.remove(Integer.toString(this.counter));
|
||||
this.counter--;
|
||||
ChatComponentText text = new ChatComponentText("" + this.counter);
|
||||
TextComponentString text = new TextComponentString("" + this.counter);
|
||||
if (this.worldObj.isRemote) Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(text);
|
||||
}
|
||||
|
||||
|
||||
public void reset()
|
||||
{
|
||||
this.counter = 1;
|
||||
@@ -338,25 +338,25 @@ public class ModelLoaderRegistryDebug
|
||||
this.visible.clear();
|
||||
this.visible.add(Integer.toString(this.counter));
|
||||
}
|
||||
|
||||
|
||||
public int getMax()
|
||||
{
|
||||
return this.max;
|
||||
}
|
||||
|
||||
|
||||
public void setMax(int max)
|
||||
{
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
|
||||
public void setToMax()
|
||||
{
|
||||
this.counter = this.max;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This block demonstrates how to utilize the vertex coloring feature
|
||||
* This block demonstrates how to utilize the vertex coloring feature
|
||||
* of the OBJ loader. See 'vertex_coloring.obj' and 'vertex_coloring.mtl' in
|
||||
* 'test/resources/assets/forgedebugmodelloaderregistry/models/block/', to properly
|
||||
* utilize this feature an obj file must have 1 'usemtl' key before every vertex as shown,
|
||||
@@ -369,28 +369,28 @@ public class ModelLoaderRegistryDebug
|
||||
{
|
||||
public static final OBJVertexColoring1 instance = new OBJVertexColoring1();
|
||||
public static final String name = "OBJVertexColoring1";
|
||||
|
||||
|
||||
private OBJVertexColoring1()
|
||||
{
|
||||
super(Material.iron);
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() { return false; }
|
||||
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This block demonstrates how to use IProperties and IUnlistedProperties together
|
||||
* in the same ExtendedBlockState. Similar to pistons, this block will face the player
|
||||
* when placed. Unlike pistons, however; this block's model is an eyeball, because
|
||||
* when placed. Unlike pistons, however; this block's model is an eyeball, because
|
||||
* the OBJ loader can load spheres.
|
||||
* @author shadekiller666
|
||||
*
|
||||
@@ -401,7 +401,7 @@ public class ModelLoaderRegistryDebug
|
||||
public static final OBJDirectionEye instance = new OBJDirectionEye();
|
||||
public static final String name = "OBJDirectionEye";
|
||||
private ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[] {FACING}, new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
||||
|
||||
|
||||
private OBJDirectionEye()
|
||||
{
|
||||
super(Material.iron);
|
||||
@@ -409,47 +409,47 @@ public class ModelLoaderRegistryDebug
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, getFacingFromEntity(world, pos, placer));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IBlockState getStateForEntityRender(IBlockState state)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, EnumFacing.NORTH);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState()
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState(this, new IProperty[] {FACING}, new IUnlistedProperty[] {OBJModel.OBJProperty.instance});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() { return false; }
|
||||
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
@@ -458,7 +458,7 @@ public class ModelLoaderRegistryDebug
|
||||
OBJModel.OBJState retState = new OBJModel.OBJState(Arrays.asList(new String[]{OBJModel.Group.ALL}), true, transform);
|
||||
return ((IExtendedBlockState) state).withProperty(OBJModel.OBJProperty.instance, retState);
|
||||
}
|
||||
|
||||
|
||||
public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn)
|
||||
{
|
||||
if (MathHelper.abs((float)entityIn.posX - (float)clickedBlock.getX()) < 2.0F && MathHelper.abs((float)entityIn.posZ - (float)clickedBlock.getZ()) < 2.0F)
|
||||
@@ -479,9 +479,9 @@ public class ModelLoaderRegistryDebug
|
||||
return entityIn.getHorizontalFacing();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This block uses the same model as CustomModelBlock3 does, but
|
||||
* This block uses the same model as CustomModelBlock3 does, but
|
||||
* this class allows the player to cycle the colors of each vertex to black
|
||||
* and then back to the original color when right clicking on the block.
|
||||
* @author shadekiller666
|
||||
@@ -489,22 +489,22 @@ public class ModelLoaderRegistryDebug
|
||||
*/
|
||||
public static class OBJVertexColoring2 extends Block implements ITileEntityProvider
|
||||
{
|
||||
public static final OBJVertexColoring2 instance = new OBJVertexColoring2();
|
||||
public static final OBJVertexColoring2 instance = new OBJVertexColoring2();
|
||||
public static final String name = "OBJVertexColoring2";
|
||||
|
||||
|
||||
private OBJVertexColoring2()
|
||||
{
|
||||
super(Material.iron);
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
return new OBJVertexColoring2TileEntity();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
@@ -515,7 +515,7 @@ public class ModelLoaderRegistryDebug
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class OBJVertexColoring2TileEntity extends TileEntity
|
||||
{
|
||||
private int index = 0;
|
||||
@@ -523,9 +523,9 @@ public class ModelLoaderRegistryDebug
|
||||
private List<Vector4f> colorList = new ArrayList<Vector4f>();
|
||||
private boolean hasFilledList = false;
|
||||
private boolean shouldIncrement = true;
|
||||
|
||||
|
||||
public OBJVertexColoring2TileEntity() {}
|
||||
|
||||
|
||||
public void cycleColors()
|
||||
{
|
||||
if (this.worldObj.isRemote)
|
||||
@@ -577,7 +577,7 @@ public class ModelLoaderRegistryDebug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This block is a debug block that faces the player when placed, like a piston.
|
||||
* @author shadekiller666
|
||||
@@ -589,7 +589,7 @@ public class ModelLoaderRegistryDebug
|
||||
public static final OBJDirectionBlock instance = new OBJDirectionBlock();
|
||||
public static final String name = "OBJDirectionBlock";
|
||||
public ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
||||
|
||||
|
||||
private OBJDirectionBlock()
|
||||
{
|
||||
super(Material.iron);
|
||||
@@ -597,34 +597,34 @@ public class ModelLoaderRegistryDebug
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName(MODID + ":" + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() { return false; }
|
||||
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, getFacingFromEntity(world, pos, placer));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
@@ -634,13 +634,13 @@ public class ModelLoaderRegistryDebug
|
||||
OBJModel.OBJState newState = new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true, transform);
|
||||
return ((IExtendedBlockState) state).withProperty(OBJModel.OBJProperty.instance, newState);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState()
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
||||
}
|
||||
|
||||
|
||||
public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn)
|
||||
{
|
||||
if (MathHelper.abs((float)entityIn.posX - (float)clickedBlock.getX()) < 2.0F && MathHelper.abs((float)entityIn.posZ - (float)clickedBlock.getZ()) < 2.0F)
|
||||
@@ -661,7 +661,7 @@ public class ModelLoaderRegistryDebug
|
||||
return entityIn.getHorizontalFacing().getOpposite();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This block is a testing block that will be used to test the use
|
||||
* of "custom" data defined in a forge blockstate json. WIP, ignore for now.
|
||||
@@ -676,7 +676,7 @@ public class ModelLoaderRegistryDebug
|
||||
public static final PropertyBool EAST = PropertyBool.create("east");
|
||||
public static final OBJCustomDataBlock instance = new OBJCustomDataBlock();
|
||||
public static final String name = "OBJCustomDataBlock";
|
||||
|
||||
|
||||
private OBJCustomDataBlock()
|
||||
{
|
||||
super(Material.iron);
|
||||
@@ -684,44 +684,44 @@ public class ModelLoaderRegistryDebug
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName(MODID + ":" + name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public boolean canConnectTo(IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
return block instanceof OBJCustomDataBlock;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return state.withProperty(NORTH, this.canConnectTo(world, pos.north())).withProperty(SOUTH, this.canConnectTo(world, pos.south())).withProperty(WEST, this.canConnectTo(world, pos.west())).withProperty(EAST, this.canConnectTo(world, pos.east()));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState()
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockState(this, new IProperty[]{NORTH, SOUTH, WEST, EAST});
|
||||
return new BlockStateContainer(this, new IProperty[]{NORTH, SOUTH, WEST, EAST});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This block uses the same model as CustomModelBlock4, but instead of facing the
|
||||
* player when placed, this one ALWAYS faces the player. I know, creepy right?
|
||||
@@ -739,31 +739,31 @@ public class ModelLoaderRegistryDebug
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName(MODID + ":" + name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
return new OBJDynamicEyeTileEntity();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
@@ -777,23 +777,23 @@ public class ModelLoaderRegistryDebug
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState()
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {OBJModel.OBJProperty.instance});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class OBJDynamicEyeTileEntity extends TileEntity implements ITickable
|
||||
{
|
||||
public OBJModel.OBJState state;
|
||||
|
||||
|
||||
public OBJDynamicEyeTileEntity()
|
||||
{
|
||||
this.state = new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void update()
|
||||
{
|
||||
|
||||
@@ -2,10 +2,10 @@ package net.minecraftforge.debug;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
@@ -42,9 +42,9 @@ public class MultiLayerModelDebug
|
||||
public boolean isFullCube() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(EnumWorldBlockLayer layer)
|
||||
public boolean canRenderInLayer(BlockRenderLayer layer)
|
||||
{
|
||||
return layer == EnumWorldBlockLayer.SOLID || layer == EnumWorldBlockLayer.TRANSLUCENT;
|
||||
return layer == BlockRenderLayer.SOLID || layer == BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
}, blockName);
|
||||
}
|
||||
|
||||
@@ -69,13 +69,13 @@ public class PotionRegistryDebug {
|
||||
int height = width;
|
||||
/*
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
worldrenderer.startDrawingQuads();
|
||||
worldrenderer.setColorOpaque_I(potion.getLiquidColor());
|
||||
worldrenderer.addVertexWithUV((double) x, (double) (y + height), 0.0D, sprite.getMinU(), sprite.getMaxV());
|
||||
worldrenderer.addVertexWithUV((double)(x + width), (double)(y + height), 0.0D, sprite.getMaxU(), sprite.getMaxV());
|
||||
worldrenderer.addVertexWithUV((double)(x + width), (double)y, 0.0D, sprite.getMaxU(), sprite.getMinV());
|
||||
worldrenderer.addVertexWithUV((double)x, (double)y, 0.0D, sprite.getMinU(), sprite.getMinV());
|
||||
VertexBuffer VertexBuffer = tessellator.getVertexBuffer();
|
||||
VertexBuffer.startDrawingQuads();
|
||||
VertexBuffer.setColorOpaque_I(potion.getLiquidColor());
|
||||
VertexBuffer.addVertexWithUV((double) x, (double) (y + height), 0.0D, sprite.getMinU(), sprite.getMaxV());
|
||||
VertexBuffer.addVertexWithUV((double)(x + width), (double)(y + height), 0.0D, sprite.getMaxU(), sprite.getMaxV());
|
||||
VertexBuffer.addVertexWithUV((double)(x + width), (double)y, 0.0D, sprite.getMaxU(), sprite.getMinV());
|
||||
VertexBuffer.addVertexWithUV((double)x, (double)y, 0.0D, sprite.getMinU(), sprite.getMinV());
|
||||
tessellator.draw();*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,9 @@ import java.util.List;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraftforge.client.ClientCommandHandler;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
@@ -53,15 +54,15 @@ public class ClientCommandTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender sender, String[] args) throws CommandException
|
||||
public void func_184881_a( MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
|
||||
{
|
||||
if (args.length > 0)
|
||||
{
|
||||
sender.addChatMessage(new ChatComponentText("Input: " + Arrays.toString(args)));
|
||||
sender.addChatMessage(new TextComponentString("Input: " + Arrays.toString(args)));
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.addChatMessage(new ChatComponentText("No arguments."));
|
||||
sender.addChatMessage(new TextComponentString("No arguments."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -45,8 +45,8 @@ public class TestCapabilityMod
|
||||
public void onInteract(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
|
||||
if (event.entityPlayer.getHeldItem() == null) return;
|
||||
if (event.entityPlayer.getHeldItem().getItem() != Items.stick) return;
|
||||
if (event.entityPlayer.inventory.getCurrentItem() == null) return;
|
||||
if (event.entityPlayer.inventory.getCurrentItem().getItem() != Items.stick) return;
|
||||
|
||||
// This is just a example of how to interact with the TE, note the strong type binding that getCapability has
|
||||
TileEntity te = event.world.getTileEntity(event.pos);
|
||||
@@ -58,7 +58,7 @@ public class TestCapabilityMod
|
||||
}
|
||||
if (event.world.getBlockState(event.pos).getBlock() == Blocks.dirt)
|
||||
{
|
||||
event.entityPlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.ITALIC + "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST"));
|
||||
event.entityPlayer.addChatMessage(new TextComponentString(TextFormatting.RED + "" + TextFormatting.ITALIC + "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST"));
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.minecraftforge.test;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.client.renderer.entity.RenderLivingBase;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityArmorStand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -66,7 +66,7 @@ public class WRNormalMod
|
||||
}
|
||||
}
|
||||
|
||||
public static class RenderScaleTest extends RendererLivingEntity<EntityScaleTest>
|
||||
public static class RenderScaleTest extends RenderLivingBase<EntityScaleTest>
|
||||
{
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("textures/blocks/stone.png");
|
||||
|
||||
|
||||
Reference in new issue
Block a user