Some import renames and compile error fixes, killed ~800.
This commit is contained in:
parent
1f80eb17df
commit
ac7c4d2f6c
|
@ -8,6 +8,6 @@
|
||||||
+ public boolean isReplaceable(World world, BlockPos pos)
|
+ public boolean isReplaceable(World world, BlockPos pos)
|
||||||
+ {
|
+ {
|
||||||
+ net.minecraft.block.state.IBlockState state = world.getBlockState(pos);
|
+ net.minecraft.block.state.IBlockState state = world.getBlockState(pos);
|
||||||
+ return state.getBlock().isAir(world, pos) || state.getBlock().isLeaves(world, pos) || state.getBlock().isWood(world, pos) || func_150523_a(state.getBlock());
|
+ return state.getBlock().isAir(state, world, pos) || state.getBlock().isLeaves(state, world, pos) || state.getBlock().isWood(world, pos) || func_150523_a(state.getBlock());
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
- Block block = this.world.getBlockState(this.basePos.down()).getBlock();
|
- Block block = this.world.getBlockState(this.basePos.down()).getBlock();
|
||||||
+ BlockPos down = this.basePos.down();
|
+ BlockPos down = this.basePos.down();
|
||||||
+ net.minecraft.block.state.IBlockState state = this.world.getBlockState(down);
|
+ net.minecraft.block.state.IBlockState state = this.world.getBlockState(down);
|
||||||
+ boolean isSoil = state.getBlock().canSustainPlant(this.world, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
+ boolean isSoil = state.getBlock().canSustainPlant(state, this.world, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
||||||
|
|
||||||
- if (block != Blocks.dirt && block != Blocks.grass && block != Blocks.farmland)
|
- if (block != Blocks.dirt && block != Blocks.grass && block != Blocks.farmland)
|
||||||
+ if (!isSoil)
|
+ if (!isSoil)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
BlockPos blockpos = position.down();
|
BlockPos blockpos = position.down();
|
||||||
- Block block = worldIn.getBlockState(blockpos).getBlock();
|
- Block block = worldIn.getBlockState(blockpos).getBlock();
|
||||||
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos);
|
+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos);
|
||||||
+ boolean isSoil = state.getBlock().canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
+ boolean isSoil = state.getBlock().canSustainPlant(state, worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
||||||
|
|
||||||
- if (block != Blocks.grass && block != Blocks.dirt)
|
- if (block != Blocks.grass && block != Blocks.dirt)
|
||||||
+ if (!(isSoil && position.getY() < 256 - i - 1))
|
+ if (!(isSoil && position.getY() < 256 - i - 1))
|
||||||
|
|
|
@ -9,11 +9,13 @@
|
||||||
{
|
{
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
@@ -79,13 +79,14 @@
|
@@ -78,14 +78,15 @@
|
||||||
|
private boolean func_175927_a(BlockPos p_175927_1_, World worldIn)
|
||||||
{
|
{
|
||||||
BlockPos blockpos = p_175927_1_.down();
|
BlockPos blockpos = p_175927_1_.down();
|
||||||
Block block = worldIn.getBlockState(blockpos).getBlock();
|
- Block block = worldIn.getBlockState(blockpos).getBlock();
|
||||||
+ boolean isSoil = block.canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
+ IBlockState state = worldIn.getBlockState(blockpos);
|
||||||
|
+ boolean isSoil = state.getBlock().canSustainPlant(state, worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
||||||
|
|
||||||
- if ((block == Blocks.grass || block == Blocks.dirt) && p_175927_1_.getY() >= 2)
|
- if ((block == Blocks.grass || block == Blocks.dirt) && p_175927_1_.getY() >= 2)
|
||||||
+ if (isSoil && p_175927_1_.getY() >= 2)
|
+ if (isSoil && p_175927_1_.getY() >= 2)
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
+ //Helper macro
|
+ //Helper macro
|
||||||
+ private boolean isAirLeaves(World world, BlockPos pos)
|
+ private boolean isAirLeaves(World world, BlockPos pos)
|
||||||
+ {
|
+ {
|
||||||
+ net.minecraft.block.Block block = world.getBlockState(pos).getBlock();
|
+ IBlockState state = world.getBlockState(pos);
|
||||||
+ return block.isAir(world, pos) || block.isLeaves(world, pos);
|
+ return state.getBlock().isAir(state, world, pos) || state.getBlock().isLeaves(state, world, pos);
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,14 +15,14 @@
|
||||||
{
|
{
|
||||||
- Block block = worldIn.getBlockState(position.down()).getBlock();
|
- Block block = worldIn.getBlockState(position.down()).getBlock();
|
||||||
+ BlockPos down = position.down();
|
+ BlockPos down = position.down();
|
||||||
+ Block block = worldIn.getBlockState(down).getBlock();
|
+ IBlockState state = worldIn.getBlockState(down);
|
||||||
+ boolean isSoil = block.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
+ boolean isSoil = state.getBlock().canSustainPlant(state, worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
||||||
|
|
||||||
- if ((block == Blocks.grass || block == Blocks.dirt) && position.getY() < 256 - i - 1)
|
- if ((block == Blocks.grass || block == Blocks.dirt) && position.getY() < 256 - i - 1)
|
||||||
+ if (isSoil && position.getY() < 256 - i - 1)
|
+ if (isSoil && position.getY() < 256 - i - 1)
|
||||||
{
|
{
|
||||||
- this.func_175921_a(worldIn, position.down());
|
- this.func_175921_a(worldIn, position.down());
|
||||||
+ block.onPlantGrow(worldIn, down, position);
|
+ state.getBlock().onPlantGrow(worldIn, down, position);
|
||||||
EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(rand);
|
EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(rand);
|
||||||
int k2 = i - rand.nextInt(4) - 1;
|
int k2 = i - rand.nextInt(4) - 1;
|
||||||
int l2 = 3 - rand.nextInt(3);
|
int l2 = 3 - rand.nextInt(3);
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
{
|
{
|
||||||
- Block block1 = worldIn.getBlockState(position.down()).getBlock();
|
- Block block1 = worldIn.getBlockState(position.down()).getBlock();
|
||||||
+ BlockPos down = position.down();
|
+ BlockPos down = position.down();
|
||||||
+ Block block1 = worldIn.getBlockState(down).getBlock();
|
+ IBlockState state = worldIn.getBlockState(down);
|
||||||
+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
+ boolean isSoil = state.getBlock().canSustainPlant(state, worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling));
|
||||||
|
|
||||||
- if ((block1 == Blocks.grass || block1 == Blocks.dirt) && position.getY() < 256 - i - 1)
|
- if ((block1 == Blocks.grass || block1 == Blocks.dirt) && position.getY() < 256 - i - 1)
|
||||||
+ if (isSoil && position.getY() < 256 - i - 1)
|
+ if (isSoil && position.getY() < 256 - i - 1)
|
||||||
{
|
{
|
||||||
- this.func_175921_a(worldIn, position.down());
|
- this.func_175921_a(worldIn, position.down());
|
||||||
+ block1.onPlantGrow(worldIn, position.down(),position);
|
+ state.getBlock().onPlantGrow(worldIn, position.down(),position);
|
||||||
|
|
||||||
for (int k1 = position.getY() - 3 + i; k1 <= position.getY() + i; ++k1)
|
for (int k1 = position.getY() - 3 + i; k1 <= position.getY() + i; ++k1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,14 +15,14 @@
|
||||||
{
|
{
|
||||||
- Block block = worldIn.getBlockState(position.down()).getBlock();
|
- Block block = worldIn.getBlockState(position.down()).getBlock();
|
||||||
+ BlockPos down = position.down();
|
+ BlockPos down = position.down();
|
||||||
+ Block block = worldIn.getBlockState(down).getBlock();
|
+ IBlockState state = worldIn.getBlockState(down);
|
||||||
+ boolean isSoil = block.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling);
|
+ boolean isSoil = state.getBlock().canSustainPlant(state, worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling);
|
||||||
|
|
||||||
- if ((block == Blocks.grass || block == Blocks.dirt) && position.getY() < 256 - i - 1)
|
- if ((block == Blocks.grass || block == Blocks.dirt) && position.getY() < 256 - i - 1)
|
||||||
+ if (isSoil && position.getY() < 256 - i - 1)
|
+ if (isSoil && position.getY() < 256 - i - 1)
|
||||||
{
|
{
|
||||||
- this.func_175921_a(worldIn, position.down());
|
- this.func_175921_a(worldIn, position.down());
|
||||||
+ block.onPlantGrow(worldIn, down, position);
|
+ state.getBlock().onPlantGrow(worldIn, down, position);
|
||||||
int k2 = 0;
|
int k2 = 0;
|
||||||
|
|
||||||
for (int l2 = position.getY() + i; l2 >= position.getY() + j; --l2)
|
for (int l2 = position.getY() + i; l2 >= position.getY() + j; --l2)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
+ static
|
+ static
|
||||||
+ {
|
+ {
|
||||||
+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR, CHEST_CONTENT_WEIGHT_LIST, 8, 8);
|
+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR, CHEST_CONTENT_WEIGHT_LIST, 8, 8);
|
||||||
+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.enchanted_book, 1, 0), 1, 1, 1));
|
+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(net.minecraft.init.Items.enchanted_book, 1, 0), 1, 1, 1));
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
private static StructureComponent func_175892_a(List<StructureComponent> listIn, Random rand, int x, int y, int z, EnumFacing facing, int type)
|
private static StructureComponent func_175892_a(List<StructureComponent> listIn, Random rand, int x, int y, int z, EnumFacing facing, int type)
|
||||||
|
|
|
@ -9,12 +9,13 @@ import net.minecraft.command.CommandHandler;
|
||||||
import net.minecraft.command.ICommand;
|
import net.minecraft.command.ICommand;
|
||||||
import net.minecraft.command.ICommandSender;
|
import net.minecraft.command.ICommandSender;
|
||||||
import net.minecraft.command.WrongUsageException;
|
import net.minecraft.command.WrongUsageException;
|
||||||
import net.minecraft.util.ChatComponentTranslation;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.CommandEvent;
|
import net.minecraftforge.event.CommandEvent;
|
||||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
import static net.minecraft.util.EnumChatFormatting.*;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import static net.minecraft.util.text.TextFormatting.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class that handles client-side chat commands. You should register any
|
* The class that handles client-side chat commands. You should register any
|
||||||
|
@ -57,7 +58,7 @@ public class ClientCommandHandler extends CommandHandler
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (icommand.canCommandSenderUseCommand(sender))
|
if (icommand.func_184882_a(this.func_184879_a(), sender))
|
||||||
{
|
{
|
||||||
CommandEvent event = new CommandEvent(icommand, sender, args);
|
CommandEvent event = new CommandEvent(icommand, sender, args);
|
||||||
if (MinecraftForge.EVENT_BUS.post(event))
|
if (MinecraftForge.EVENT_BUS.post(event))
|
||||||
|
@ -69,7 +70,7 @@ public class ClientCommandHandler extends CommandHandler
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
icommand.processCommand(sender, args);
|
this.tryExecute(sender, args, icommand, message);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -95,9 +96,9 @@ public class ClientCommandHandler extends CommandHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
//Couple of helpers because the mcp names are stupid and long...
|
//Couple of helpers because the mcp names are stupid and long...
|
||||||
private ChatComponentTranslation format(EnumChatFormatting color, String str, Object... args)
|
private TextComponentTranslation format(TextFormatting color, String str, Object... args)
|
||||||
{
|
{
|
||||||
ChatComponentTranslation ret = new ChatComponentTranslation(str, args);
|
TextComponentTranslation ret = new TextComponentTranslation(str, args);
|
||||||
ret.getChatStyle().setColor(color);
|
ret.getChatStyle().setColor(color);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -136,4 +137,9 @@ public class ClientCommandHandler extends CommandHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MinecraftServer func_184879_a() {
|
||||||
|
return Minecraft.getMinecraft().getIntegratedServer();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -17,7 +17,6 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.audio.ISound;
|
import net.minecraft.client.audio.ISound;
|
||||||
import net.minecraft.client.audio.SoundEventAccessorComposite;
|
|
||||||
import net.minecraft.client.audio.SoundManager;
|
import net.minecraft.client.audio.SoundManager;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.GuiMainMenu;
|
import net.minecraft.client.gui.GuiMainMenu;
|
||||||
|
@ -27,10 +26,14 @@ import net.minecraft.client.renderer.EntityRenderer;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
import net.minecraft.client.renderer.RenderGlobal;
|
import net.minecraft.client.renderer.RenderGlobal;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
|
||||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||||
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||||
import net.minecraft.client.renderer.block.model.ItemTransformVec3f;
|
import net.minecraft.client.renderer.block.model.ItemTransformVec3f;
|
||||||
|
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||||
|
import net.minecraft.client.renderer.block.model.ModelManager;
|
||||||
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
|
import net.minecraft.client.renderer.block.model.ModelRotation;
|
||||||
import net.minecraft.client.renderer.texture.TextureManager;
|
import net.minecraft.client.renderer.texture.TextureManager;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||||
|
@ -39,11 +42,6 @@ import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage;
|
import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
|
||||||
import net.minecraft.client.resources.model.ModelBakery;
|
|
||||||
import net.minecraft.client.resources.model.ModelManager;
|
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
|
||||||
import net.minecraft.client.resources.model.ModelRotation;
|
|
||||||
import net.minecraft.client.settings.GameSettings;
|
import net.minecraft.client.settings.GameSettings;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -52,6 +50,10 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.*;
|
import net.minecraft.util.*;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
|
import net.minecraft.util.registry.IRegistry;
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
@ -113,7 +115,7 @@ public class ForgeHooksClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean onDrawBlockHighlight(RenderGlobal context, EntityPlayer player, MovingObjectPosition target, int subID, ItemStack currentItem, float partialTicks)
|
public static boolean onDrawBlockHighlight(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, ItemStack currentItem, float partialTicks)
|
||||||
{
|
{
|
||||||
return MinecraftForge.EVENT_BUS.post(new DrawBlockHighlightEvent(context, player, target, subID, currentItem, partialTicks));
|
return MinecraftForge.EVENT_BUS.post(new DrawBlockHighlightEvent(context, player, target, subID, currentItem, partialTicks));
|
||||||
}
|
}
|
||||||
|
@ -145,15 +147,15 @@ public class ForgeHooksClient
|
||||||
renderPass = pass;
|
renderPass = pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final ThreadLocal<EnumWorldBlockLayer> renderLayer = new ThreadLocal<EnumWorldBlockLayer>()
|
static final ThreadLocal<BlockRenderLayer> renderLayer = new ThreadLocal<BlockRenderLayer>()
|
||||||
{
|
{
|
||||||
protected EnumWorldBlockLayer initialValue()
|
protected BlockRenderLayer initialValue()
|
||||||
{
|
{
|
||||||
return EnumWorldBlockLayer.SOLID;
|
return BlockRenderLayer.SOLID;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void setRenderLayer(EnumWorldBlockLayer layer)
|
public static void setRenderLayer(BlockRenderLayer layer)
|
||||||
{
|
{
|
||||||
renderLayer.set(layer);
|
renderLayer.set(layer);
|
||||||
}
|
}
|
||||||
|
@ -196,7 +198,7 @@ public class ForgeHooksClient
|
||||||
MinecraftForge.EVENT_BUS.post(fovUpdateEvent);
|
MinecraftForge.EVENT_BUS.post(fovUpdateEvent);
|
||||||
return fovUpdateEvent.newfov;
|
return fovUpdateEvent.newfov;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getFOVModifier(EntityRenderer renderer, Entity entity, Block block, double renderPartialTicks, float fov) {
|
public static float getFOVModifier(EntityRenderer renderer, Entity entity, Block block, double renderPartialTicks, float fov) {
|
||||||
EntityViewRenderEvent.FOVModifier event = new EntityViewRenderEvent.FOVModifier(renderer, entity, block, renderPartialTicks, fov);
|
EntityViewRenderEvent.FOVModifier event = new EntityViewRenderEvent.FOVModifier(renderer, entity, block, renderPartialTicks, fov);
|
||||||
MinecraftForge.EVENT_BUS.post(event);
|
MinecraftForge.EVENT_BUS.post(event);
|
||||||
|
@ -265,7 +267,7 @@ public class ForgeHooksClient
|
||||||
if (status == BETA || status == BETA_OUTDATED)
|
if (status == BETA || status == BETA_OUTDATED)
|
||||||
{
|
{
|
||||||
// render a warning at the top of the screen,
|
// render a warning at the top of the screen,
|
||||||
String line = I18n.format("forge.update.beta.1", EnumChatFormatting.RED, EnumChatFormatting.RESET);
|
String line = I18n.format("forge.update.beta.1", TextFormatting.RED, TextFormatting.RESET);
|
||||||
gui.drawString(font, line, (width - font.getStringWidth(line)) / 2, 4 + (0 * (font.FONT_HEIGHT + 1)), -1);
|
gui.drawString(font, line, (width - font.getStringWidth(line)) / 2, 4 + (0 * (font.FONT_HEIGHT + 1)), -1);
|
||||||
line = I18n.format("forge.update.beta.2");
|
line = I18n.format("forge.update.beta.2");
|
||||||
gui.drawString(font, line, (width - font.getStringWidth(line)) / 2, 4 + (1 * (font.FONT_HEIGHT + 1)), -1);
|
gui.drawString(font, line, (width - font.getStringWidth(line)) / 2, 4 + (1 * (font.FONT_HEIGHT + 1)), -1);
|
||||||
|
@ -297,7 +299,7 @@ public class ForgeHooksClient
|
||||||
return e.result;
|
return e.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//static RenderBlocks worldRendererRB;
|
//static RenderBlocks VertexBufferRB;
|
||||||
static int worldRenderPass;
|
static int worldRenderPass;
|
||||||
|
|
||||||
public static int getWorldRenderPass()
|
public static int getWorldRenderPass()
|
||||||
|
@ -325,25 +327,25 @@ public class ForgeHooksClient
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
public static void setWorldRendererRB(RenderBlocks renderBlocks)
|
public static void setVertexBufferRB(RenderBlocks renderBlocks)
|
||||||
{
|
{
|
||||||
worldRendererRB = renderBlocks;
|
VertexBufferRB = renderBlocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onPreRenderWorld(WorldRenderer worldRenderer, int pass)
|
public static void onPreRenderWorld(VertexBuffer VertexBuffer, int pass)
|
||||||
{
|
{
|
||||||
if(worldRendererRB != null)
|
if(VertexBufferRB != null)
|
||||||
{
|
{
|
||||||
worldRenderPass = pass;
|
worldRenderPass = pass;
|
||||||
MinecraftForge.EVENT_BUS.post(new RenderWorldEvent.Pre(worldRenderer, (ChunkCache)worldRendererRB.blockAccess, worldRendererRB, pass));
|
MinecraftForge.EVENT_BUS.post(new RenderWorldEvent.Pre(VertexBuffer, (ChunkCache)VertexBufferRB.blockAccess, VertexBufferRB, pass));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onPostRenderWorld(WorldRenderer worldRenderer, int pass)
|
public static void onPostRenderWorld(VertexBuffer VertexBuffer, int pass)
|
||||||
{
|
{
|
||||||
if(worldRendererRB != null)
|
if(VertexBufferRB != null)
|
||||||
{
|
{
|
||||||
MinecraftForge.EVENT_BUS.post(new RenderWorldEvent.Post(worldRenderer, (ChunkCache)worldRendererRB.blockAccess, worldRendererRB, pass));
|
MinecraftForge.EVENT_BUS.post(new RenderWorldEvent.Post(VertexBuffer, (ChunkCache)VertexBufferRB.blockAccess, VertexBufferRB, pass));
|
||||||
worldRenderPass = -1;
|
worldRenderPass = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -501,7 +503,7 @@ public class ForgeHooksClient
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void putQuadColor(WorldRenderer renderer, BakedQuad quad, int color)
|
public static void putQuadColor(VertexBuffer renderer, BakedQuad quad, int color)
|
||||||
{
|
{
|
||||||
float cr = color & 0xFF;
|
float cr = color & 0xFF;
|
||||||
float cg = (color >>> 8) & 0xFF;
|
float cg = (color >>> 8) & 0xFF;
|
||||||
|
|
|
@ -29,11 +29,11 @@ import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.scoreboard.ScoreObjective;
|
import net.minecraft.scoreboard.ScoreObjective;
|
||||||
import net.minecraft.scoreboard.ScorePlayerTeam;
|
import net.minecraft.scoreboard.ScorePlayerTeam;
|
||||||
import net.minecraft.scoreboard.Scoreboard;
|
import net.minecraft.scoreboard.Scoreboard;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
|
||||||
import net.minecraft.util.FoodStats;
|
import net.minecraft.util.FoodStats;
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.StringUtils;
|
import net.minecraft.util.StringUtils;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
|
@ -596,7 +596,7 @@ public class GuiIngameForge extends GuiIngame
|
||||||
{
|
{
|
||||||
String name = this.highlightingItemStack.getDisplayName();
|
String name = this.highlightingItemStack.getDisplayName();
|
||||||
if (this.highlightingItemStack.hasDisplayName())
|
if (this.highlightingItemStack.hasDisplayName())
|
||||||
name = EnumChatFormatting.ITALIC + name;
|
name = TextFormatting.ITALIC + name;
|
||||||
|
|
||||||
name = this.highlightingItemStack.getItem().getHighlightTip(this.highlightingItemStack, name);
|
name = this.highlightingItemStack.getItem().getHighlightTip(this.highlightingItemStack, name);
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ import com.google.common.collect.Maps;
|
||||||
import gnu.trove.map.hash.TIntObjectHashMap;
|
import gnu.trove.map.hash.TIntObjectHashMap;
|
||||||
import gnu.trove.procedure.TIntObjectProcedure;
|
import gnu.trove.procedure.TIntObjectProcedure;
|
||||||
import net.minecraft.client.renderer.ItemModelMesher;
|
import net.minecraft.client.renderer.ItemModelMesher;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.resources.model.ModelManager;
|
import net.minecraft.client.renderer.block.model.ModelManager;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,8 +9,8 @@ import java.util.BitSet;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.RegionRenderCache;
|
import net.minecraft.client.renderer.RegionRenderCache;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraft.util.EnumWorldBlockLayer;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
@ -26,7 +26,7 @@ public class MinecraftForgeClient
|
||||||
return ForgeHooksClient.renderPass;
|
return ForgeHooksClient.renderPass;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EnumWorldBlockLayer getRenderLayer()
|
public static BlockRenderLayer getRenderLayer()
|
||||||
{
|
{
|
||||||
return ForgeHooksClient.renderLayer.get();
|
return ForgeHooksClient.renderLayer.get();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
|
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public class ClientChatReceivedEvent extends Event
|
public class ClientChatReceivedEvent extends Event
|
||||||
{
|
{
|
||||||
public IChatComponent message;
|
public ITextComponent message;
|
||||||
/**
|
/**
|
||||||
* Introduced in 1.8:
|
* Introduced in 1.8:
|
||||||
* 0 : Standard Text Message
|
* 0 : Standard Text Message
|
||||||
|
@ -15,7 +15,7 @@ public class ClientChatReceivedEvent extends Event
|
||||||
* 2 : 'Status' message, displayed above action bar, where song notifications are.
|
* 2 : 'Status' message, displayed above action bar, where song notifications are.
|
||||||
*/
|
*/
|
||||||
public final byte type;
|
public final byte type;
|
||||||
public ClientChatReceivedEvent(byte type, IChatComponent message)
|
public ClientChatReceivedEvent(byte type, ITextComponent message)
|
||||||
{
|
{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.client.renderer.RenderGlobal;
|
import net.minecraft.client.renderer.RenderGlobal;
|
||||||
|
|
||||||
@Cancelable
|
@Cancelable
|
||||||
|
@ -12,12 +12,12 @@ public class DrawBlockHighlightEvent extends Event
|
||||||
{
|
{
|
||||||
public final RenderGlobal context;
|
public final RenderGlobal context;
|
||||||
public final EntityPlayer player;
|
public final EntityPlayer player;
|
||||||
public final MovingObjectPosition target;
|
public final RayTraceResult target;
|
||||||
public final int subID;
|
public final int subID;
|
||||||
public final ItemStack currentItem;
|
public final ItemStack currentItem;
|
||||||
public final float partialTicks;
|
public final float partialTicks;
|
||||||
|
|
||||||
public DrawBlockHighlightEvent(RenderGlobal context, EntityPlayer player, MovingObjectPosition target, int subID, ItemStack currentItem, float partialTicks)
|
public DrawBlockHighlightEvent(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, ItemStack currentItem, float partialTicks)
|
||||||
{
|
{
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.resources.model.ModelBakery;
|
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||||
import net.minecraft.client.resources.model.ModelManager;
|
import net.minecraft.client.renderer.block.model.ModelManager;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.util.IRegistry;
|
import net.minecraft.util.registry.IRegistry;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package net.minecraftforge.client.event;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
|
|
||||||
|
|
|
@ -2,18 +2,18 @@ package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
import net.minecraft.client.renderer.entity.RenderLivingBase;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
public abstract class RenderLivingEvent<T extends EntityLivingBase> extends Event
|
public abstract class RenderLivingEvent<T extends EntityLivingBase> extends Event
|
||||||
{
|
{
|
||||||
public final EntityLivingBase entity;
|
public final EntityLivingBase entity;
|
||||||
public final RendererLivingEntity<T> renderer;
|
public final RenderLivingBase<T> renderer;
|
||||||
public final double x;
|
public final double x;
|
||||||
public final double y;
|
public final double y;
|
||||||
public final double z;
|
public final double z;
|
||||||
|
|
||||||
public RenderLivingEvent(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z)
|
public RenderLivingEvent(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z)
|
||||||
{
|
{
|
||||||
this.entity = entity;
|
this.entity = entity;
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
|
@ -25,25 +25,25 @@ public abstract class RenderLivingEvent<T extends EntityLivingBase> extends Even
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public static class Pre<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
public static class Pre<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
||||||
{
|
{
|
||||||
public Pre(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
public Pre(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||||
}
|
}
|
||||||
public static class Post<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
public static class Post<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
||||||
{
|
{
|
||||||
public Post(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
public Post(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract static class Specials<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
public abstract static class Specials<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
||||||
{
|
{
|
||||||
public Specials(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
public Specials(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||||
|
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public static class Pre<T extends EntityLivingBase> extends Specials<T>
|
public static class Pre<T extends EntityLivingBase> extends Specials<T>
|
||||||
{
|
{
|
||||||
public Pre(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
public Pre(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||||
}
|
}
|
||||||
public static class Post<T extends EntityLivingBase> extends Specials<T>
|
public static class Post<T extends EntityLivingBase> extends Specials<T>
|
||||||
{
|
{
|
||||||
public Post(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
public Post(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,17 @@ package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
//import net.minecraft.client.renderer.RenderBlocks;
|
//import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.world.ChunkCache;
|
import net.minecraft.world.ChunkCache;
|
||||||
|
|
||||||
public abstract class RenderWorldEvent extends Event
|
public abstract class RenderWorldEvent extends Event
|
||||||
{
|
{
|
||||||
public final WorldRenderer renderer;
|
public final VertexBuffer renderer;
|
||||||
public final ChunkCache chunkCache;
|
public final ChunkCache chunkCache;
|
||||||
//public final RenderBlocks renderBlocks;
|
//public final RenderBlocks renderBlocks;
|
||||||
public final int pass;
|
public final int pass;
|
||||||
|
|
||||||
public RenderWorldEvent(WorldRenderer renderer, ChunkCache chunkCache, /*RenderBlocks renderBlocks,*/ int pass)
|
public RenderWorldEvent(VertexBuffer renderer, ChunkCache chunkCache, /*RenderBlocks renderBlocks,*/ int pass)
|
||||||
{
|
{
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
this.chunkCache = chunkCache;
|
this.chunkCache = chunkCache;
|
||||||
|
@ -26,7 +26,7 @@ public abstract class RenderWorldEvent extends Event
|
||||||
*/
|
*/
|
||||||
public static class Pre extends RenderWorldEvent
|
public static class Pre extends RenderWorldEvent
|
||||||
{
|
{
|
||||||
public Pre(WorldRenderer renderer, ChunkCache chunkCache, /*RenderBlocks renderBlocks,*/ int pass){ super(renderer, chunkCache, /*renderBlocks,*/ pass); }
|
public Pre(VertexBuffer renderer, ChunkCache chunkCache, /*RenderBlocks renderBlocks,*/ int pass){ super(renderer, chunkCache, /*renderBlocks,*/ pass); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,6 +34,6 @@ public abstract class RenderWorldEvent extends Event
|
||||||
*/
|
*/
|
||||||
public static class Post extends RenderWorldEvent
|
public static class Post extends RenderWorldEvent
|
||||||
{
|
{
|
||||||
public Post(WorldRenderer renderer, ChunkCache chunkCache, /*RenderBlocks renderBlocks,*/ int pass){ super(renderer, chunkCache, /*renderBlocks,*/ pass); }
|
public Post(VertexBuffer renderer, ChunkCache chunkCache, /*RenderBlocks renderBlocks,*/ int pass){ super(renderer, chunkCache, /*renderBlocks,*/ pass); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.block.model.ModelBlockDefinition;
|
import net.minecraft.client.renderer.block.model.ModelBlockDefinition;
|
||||||
import net.minecraft.client.resources.model.ModelRotation;
|
import net.minecraft.client.renderer.block.model.ModelRotation;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.fml.common.FMLLog;
|
import net.minecraftforge.fml.common.FMLLog;
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import javax.vecmath.Quat4f;
|
||||||
import javax.vecmath.Vector3f;
|
import javax.vecmath.Vector3f;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
||||||
import net.minecraft.client.resources.model.ModelRotation;
|
import net.minecraft.client.renderer.block.model.ModelRotation;
|
||||||
import net.minecraft.util.JsonUtils;
|
import net.minecraft.util.JsonUtils;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.model.BlockStateLoader.Marker;
|
import net.minecraftforge.client.model.BlockStateLoader.Marker;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package net.minecraftforge.client.model;
|
package net.minecraftforge.client.model;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
|
|
||||||
public interface ISmartItemModel extends IBakedModel
|
public interface ISmartItemModel extends IBakedModel
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,8 +13,8 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformT
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.resources.IResourceManager;
|
import net.minecraft.client.resources.IResourceManager;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
|
@ -15,8 +15,8 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformT
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.resources.IResourceManager;
|
import net.minecraft.client.resources.IResourceManager;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.resources.model.ModelRotation;
|
import net.minecraft.client.renderer.block.model.ModelRotation;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
|
@ -41,13 +41,13 @@ import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.resources.IResourceManager;
|
import net.minecraft.client.resources.IResourceManager;
|
||||||
import net.minecraft.client.resources.model.BuiltInModel;
|
import net.minecraft.client.renderer.block.model.BuiltInModel;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.resources.model.ModelBakery;
|
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.client.resources.model.ModelRotation;
|
import net.minecraft.client.renderer.block.model.ModelRotation;
|
||||||
import net.minecraft.client.resources.model.SimpleBakedModel;
|
import net.minecraft.client.renderer.block.model.SimpleBakedModel;
|
||||||
import net.minecraft.client.resources.model.WeightedBakedModel;
|
import net.minecraft.client.renderer.block.model.WeightedBakedModel;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||||
import net.minecraft.client.resources.IResourceManager;
|
import net.minecraft.client.resources.IResourceManager;
|
||||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.model.ModelLoader.VanillaLoader;
|
import net.minecraftforge.client.model.ModelLoader.VanillaLoader;
|
||||||
import net.minecraftforge.client.model.b3d.B3DLoader;
|
import net.minecraftforge.client.model.b3d.B3DLoader;
|
||||||
|
|
|
@ -14,10 +14,10 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformT
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.resources.IResourceManager;
|
import net.minecraft.client.resources.IResourceManager;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumWorldBlockLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
import net.minecraftforge.client.MinecraftForgeClient;
|
||||||
import net.minecraftforge.fml.common.FMLLog;
|
import net.minecraftforge.fml.common.FMLLog;
|
||||||
|
@ -34,11 +34,11 @@ import com.google.gson.JsonParser;
|
||||||
|
|
||||||
public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
||||||
{
|
{
|
||||||
public static final MultiLayerModel instance = new MultiLayerModel(ImmutableMap.<Optional<EnumWorldBlockLayer>, ModelResourceLocation>of());
|
public static final MultiLayerModel instance = new MultiLayerModel(ImmutableMap.<Optional<BlockRenderLayer>, ModelResourceLocation>of());
|
||||||
|
|
||||||
private final ImmutableMap<Optional<EnumWorldBlockLayer>, ModelResourceLocation> models;
|
private final ImmutableMap<Optional<BlockRenderLayer>, ModelResourceLocation> models;
|
||||||
|
|
||||||
public MultiLayerModel(ImmutableMap<Optional<EnumWorldBlockLayer>, ModelResourceLocation> models)
|
public MultiLayerModel(ImmutableMap<Optional<BlockRenderLayer>, ModelResourceLocation> models)
|
||||||
{
|
{
|
||||||
this.models = models;
|
this.models = models;
|
||||||
}
|
}
|
||||||
|
@ -55,10 +55,10 @@ public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
||||||
return ImmutableList.of();
|
return ImmutableList.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ImmutableMap<Optional<EnumWorldBlockLayer>, IFlexibleBakedModel> buildModels(ImmutableMap<Optional<EnumWorldBlockLayer>, ModelResourceLocation> models, IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
|
private static ImmutableMap<Optional<BlockRenderLayer>, IFlexibleBakedModel> buildModels(ImmutableMap<Optional<BlockRenderLayer>, ModelResourceLocation> models, IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
|
||||||
{
|
{
|
||||||
ImmutableMap.Builder<Optional<EnumWorldBlockLayer>, IFlexibleBakedModel> builder = ImmutableMap.builder();
|
ImmutableMap.Builder<Optional<BlockRenderLayer>, IFlexibleBakedModel> builder = ImmutableMap.builder();
|
||||||
for(Optional<EnumWorldBlockLayer> key : models.keySet())
|
for(Optional<BlockRenderLayer> key : models.keySet())
|
||||||
{
|
{
|
||||||
IModel model;
|
IModel model;
|
||||||
try
|
try
|
||||||
|
@ -96,14 +96,14 @@ public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
||||||
@Override
|
@Override
|
||||||
public IModel process(ImmutableMap<String, String> customData)
|
public IModel process(ImmutableMap<String, String> customData)
|
||||||
{
|
{
|
||||||
ImmutableMap.Builder<Optional<EnumWorldBlockLayer>, ModelResourceLocation> builder = ImmutableMap.builder();
|
ImmutableMap.Builder<Optional<BlockRenderLayer>, ModelResourceLocation> builder = ImmutableMap.builder();
|
||||||
for(String key : customData.keySet())
|
for(String key : customData.keySet())
|
||||||
{
|
{
|
||||||
if("base".equals(key))
|
if("base".equals(key))
|
||||||
{
|
{
|
||||||
builder.put(Optional.<EnumWorldBlockLayer>absent(), getLocation(customData.get(key)));
|
builder.put(Optional.<BlockRenderLayer>absent(), getLocation(customData.get(key)));
|
||||||
}
|
}
|
||||||
for(EnumWorldBlockLayer layer : EnumWorldBlockLayer.values())
|
for(BlockRenderLayer layer : BlockRenderLayer.values())
|
||||||
{
|
{
|
||||||
if(layer.toString().equals(key))
|
if(layer.toString().equals(key))
|
||||||
{
|
{
|
||||||
|
@ -111,7 +111,7 @@ public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImmutableMap<Optional<EnumWorldBlockLayer>, ModelResourceLocation> models = builder.build();
|
ImmutableMap<Optional<BlockRenderLayer>, ModelResourceLocation> models = builder.build();
|
||||||
if(models.isEmpty()) return instance;
|
if(models.isEmpty()) return instance;
|
||||||
return new MultiLayerModel(models);
|
return new MultiLayerModel(models);
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
||||||
|
|
||||||
public static class MultiLayerBakedModel implements IFlexibleBakedModel, ISmartBlockModel, IPerspectiveAwareModel
|
public static class MultiLayerBakedModel implements IFlexibleBakedModel, ISmartBlockModel, IPerspectiveAwareModel
|
||||||
{
|
{
|
||||||
private final ImmutableMap<Optional<EnumWorldBlockLayer>, IFlexibleBakedModel> models;
|
private final ImmutableMap<Optional<BlockRenderLayer>, IFlexibleBakedModel> models;
|
||||||
private final VertexFormat format;
|
private final VertexFormat format;
|
||||||
private final ImmutableMap<TransformType, TRSRTransformation> cameraTransforms;;
|
private final ImmutableMap<TransformType, TRSRTransformation> cameraTransforms;;
|
||||||
private final IFlexibleBakedModel base;
|
private final IFlexibleBakedModel base;
|
||||||
|
@ -145,7 +145,7 @@ public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
||||||
};
|
};
|
||||||
|
|
||||||
@Deprecated // remove 1.9
|
@Deprecated // remove 1.9
|
||||||
public MultiLayerBakedModel(ImmutableMap<Optional<EnumWorldBlockLayer>, ModelResourceLocation> models, VertexFormat format, ImmutableMap<TransformType, TRSRTransformation> cameraTransforms)
|
public MultiLayerBakedModel(ImmutableMap<Optional<BlockRenderLayer>, ModelResourceLocation> models, VertexFormat format, ImmutableMap<TransformType, TRSRTransformation> cameraTransforms)
|
||||||
{
|
{
|
||||||
this(
|
this(
|
||||||
buildModels(models, TRSRTransformation.identity(), format, defaultTextureGetter),
|
buildModels(models, TRSRTransformation.identity(), format, defaultTextureGetter),
|
||||||
|
@ -155,7 +155,7 @@ public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MultiLayerBakedModel(ImmutableMap<Optional<EnumWorldBlockLayer>, IFlexibleBakedModel> models, IFlexibleBakedModel missing, VertexFormat format, ImmutableMap<TransformType, TRSRTransformation> cameraTransforms)
|
public MultiLayerBakedModel(ImmutableMap<Optional<BlockRenderLayer>, IFlexibleBakedModel> models, IFlexibleBakedModel missing, VertexFormat format, ImmutableMap<TransformType, TRSRTransformation> cameraTransforms)
|
||||||
{
|
{
|
||||||
this.models = models;
|
this.models = models;
|
||||||
this.format = format;
|
this.format = format;
|
||||||
|
@ -178,7 +178,7 @@ public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
||||||
quads = quadBuilder.build();
|
quads = quadBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ImmutableList<BakedQuad> buildQuads(ImmutableMap<Optional<EnumWorldBlockLayer>, IFlexibleBakedModel> models, Optional<EnumFacing> side)
|
private static ImmutableList<BakedQuad> buildQuads(ImmutableMap<Optional<BlockRenderLayer>, IFlexibleBakedModel> models, Optional<EnumFacing> side)
|
||||||
{
|
{
|
||||||
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
||||||
for(IBakedModel model : models.values())
|
for(IBakedModel model : models.values())
|
||||||
|
@ -240,7 +240,7 @@ public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
|
||||||
@Override
|
@Override
|
||||||
public IBakedModel handleBlockState(IBlockState state)
|
public IBakedModel handleBlockState(IBlockState state)
|
||||||
{
|
{
|
||||||
Optional<EnumWorldBlockLayer> layer = Optional.of(MinecraftForgeClient.getRenderLayer());
|
Optional<BlockRenderLayer> layer = Optional.of(MinecraftForgeClient.getRenderLayer());
|
||||||
if(!models.containsKey(layer))
|
if(!models.containsKey(layer))
|
||||||
{
|
{
|
||||||
return missing;
|
return missing;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import javax.vecmath.Vector3f;
|
||||||
import javax.vecmath.Vector4f;
|
import javax.vecmath.Vector4f;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.block.model.ItemTransformVec3f;
|
import net.minecraft.client.renderer.block.model.ItemTransformVec3f;
|
||||||
import net.minecraft.client.resources.model.ModelRotation;
|
import net.minecraft.client.renderer.block.model.ModelRotation;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.Vec3i;
|
import net.minecraft.util.Vec3i;
|
||||||
|
|
||||||
|
|
|
@ -6,19 +6,19 @@ import net.minecraft.client.model.ModelBase;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraftforge.client.model.IModel;
|
import net.minecraftforge.client.model.IModel;
|
||||||
import net.minecraftforge.client.model.IModelState;
|
import net.minecraftforge.client.model.IModelState;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
import net.minecraftforge.client.model.pipeline.VertexLighterFlat;
|
import net.minecraftforge.client.model.pipeline.VertexLighterFlat;
|
||||||
import net.minecraftforge.client.model.pipeline.WorldRendererConsumer;
|
import net.minecraftforge.client.model.pipeline.VertexBufferConsumer;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
@ -58,11 +58,11 @@ public class AnimationModelBase<T extends Entity & IAnimationProvider> extends M
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.rotate(180, 0, 0, 1);
|
GlStateManager.rotate(180, 0, 0, 1);
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
|
VertexBuffer VertexBuffer = tessellator.getVertexBuffer();
|
||||||
worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
|
VertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
|
||||||
worldRenderer.setTranslation(-0.5, -1.5, -0.5);
|
VertexBuffer.setTranslation(-0.5, -1.5, -0.5);
|
||||||
|
|
||||||
lighter.setParent(new WorldRendererConsumer(worldRenderer));
|
lighter.setParent(new VertexBufferConsumer(VertexBuffer));
|
||||||
lighter.setWorld(entity.worldObj);
|
lighter.setWorld(entity.worldObj);
|
||||||
lighter.setBlock(Blocks.air);
|
lighter.setBlock(Blocks.air);
|
||||||
lighter.setBlockPos(pos);
|
lighter.setBlockPos(pos);
|
||||||
|
@ -92,12 +92,12 @@ public class AnimationModelBase<T extends Entity & IAnimationProvider> extends M
|
||||||
}
|
}
|
||||||
|
|
||||||
// debug quad
|
// debug quad
|
||||||
/*worldRenderer.pos(0, 1, 0).color(0xFF, 0xFF, 0xFF, 0xFF).tex(0, 0).lightmap(240, 0).endVertex();
|
/*VertexBuffer.pos(0, 1, 0).color(0xFF, 0xFF, 0xFF, 0xFF).tex(0, 0).lightmap(240, 0).endVertex();
|
||||||
worldRenderer.pos(0, 1, 1).color(0xFF, 0xFF, 0xFF, 0xFF).tex(0, 1).lightmap(240, 0).endVertex();
|
VertexBuffer.pos(0, 1, 1).color(0xFF, 0xFF, 0xFF, 0xFF).tex(0, 1).lightmap(240, 0).endVertex();
|
||||||
worldRenderer.pos(1, 1, 1).color(0xFF, 0xFF, 0xFF, 0xFF).tex(1, 1).lightmap(240, 0).endVertex();
|
VertexBuffer.pos(1, 1, 1).color(0xFF, 0xFF, 0xFF, 0xFF).tex(1, 1).lightmap(240, 0).endVertex();
|
||||||
worldRenderer.pos(1, 1, 0).color(0xFF, 0xFF, 0xFF, 0xFF).tex(1, 0).lightmap(240, 0).endVertex();*/
|
VertexBuffer.pos(1, 1, 0).color(0xFF, 0xFF, 0xFF, 0xFF).tex(1, 0).lightmap(240, 0).endVertex();*/
|
||||||
|
|
||||||
worldRenderer.setTranslation(0, 0, 0);
|
VertexBuffer.setTranslation(0, 0, 0);
|
||||||
|
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
|
|
|
@ -5,10 +5,10 @@ import java.util.concurrent.TimeUnit;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
import net.minecraftforge.client.MinecraftForgeClient;
|
||||||
import net.minecraftforge.client.model.IModelState;
|
import net.minecraftforge.client.model.IModelState;
|
||||||
|
@ -47,7 +47,7 @@ public class AnimationTESR<T extends TileEntity & IAnimationProvider> extends Fa
|
||||||
return modelCache.getUnchecked(Pair.of(state, modelState));
|
return modelCache.getUnchecked(Pair.of(state, modelState));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderTileEntityFast(T te, double x, double y, double z, float partialTick, int breakStage, WorldRenderer renderer)
|
public void renderTileEntityFast(T te, double x, double y, double z, float partialTick, int breakStage, VertexBuffer renderer)
|
||||||
{
|
{
|
||||||
if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||||
BlockPos pos = te.getPos();
|
BlockPos pos = te.getPos();
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.minecraftforge.client.model.animation;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.util.IStringSerializable;
|
import net.minecraft.util.IStringSerializable;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
@ -18,7 +18,7 @@ public abstract class FastTESR<T extends TileEntity> extends TileEntitySpecialRe
|
||||||
public final void renderTileEntityAt(T te, double x, double y, double z, float partialTicks, int destroyStage)
|
public final void renderTileEntityAt(T te, double x, double y, double z, float partialTicks, int destroyStage)
|
||||||
{
|
{
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
|
VertexBuffer VertexBuffer = tessellator.getVertexBuffer();
|
||||||
this.bindTexture(TextureMap.locationBlocksTexture);
|
this.bindTexture(TextureMap.locationBlocksTexture);
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
@ -34,10 +34,10 @@ public abstract class FastTESR<T extends TileEntity> extends TileEntitySpecialRe
|
||||||
GlStateManager.shadeModel(GL11.GL_FLAT);
|
GlStateManager.shadeModel(GL11.GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
|
VertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
|
||||||
|
|
||||||
renderTileEntityFast(te, x, y, z, partialTicks, destroyStage, worldRenderer);
|
renderTileEntityFast(te, x, y, z, partialTicks, destroyStage, VertexBuffer);
|
||||||
worldRenderer.setTranslation(0, 0, 0);
|
VertexBuffer.setTranslation(0, 0, 0);
|
||||||
|
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
|
@ -45,5 +45,5 @@ public abstract class FastTESR<T extends TileEntity> extends TileEntitySpecialRe
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public abstract void renderTileEntityFast(T te, double x, double y, double z, float partialTicks, int destroyStage, WorldRenderer worldRenderer);
|
public abstract void renderTileEntityFast(T te, double x, double y, double z, float partialTicks, int destroyStage, VertexBuffer VertexBuffer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.resources.IResource;
|
import net.minecraft.client.resources.IResource;
|
||||||
import net.minecraft.client.resources.IResourceManager;
|
import net.minecraft.client.resources.IResourceManager;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.minecraftforge.client.model.pipeline;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.Block.EnumOffsetType;
|
import net.minecraft.block.Block.EnumOffsetType;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
|
@ -4,10 +4,10 @@ import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.BlockModelRenderer;
|
import net.minecraft.client.renderer.BlockModelRenderer;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.common.ForgeModContainer;
|
import net.minecraftforge.common.ForgeModContainer;
|
||||||
|
@ -32,20 +32,20 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private final ThreadLocal<WorldRendererConsumer> wrFlat = new ThreadLocal<WorldRendererConsumer>();
|
private final ThreadLocal<VertexBufferConsumer> wrFlat = new ThreadLocal<VertexBufferConsumer>();
|
||||||
private final ThreadLocal<WorldRendererConsumer> wrSmooth = new ThreadLocal<WorldRendererConsumer>();
|
private final ThreadLocal<VertexBufferConsumer> wrSmooth = new ThreadLocal<VertexBufferConsumer>();
|
||||||
private final ThreadLocal<WorldRenderer> lastRendererFlat = new ThreadLocal<WorldRenderer>();
|
private final ThreadLocal<VertexBuffer> lastRendererFlat = new ThreadLocal<VertexBuffer>();
|
||||||
private final ThreadLocal<WorldRenderer> lastRendererSmooth = new ThreadLocal<WorldRenderer>();
|
private final ThreadLocal<VertexBuffer> lastRendererSmooth = new ThreadLocal<VertexBuffer>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderModelStandard(IBlockAccess world, IBakedModel model, Block block, BlockPos pos, WorldRenderer wr, boolean checkSides)
|
public boolean renderModelStandard(IBlockAccess world, IBakedModel model, Block block, BlockPos pos, VertexBuffer wr, boolean checkSides)
|
||||||
{
|
{
|
||||||
if(ForgeModContainer.forgeLightPipelineEnabled)
|
if(ForgeModContainer.forgeLightPipelineEnabled)
|
||||||
{
|
{
|
||||||
if(wr != lastRendererFlat.get())
|
if(wr != lastRendererFlat.get())
|
||||||
{
|
{
|
||||||
lastRendererFlat.set(wr);
|
lastRendererFlat.set(wr);
|
||||||
WorldRendererConsumer newCons = new WorldRendererConsumer(wr);
|
VertexBufferConsumer newCons = new VertexBufferConsumer(wr);
|
||||||
wrFlat.set(newCons);
|
wrFlat.set(newCons);
|
||||||
lighterFlat.get().setParent(newCons);
|
lighterFlat.get().setParent(newCons);
|
||||||
}
|
}
|
||||||
|
@ -59,14 +59,14 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderModelAmbientOcclusion(IBlockAccess world, IBakedModel model, Block block, BlockPos pos, WorldRenderer wr, boolean checkSides)
|
public boolean renderModelAmbientOcclusion(IBlockAccess world, IBakedModel model, Block block, BlockPos pos, VertexBuffer wr, boolean checkSides)
|
||||||
{
|
{
|
||||||
if(ForgeModContainer.forgeLightPipelineEnabled)
|
if(ForgeModContainer.forgeLightPipelineEnabled)
|
||||||
{
|
{
|
||||||
if(wr != lastRendererSmooth.get())
|
if(wr != lastRendererSmooth.get())
|
||||||
{
|
{
|
||||||
lastRendererSmooth.set(wr);
|
lastRendererSmooth.set(wr);
|
||||||
WorldRendererConsumer newCons = new WorldRendererConsumer(wr);
|
VertexBufferConsumer newCons = new VertexBufferConsumer(wr);
|
||||||
wrSmooth.set(newCons);
|
wrSmooth.set(newCons);
|
||||||
lighterSmooth.get().setParent(newCons);
|
lighterSmooth.get().setParent(newCons);
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean render(VertexLighterFlat lighter, IBlockAccess world, IBakedModel model, Block block, BlockPos pos, WorldRenderer wr, boolean checkSides)
|
public static boolean render(VertexLighterFlat lighter, IBlockAccess world, IBakedModel model, Block block, BlockPos pos, VertexBuffer wr, boolean checkSides)
|
||||||
{
|
{
|
||||||
lighter.setWorld(world);
|
lighter.setWorld(world);
|
||||||
lighter.setBlock(block);
|
lighter.setBlock(block);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package net.minecraftforge.client.model.pipeline;
|
package net.minecraftforge.client.model.pipeline;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
|
@ -240,8 +240,8 @@ public class LightUtil
|
||||||
if(tessellator == null)
|
if(tessellator == null)
|
||||||
{
|
{
|
||||||
Tessellator tes = Tessellator.getInstance();
|
Tessellator tes = Tessellator.getInstance();
|
||||||
WorldRenderer wr = tes.getWorldRenderer();
|
VertexBuffer wr = tes.getVertexBuffer();
|
||||||
tessellator = new WorldRendererConsumer(wr);
|
tessellator = new VertexBufferConsumer(wr);
|
||||||
}
|
}
|
||||||
return tessellator;
|
return tessellator;
|
||||||
}
|
}
|
||||||
|
@ -257,16 +257,16 @@ public class LightUtil
|
||||||
}
|
}
|
||||||
|
|
||||||
// renders quad in any Vertex Format, but is slower
|
// renders quad in any Vertex Format, but is slower
|
||||||
public static void renderQuadColorSlow(WorldRenderer wr, BakedQuad quad, int auxColor)
|
public static void renderQuadColorSlow(VertexBuffer wr, BakedQuad quad, int auxColor)
|
||||||
{
|
{
|
||||||
ItemConsumer cons;
|
ItemConsumer cons;
|
||||||
if(wr == Tessellator.getInstance().getWorldRenderer())
|
if(wr == Tessellator.getInstance().getVertexBuffer())
|
||||||
{
|
{
|
||||||
cons = getItemConsumer();
|
cons = getItemConsumer();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cons = new ItemConsumer(new WorldRendererConsumer(wr));
|
cons = new ItemConsumer(new VertexBufferConsumer(wr));
|
||||||
}
|
}
|
||||||
float b = (float)(auxColor & 0xFF) / 0xFF;
|
float b = (float)(auxColor & 0xFF) / 0xFF;
|
||||||
float g = (float)((auxColor >>> 8) & 0xFF) / 0xFF;
|
float g = (float)((auxColor >>> 8) & 0xFF) / 0xFF;
|
||||||
|
@ -277,7 +277,7 @@ public class LightUtil
|
||||||
quad.pipe(cons);
|
quad.pipe(cons);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void renderQuadColor(WorldRenderer wr, BakedQuad quad, int auxColor)
|
public static void renderQuadColor(VertexBuffer wr, BakedQuad quad, int auxColor)
|
||||||
{
|
{
|
||||||
wr.addVertexData(quad.getVertexData());
|
wr.addVertexData(quad.getVertexData());
|
||||||
if(quad instanceof IColoredBakedQuad)
|
if(quad instanceof IColoredBakedQuad)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.EntityRenderer;
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||||
switch(element.getUsage())
|
switch(element.getUsage())
|
||||||
{
|
{
|
||||||
case POSITION:
|
case POSITION:
|
||||||
// position adding moved to WorldRendererConsumer due to x and z not fitting completely into a float
|
// position adding moved to VertexBufferConsumer due to x and z not fitting completely into a float
|
||||||
/*float[] pos = new float[4];
|
/*float[] pos = new float[4];
|
||||||
System.arraycopy(position[v], 0, pos, 0, position[v].length);
|
System.arraycopy(position[v], 0, pos, 0, position[v].length);
|
||||||
pos[0] += blockInfo.getBlockPos().getX();
|
pos[0] += blockInfo.getBlockPos().getX();
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
package net.minecraftforge.client.model.pipeline;
|
package net.minecraftforge.client.model.pipeline;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage;
|
import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assumes VertexFormatElement is present in the WorlRenderer's vertex format.
|
* Assumes VertexFormatElement is present in the WorlRenderer's vertex format.
|
||||||
*/
|
*/
|
||||||
public class WorldRendererConsumer implements IVertexConsumer
|
public class VertexBufferConsumer implements IVertexConsumer
|
||||||
{
|
{
|
||||||
private static final float[] dummyColor = new float[]{ 1, 1, 1, 1 };
|
private static final float[] dummyColor = new float[]{ 1, 1, 1, 1 };
|
||||||
private final WorldRenderer renderer;
|
private final VertexBuffer renderer;
|
||||||
private final int[] quadData;
|
private final int[] quadData;
|
||||||
private int v = 0;
|
private int v = 0;
|
||||||
private BlockPos offset = BlockPos.ORIGIN;
|
private BlockPos offset = BlockPos.ORIGIN;
|
||||||
|
|
||||||
public WorldRendererConsumer(WorldRenderer renderer)
|
public VertexBufferConsumer(VertexBuffer renderer)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
|
|
|
@ -557,13 +557,13 @@ public class ForgeHooks
|
||||||
"((?:[a-z0-9]{2,}:\\/\\/)?(?:(?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:[-\\w_\\.]{1,}\\.[a-z]{2,}?))(?::[0-9]{1,5})?.*?(?=[!\"\u00A7 \n]|$))",
|
"((?:[a-z0-9]{2,}:\\/\\/)?(?:(?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:[-\\w_\\.]{1,}\\.[a-z]{2,}?))(?::[0-9]{1,5})?.*?(?=[!\"\u00A7 \n]|$))",
|
||||||
Pattern.CASE_INSENSITIVE);
|
Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
public static IChatComponent newChatWithLinks(String string){ return newChatWithLinks(string, true); }
|
public static ITextComponent newChatWithLinks(String string){ return newChatWithLinks(string, true); }
|
||||||
public static IChatComponent newChatWithLinks(String string, boolean allowMissingHeader)
|
public static ITextComponent newChatWithLinks(String string, boolean allowMissingHeader)
|
||||||
{
|
{
|
||||||
// Includes ipv4 and domain pattern
|
// Includes ipv4 and domain pattern
|
||||||
// Matches an ip (xx.xxx.xx.xxx) or a domain (something.com) with or
|
// Matches an ip (xx.xxx.xx.xxx) or a domain (something.com) with or
|
||||||
// without a protocol or path.
|
// without a protocol or path.
|
||||||
IChatComponent ichat = null;
|
ITextComponent ichat = null;
|
||||||
Matcher matcher = URL_PATTERN.matcher(string);
|
Matcher matcher = URL_PATTERN.matcher(string);
|
||||||
int lastEnd = 0;
|
int lastEnd = 0;
|
||||||
|
|
||||||
|
@ -578,13 +578,13 @@ public class ForgeHooks
|
||||||
if (part.length() > 0)
|
if (part.length() > 0)
|
||||||
{
|
{
|
||||||
if (ichat == null)
|
if (ichat == null)
|
||||||
ichat = new ChatComponentText(part);
|
ichat = new TextComponentString(part);
|
||||||
else
|
else
|
||||||
ichat.appendText(part);
|
ichat.appendText(part);
|
||||||
}
|
}
|
||||||
lastEnd = end;
|
lastEnd = end;
|
||||||
String url = string.substring(start, end);
|
String url = string.substring(start, end);
|
||||||
IChatComponent link = new ChatComponentText(url);
|
ITextComponent link = new TextComponentString(url);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -594,7 +594,7 @@ public class ForgeHooks
|
||||||
if (!allowMissingHeader)
|
if (!allowMissingHeader)
|
||||||
{
|
{
|
||||||
if (ichat == null)
|
if (ichat == null)
|
||||||
ichat = new ChatComponentText(url);
|
ichat = new TextComponentString(url);
|
||||||
else
|
else
|
||||||
ichat.appendText(url);
|
ichat.appendText(url);
|
||||||
continue;
|
continue;
|
||||||
|
@ -605,7 +605,7 @@ public class ForgeHooks
|
||||||
catch (URISyntaxException e)
|
catch (URISyntaxException e)
|
||||||
{
|
{
|
||||||
// Bad syntax bail out!
|
// Bad syntax bail out!
|
||||||
if (ichat == null) ichat = new ChatComponentText(url);
|
if (ichat == null) ichat = new TextComponentString(url);
|
||||||
else ichat.appendText(url);
|
else ichat.appendText(url);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -624,7 +624,7 @@ public class ForgeHooks
|
||||||
// Append the rest of the message.
|
// Append the rest of the message.
|
||||||
String end = string.substring(lastEnd);
|
String end = string.substring(lastEnd);
|
||||||
if (ichat == null)
|
if (ichat == null)
|
||||||
ichat = new ChatComponentText(end);
|
ichat = new TextComponentString(end);
|
||||||
else if (end.length() > 0)
|
else if (end.length() > 0)
|
||||||
ichat.appendText(string.substring(lastEnd));
|
ichat.appendText(string.substring(lastEnd));
|
||||||
return ichat;
|
return ichat;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.state.BlockState;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
|
||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
|
@ -18,7 +18,7 @@ import com.google.common.collect.ImmutableTable;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
public class ExtendedBlockState extends BlockState
|
public class ExtendedBlockState extends BlockStateContainer
|
||||||
{
|
{
|
||||||
private final ImmutableSet<IUnlistedProperty<?>> unlistedProperties;
|
private final ImmutableSet<IUnlistedProperty<?>> unlistedProperties;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public class ExtendedBlockState extends BlockState
|
||||||
}
|
}
|
||||||
this.unlistedProperties = builder.build();
|
this.unlistedProperties = builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<IUnlistedProperty<?>> getUnlistedProperties()
|
public Collection<IUnlistedProperty<?>> getUnlistedProperties()
|
||||||
{
|
{
|
||||||
return unlistedProperties;
|
return unlistedProperties;
|
||||||
|
@ -143,13 +143,13 @@ public class ExtendedBlockState extends BlockState
|
||||||
this.normalMap = map;
|
this.normalMap = map;
|
||||||
super.buildPropertyValueTable(map);
|
super.buildPropertyValueTable(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ExtendedStateImplementation setMap(@SuppressWarnings("rawtypes") Map<Map<IProperty, Comparable>, BlockState.StateImplementation> map)
|
private ExtendedStateImplementation setMap(@SuppressWarnings("rawtypes") Map<Map<IProperty, Comparable>, BlockState.StateImplementation> map)
|
||||||
{
|
{
|
||||||
this.normalMap = map;
|
this.normalMap = map;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBlockState getClean()
|
public IBlockState getClean()
|
||||||
{
|
{
|
||||||
return this.normalMap.get(getProperties());
|
return this.normalMap.get(getProperties());
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.io.Serializable;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.network.play.client.C15PacketClientSettings;
|
||||||
import net.minecraft.server.management.ItemInWorldManager;
|
import net.minecraft.server.management.ItemInWorldManager;
|
||||||
import net.minecraft.stats.StatBase;
|
import net.minecraft.stats.StatBase;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldServer;
|
import net.minecraft.world.WorldServer;
|
||||||
|
@ -24,7 +24,7 @@ public class FakePlayer extends EntityPlayerMP
|
||||||
|
|
||||||
@Override public Vec3 getPositionVector(){ return new Vec3(0, 0, 0); }
|
@Override public Vec3 getPositionVector(){ return new Vec3(0, 0, 0); }
|
||||||
@Override public boolean canCommandSenderUseCommand(int i, String s){ return false; }
|
@Override public boolean canCommandSenderUseCommand(int i, String s){ return false; }
|
||||||
@Override public void addChatComponentMessage(IChatComponent chatmessagecomponent){}
|
@Override public void addChatComponentMessage(ITextComponent chatmessagecomponent){}
|
||||||
@Override public void addStat(StatBase par1StatBase, int par2){}
|
@Override public void addStat(StatBase par1StatBase, int par2){}
|
||||||
@Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){}
|
@Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){}
|
||||||
@Override public boolean isEntityInvulnerable(DamageSource source){ return true; }
|
@Override public boolean isEntityInvulnerable(DamageSource source){ return true; }
|
||||||
|
|
|
@ -263,7 +263,7 @@ public class ForgeEventFactory
|
||||||
MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, dir, uuidString));
|
MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, dir, uuidString));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IChatComponent onClientChat(byte type, IChatComponent message)
|
public static ITextComponent onClientChat(byte type, ITextComponent message)
|
||||||
{
|
{
|
||||||
ClientChatReceivedEvent event = new ClientChatReceivedEvent(type, message);
|
ClientChatReceivedEvent event = new ClientChatReceivedEvent(type, message);
|
||||||
return MinecraftForge.EVENT_BUS.post(event) ? null : event.message;
|
return MinecraftForge.EVENT_BUS.post(event) ? null : event.message;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.util.ChatComponentTranslation;
|
import net.minecraft.util.ChatComponentTranslation;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ServerChatEvent is fired whenever a C01PacketChatMessage is processed. <br>
|
* ServerChatEvent is fired whenever a C01PacketChatMessage is processed. <br>
|
||||||
|
@ -39,7 +39,7 @@ public class ServerChatEvent extends Event
|
||||||
this.component = component;
|
this.component = component;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComponent(IChatComponent e)
|
public void setComponent(ITextComponent e)
|
||||||
{
|
{
|
||||||
if (e instanceof ChatComponentTranslation)
|
if (e instanceof ChatComponentTranslation)
|
||||||
this.component = (ChatComponentTranslation)e;
|
this.component = (ChatComponentTranslation)e;
|
||||||
|
@ -47,7 +47,7 @@ public class ServerChatEvent extends Event
|
||||||
this.component = new ChatComponentTranslation("%s", e);
|
this.component = new ChatComponentTranslation("%s", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IChatComponent getComponent()
|
public ITextComponent getComponent()
|
||||||
{
|
{
|
||||||
return this.component;
|
return this.component;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package net.minecraftforge.event.entity.minecart;
|
package net.minecraftforge.event.entity.minecart;
|
||||||
|
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
import net.minecraft.entity.item.EntityMinecart;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MinecartUpdateEvent is fired when a minecart is updated.<br>
|
* MinecartUpdateEvent is fired when a minecart is updated.<br>
|
||||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@Cancelable
|
@Cancelable
|
||||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,9 +3,9 @@ package net.minecraftforge.event.entity.player;
|
||||||
import static net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT;
|
import static net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT;
|
||||||
import static net.minecraftforge.fml.common.eventhandler.Event.Result.DENY;
|
import static net.minecraftforge.fml.common.eventhandler.Event.Result.DENY;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class PlayerInteractEvent extends PlayerEvent
|
||||||
public final World world;
|
public final World world;
|
||||||
public final BlockPos pos;
|
public final BlockPos pos;
|
||||||
public final EnumFacing face; // Can be null if unknown
|
public final EnumFacing face; // Can be null if unknown
|
||||||
public final Vec3 localPos; // Can be null if unknown
|
public final Vec3d localPos; // Can be null if unknown
|
||||||
|
|
||||||
public Result useBlock = DEFAULT;
|
public Result useBlock = DEFAULT;
|
||||||
public Result useItem = DEFAULT;
|
public Result useItem = DEFAULT;
|
||||||
|
@ -57,7 +57,7 @@ public class PlayerInteractEvent extends PlayerEvent
|
||||||
this(player, action, pos, face, world, null);
|
this(player, action, pos, face, world, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerInteractEvent(EntityPlayer player, Action action, BlockPos pos, EnumFacing face, World world, Vec3 localPos)
|
public PlayerInteractEvent(EntityPlayer player, Action action, BlockPos pos, EnumFacing face, World world, Vec3d localPos)
|
||||||
{
|
{
|
||||||
super(player);
|
super(player);
|
||||||
this.action = action;
|
this.action = action;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public class PlayerSetSpawnEvent extends PlayerEvent
|
public class PlayerSetSpawnEvent extends PlayerEvent
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayer.EnumStatus;
|
import net.minecraft.entity.player.EntityPlayer.EnumStatus;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PlayerSleepInBedEvent is fired when a player sleeps in a bed.
|
* PlayerSleepInBedEvent is fired when a player sleeps in a bed.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package net.minecraftforge.event.entity.player;
|
package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package net.minecraftforge.event.terraingen;
|
package net.minecraftforge.event.terraingen;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.biome.BiomeDecorator;
|
import net.minecraft.world.biome.BiomeDecorator;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.Explosion;
|
import net.minecraft.world.Explosion;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.EnumCreatureType;
|
import net.minecraft.entity.EnumCreatureType;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldSettings;
|
import net.minecraft.world.WorldSettings;
|
||||||
import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry;
|
import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry;
|
||||||
|
|
|
@ -13,9 +13,9 @@ import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumWorldBlockLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -113,7 +113,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
||||||
protected int temperature = 295;
|
protected int temperature = 295;
|
||||||
|
|
||||||
protected int tickRate = 20;
|
protected int tickRate = 20;
|
||||||
protected EnumWorldBlockLayer renderLayer = EnumWorldBlockLayer.TRANSLUCENT;
|
protected BlockRenderLayer renderLayer = BlockRenderLayer.TRANSLUCENT;
|
||||||
protected int maxScaledLight = 0;
|
protected int maxScaledLight = 0;
|
||||||
|
|
||||||
protected final String fluidName;
|
protected final String fluidName;
|
||||||
|
@ -185,7 +185,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockFluidBase setRenderLayer(EnumWorldBlockLayer renderLayer)
|
public BlockFluidBase setRenderLayer(BlockRenderLayer renderLayer)
|
||||||
{
|
{
|
||||||
this.renderLayer = renderLayer;
|
this.renderLayer = renderLayer;
|
||||||
return this;
|
return this;
|
||||||
|
@ -404,7 +404,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public EnumWorldBlockLayer getBlockLayer()
|
public BlockRenderLayer getBlockLayer()
|
||||||
{
|
{
|
||||||
return this.renderLayer;
|
return this.renderLayer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.minecraftforge.fluids;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
package net.minecraftforge.fluids;
|
package net.minecraftforge.fluids;
|
||||||
|
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
|
|
|
@ -8,7 +8,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ReportedException;
|
import net.minecraft.util.ReportedException;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package net.minecraftforge.fluids;
|
package net.minecraftforge.fluids;
|
||||||
|
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.stats.StatList;
|
import net.minecraft.stats.StatList;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumParticleTypes;
|
import net.minecraft.util.EnumParticleTypes;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
|
@ -34,14 +34,14 @@ import net.minecraft.client.gui.GuiTextField;
|
||||||
import net.minecraft.client.gui.GuiUtilRenderComponents;
|
import net.minecraft.client.gui.GuiUtilRenderComponents;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||||
import net.minecraft.client.renderer.texture.TextureManager;
|
import net.minecraft.client.renderer.texture.TextureManager;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.client.resources.IResourcePack;
|
import net.minecraft.client.resources.IResourcePack;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.TextComponentString;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.StringUtils;
|
import net.minecraft.util.StringUtils;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
|
@ -451,7 +451,7 @@ public class GuiModList extends GuiScreen
|
||||||
{
|
{
|
||||||
private ResourceLocation logoPath;
|
private ResourceLocation logoPath;
|
||||||
private Dimension logoDims;
|
private Dimension logoDims;
|
||||||
private List<IChatComponent> lines = null;
|
private List<ITextComponent> lines = null;
|
||||||
|
|
||||||
public Info(int width, List<String> lines, ResourceLocation logoPath, Dimension logoDims)
|
public Info(int width, List<String> lines, ResourceLocation logoPath, Dimension logoDims)
|
||||||
{
|
{
|
||||||
|
@ -475,9 +475,9 @@ public class GuiModList extends GuiScreen
|
||||||
@Override protected void drawBackground() {}
|
@Override protected void drawBackground() {}
|
||||||
@Override protected void drawSlot(int slotIdx, int entryRight, int slotTop, int slotBuffer, Tessellator tess) { }
|
@Override protected void drawSlot(int slotIdx, int entryRight, int slotTop, int slotBuffer, Tessellator tess) { }
|
||||||
|
|
||||||
private List<IChatComponent> resizeContent(List<String> lines)
|
private List<ITextComponent> resizeContent(List<String> lines)
|
||||||
{
|
{
|
||||||
List<IChatComponent> ret = new ArrayList<IChatComponent>();
|
List<ITextComponent> ret = new ArrayList<ITextComponent>();
|
||||||
for (String line : lines)
|
for (String line : lines)
|
||||||
{
|
{
|
||||||
if (line == null)
|
if (line == null)
|
||||||
|
@ -486,7 +486,7 @@ public class GuiModList extends GuiScreen
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
IChatComponent chat = ForgeHooks.newChatWithLinks(line, false);
|
ITextComponent chat = ForgeHooks.newChatWithLinks(line, false);
|
||||||
ret.addAll(GuiUtilRenderComponents.func_178908_a(chat, this.listWidth-8, GuiModList.this.fontRendererObj, false, true));
|
ret.addAll(GuiUtilRenderComponents.func_178908_a(chat, this.listWidth-8, GuiModList.this.fontRendererObj, false, true));
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -524,7 +524,7 @@ public class GuiModList extends GuiScreen
|
||||||
{
|
{
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
GuiModList.this.mc.renderEngine.bindTexture(logoPath);
|
GuiModList.this.mc.renderEngine.bindTexture(logoPath);
|
||||||
WorldRenderer wr = tess.getWorldRenderer();
|
VertexBuffer wr = tess.getVertexBuffer();
|
||||||
int offset = (this.left + this.listWidth/2) - (logoDims.width / 2);
|
int offset = (this.left + this.listWidth/2) - (logoDims.width / 2);
|
||||||
wr.begin(7, DefaultVertexFormats.POSITION_TEX);
|
wr.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||||
wr.pos(offset, top + logoDims.height, zLevel).tex(0, 1).endVertex();
|
wr.pos(offset, top + logoDims.height, zLevel).tex(0, 1).endVertex();
|
||||||
|
@ -536,7 +536,7 @@ public class GuiModList extends GuiScreen
|
||||||
top += logoDims.height + 10;
|
top += logoDims.height + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (IChatComponent line : lines)
|
for (ITextComponent line : lines)
|
||||||
{
|
{
|
||||||
if (line != null)
|
if (line != null)
|
||||||
{
|
{
|
||||||
|
@ -563,14 +563,14 @@ public class GuiModList extends GuiScreen
|
||||||
if (lineIdx >= lines.size())
|
if (lineIdx >= lines.size())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IChatComponent line = lines.get(lineIdx);
|
ITextComponent line = lines.get(lineIdx);
|
||||||
if (line != null)
|
if (line != null)
|
||||||
{
|
{
|
||||||
int k = -4;
|
int k = -4;
|
||||||
for (IChatComponent part : (Iterable<IChatComponent>)line) {
|
for (ITextComponent part : (Iterable<ITextComponent>)line) {
|
||||||
if (!(part instanceof ChatComponentText))
|
if (!(part instanceof TextComponentString))
|
||||||
continue;
|
continue;
|
||||||
k += GuiModList.this.fontRendererObj.getStringWidth(((ChatComponentText)part).getChatComponentText_TextValue());
|
k += GuiModList.this.fontRendererObj.getStringWidth(((TextComponentString)part).getTextComponentString_TextValue());
|
||||||
if (k >= x)
|
if (k >= x)
|
||||||
{
|
{
|
||||||
GuiModList.this.handleComponentClick(part);
|
GuiModList.this.handleComponentClick(part);
|
||||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
|
@ -263,7 +263,7 @@ public abstract class GuiScrollingList
|
||||||
this.applyScrollLimits();
|
this.applyScrollLimits();
|
||||||
|
|
||||||
Tessellator tess = Tessellator.getInstance();
|
Tessellator tess = Tessellator.getInstance();
|
||||||
WorldRenderer worldr = tess.getWorldRenderer();
|
VertexBuffer worldr = tess.getVertexBuffer();
|
||||||
|
|
||||||
ScaledResolution res = new ScaledResolution(client);
|
ScaledResolution res = new ScaledResolution(client);
|
||||||
double scaleW = client.displayWidth / res.getScaledWidth_double();
|
double scaleW = client.displayWidth / res.getScaledWidth_double();
|
||||||
|
@ -390,12 +390,12 @@ public abstract class GuiScrollingList
|
||||||
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||||
GlStateManager.shadeModel(GL11.GL_SMOOTH);
|
GlStateManager.shadeModel(GL11.GL_SMOOTH);
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
VertexBuffer VertexBuffer = tessellator.getVertexBuffer();
|
||||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
VertexBuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||||
worldrenderer.pos(right, top, 0.0D).color(r1, g1, b1, a1).endVertex();
|
VertexBuffer.pos(right, top, 0.0D).color(r1, g1, b1, a1).endVertex();
|
||||||
worldrenderer.pos(left, top, 0.0D).color(r1, g1, b1, a1).endVertex();
|
VertexBuffer.pos(left, top, 0.0D).color(r1, g1, b1, a1).endVertex();
|
||||||
worldrenderer.pos(left, bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
|
VertexBuffer.pos(left, bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
|
||||||
worldrenderer.pos(right, bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
|
VertexBuffer.pos(right, bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
GlStateManager.shadeModel(GL11.GL_FLAT);
|
GlStateManager.shadeModel(GL11.GL_FLAT);
|
||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.TextComponentString;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.client.config.GuiConfigEntries.IConfigEntry;
|
import net.minecraftforge.fml.client.config.GuiConfigEntries.IConfigEntry;
|
||||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||||
|
@ -247,7 +247,7 @@ public class GuiConfig extends GuiScreen
|
||||||
{
|
{
|
||||||
flag = false;
|
flag = false;
|
||||||
mc.displayGuiScreen(new GuiMessageDialog(parentScreen, "fml.configgui.gameRestartTitle",
|
mc.displayGuiScreen(new GuiMessageDialog(parentScreen, "fml.configgui.gameRestartTitle",
|
||||||
new ChatComponentText(I18n.format("fml.configgui.gameRestartRequired")), "fml.configgui.confirmRestartMessage"));
|
new TextComponentString(I18n.format("fml.configgui.gameRestartRequired")), "fml.configgui.confirmRestartMessage"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.parentScreen instanceof GuiConfig)
|
if (this.parentScreen instanceof GuiConfig)
|
||||||
|
|
|
@ -4,13 +4,13 @@ import net.minecraft.client.gui.GuiDisconnected;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
|
||||||
public class GuiMessageDialog extends GuiDisconnected
|
public class GuiMessageDialog extends GuiDisconnected
|
||||||
{
|
{
|
||||||
protected String buttonText;
|
protected String buttonText;
|
||||||
|
|
||||||
public GuiMessageDialog(GuiScreen nextScreen, String title, IChatComponent message, String buttonText)
|
public GuiMessageDialog(GuiScreen nextScreen, String title, ITextComponent message, String buttonText)
|
||||||
{
|
{
|
||||||
super(nextScreen, title, message);
|
super(nextScreen, title, message);
|
||||||
this.buttonText = buttonText;
|
this.buttonText = buttonText;
|
||||||
|
|
|
@ -15,7 +15,7 @@ package net.minecraftforge.fml.client.config;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.VertexBuffer;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ public class GuiUtils
|
||||||
float uScale = 1f / 0x100;
|
float uScale = 1f / 0x100;
|
||||||
float vScale = 1f / 0x100;
|
float vScale = 1f / 0x100;
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
WorldRenderer wr = tessellator.getWorldRenderer();
|
VertexBuffer wr = tessellator.getVertexBuffer();
|
||||||
wr.begin(7, DefaultVertexFormats.POSITION_TEX);
|
wr.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||||
wr.pos(x , y + height, zLevel).tex( u * uScale, ((v + height) * vScale)).endVertex();
|
wr.pos(x , y + height, zLevel).tex( u * uScale, ((v + height) * vScale)).endVertex();
|
||||||
wr.pos(x + width, y + height, zLevel).tex((u + width) * uScale, ((v + height) * vScale)).endVertex();
|
wr.pos(x + width, y + height, zLevel).tex((u + width) * uScale, ((v + height) * vScale)).endVertex();
|
||||||
|
|
|
@ -42,7 +42,7 @@ import net.minecraft.network.NetworkManager;
|
||||||
import net.minecraft.network.handshake.client.C00Handshake;
|
import net.minecraft.network.handshake.client.C00Handshake;
|
||||||
import net.minecraft.network.login.server.S00PacketDisconnect;
|
import net.minecraft.network.login.server.S00PacketDisconnect;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.TextComponentString;
|
||||||
import net.minecraft.util.IThreadListener;
|
import net.minecraft.util.IThreadListener;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.storage.SaveHandler;
|
import net.minecraft.world.storage.SaveHandler;
|
||||||
|
@ -609,7 +609,7 @@ public class FMLCommonHandler
|
||||||
{
|
{
|
||||||
if (!shouldAllowPlayerLogins())
|
if (!shouldAllowPlayerLogins())
|
||||||
{
|
{
|
||||||
ChatComponentText text = new ChatComponentText("Server is still starting! Please wait before reconnecting.");
|
TextComponentString text = new TextComponentString("Server is still starting! Please wait before reconnecting.");
|
||||||
FMLLog.info("Disconnecting Player: " + text.getUnformattedText());
|
FMLLog.info("Disconnecting Player: " + text.getUnformattedText());
|
||||||
manager.sendPacket(new S00PacketDisconnect(text));
|
manager.sendPacket(new S00PacketDisconnect(text));
|
||||||
manager.closeChannel(text);
|
manager.closeChannel(text);
|
||||||
|
@ -619,7 +619,7 @@ public class FMLCommonHandler
|
||||||
if (packet.getRequestedState() == EnumConnectionState.LOGIN && (!NetworkRegistry.INSTANCE.isVanillaAccepted(Side.CLIENT) && !packet.hasFMLMarker()))
|
if (packet.getRequestedState() == EnumConnectionState.LOGIN && (!NetworkRegistry.INSTANCE.isVanillaAccepted(Side.CLIENT) && !packet.hasFMLMarker()))
|
||||||
{
|
{
|
||||||
manager.setConnectionState(EnumConnectionState.LOGIN);
|
manager.setConnectionState(EnumConnectionState.LOGIN);
|
||||||
ChatComponentText text = new ChatComponentText("This server requires FML/Forge to be installed. Contact your server admin for more details.");
|
TextComponentString text = new TextComponentString("This server requires FML/Forge to be installed. Contact your server admin for more details.");
|
||||||
FMLLog.info("Disconnecting Player: " + text.getUnformattedText());
|
FMLLog.info("Disconnecting Player: " + text.getUnformattedText());
|
||||||
manager.sendPacket(new S00PacketDisconnect(text));
|
manager.sendPacket(new S00PacketDisconnect(text));
|
||||||
manager.closeChannel(text);
|
manager.closeChannel(text);
|
||||||
|
|
|
@ -32,7 +32,7 @@ import net.minecraft.network.play.server.S01PacketJoinGame;
|
||||||
import net.minecraft.network.play.server.S3FPacketCustomPayload;
|
import net.minecraft.network.play.server.S3FPacketCustomPayload;
|
||||||
import net.minecraft.network.play.server.S40PacketDisconnect;
|
import net.minecraft.network.play.server.S40PacketDisconnect;
|
||||||
import net.minecraft.server.management.ServerConfigurationManager;
|
import net.minecraft.server.management.ServerConfigurationManager;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.TextComponentString;
|
||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
|
@ -235,7 +235,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||||
this.state = ConnectionState.CONNECTED;
|
this.state = ConnectionState.CONNECTED;
|
||||||
MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ServerConnectionFromClientEvent(manager));
|
MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ServerConnectionFromClientEvent(manager));
|
||||||
if (DEBUG_HANDSHAKE)
|
if (DEBUG_HANDSHAKE)
|
||||||
manager.closeChannel(new ChatComponentText("Handshake Complete review log file for details."));
|
manager.closeChannel(new TextComponentString("Handshake Complete review log file for details."));
|
||||||
scm.initializeConnectionToPlayer(manager, player, serverHandler);
|
scm.initializeConnectionToPlayer(manager, player, serverHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,19 +306,19 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private void kickWithMessage(String message)
|
private void kickWithMessage(String message)
|
||||||
{
|
{
|
||||||
final ChatComponentText chatcomponenttext = new ChatComponentText(message);
|
final TextComponentString TextComponentString = new TextComponentString(message);
|
||||||
if (side == Side.CLIENT)
|
if (side == Side.CLIENT)
|
||||||
{
|
{
|
||||||
manager.closeChannel(chatcomponenttext);
|
manager.closeChannel(TextComponentString);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
manager.sendPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<? super Void>>()
|
manager.sendPacket(new S40PacketDisconnect(TextComponentString), new GenericFutureListener<Future<? super Void>>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void operationComplete(Future<? super Void> result)
|
public void operationComplete(Future<? super Void> result)
|
||||||
{
|
{
|
||||||
manager.closeChannel(chatcomponenttext);
|
manager.closeChannel(TextComponentString);
|
||||||
}
|
}
|
||||||
}, new GenericFutureListener[0]);
|
}, new GenericFutureListener[0]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityChest;
|
import net.minecraft.tileentity.TileEntityChest;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.command.CommandException;
|
||||||
import net.minecraft.command.ICommandSender;
|
import net.minecraft.command.ICommandSender;
|
||||||
import net.minecraft.command.WrongUsageException;
|
import net.minecraft.command.WrongUsageException;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.ChatComponentTranslation;
|
import net.minecraft.util.ChatComponentTranslation;
|
||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
import net.minecraftforge.server.ForgeTimeTracker;
|
import net.minecraftforge.server.ForgeTimeTracker;
|
||||||
|
|
|
@ -141,12 +141,12 @@ public net.minecraft.client.renderer.block.model.ModelBlock field_178322_i # amb
|
||||||
# EnumFacing
|
# EnumFacing
|
||||||
public net.minecraft.util.EnumFacing field_82609_l # VALUES
|
public net.minecraft.util.EnumFacing field_82609_l # VALUES
|
||||||
public net.minecraft.util.EnumFacing field_176754_o # HORIZONTALS
|
public net.minecraft.util.EnumFacing field_176754_o # HORIZONTALS
|
||||||
#public net.minecraft.client.renderer.WorldRenderer func_78909_a(I)I # getColorIndex
|
#public net.minecraft.client.renderer.VertexBuffer func_78909_a(I)I # getColorIndex
|
||||||
#public net.minecraft.client.renderer.WorldRenderer func_178972_a(IIIII)V # putColorRGBA
|
#public net.minecraft.client.renderer.VertexBuffer func_178972_a(IIIII)V # putColorRGBA
|
||||||
# ModelBlock Constructor
|
# ModelBlock Constructor
|
||||||
#public net.minecraft.client.renderer.block.model.ModelBlock <init>(Lnet/minecraft/util/ResourceLocation;Ljava/util/List;Ljava/util/Map;ZZLnet/minecraft/client/renderer/block/model/ItemCameraTransforms;)V
|
#public net.minecraft.client.renderer.block.model.ModelBlock <init>(Lnet/minecraft/util/ResourceLocation;Ljava/util/List;Ljava/util/Map;ZZLnet/minecraft/client/renderer/block/model/ItemCameraTransforms;)V
|
||||||
# RenderLivingEntity
|
# RenderLivingEntity
|
||||||
#public net.minecraft.client.renderer.entity.RendererLivingEntity func_177094_a(Lnet/minecraft/client/renderer/entity/layers/LayerRenderer;)Z # addLayer
|
#public net.minecraft.client.renderer.entity.RenderLivingBase func_177094_a(Lnet/minecraft/client/renderer/entity/layers/LayerRenderer;)Z # addLayer
|
||||||
|
|
||||||
# S00PacketServerInfo
|
# S00PacketServerInfo
|
||||||
#public net.minecraft.network.status.server.S00PacketServerInfo field_149297_a # GSON
|
#public net.minecraft.network.status.server.S00PacketServerInfo field_149297_a # GSON
|
||||||
|
|
|
@ -4,8 +4,8 @@ import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||||
import net.minecraft.client.resources.model.ModelBakery;
|
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
|
@ -14,10 +14,10 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.network.NetworkManager;
|
import net.minecraft.network.NetworkManager;
|
||||||
import net.minecraft.network.Packet;
|
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.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.text.TextComponentString;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -212,7 +212,7 @@ public class DynBucketTest
|
||||||
IFluidHandler tank = (IFluidHandler) te;
|
IFluidHandler tank = (IFluidHandler) te;
|
||||||
side = side.getOpposite();
|
side = side.getOpposite();
|
||||||
|
|
||||||
ItemStack stack = playerIn.getHeldItem();
|
ItemStack stack = playerIn.inventory.getCurrentItem();
|
||||||
if (stack == null)
|
if (stack == null)
|
||||||
{
|
{
|
||||||
sendText(playerIn, tank, side);
|
sendText(playerIn, tank, side);
|
||||||
|
@ -245,7 +245,7 @@ public class DynBucketTest
|
||||||
{
|
{
|
||||||
text = "empty";
|
text = "empty";
|
||||||
}
|
}
|
||||||
player.addChatMessage(new ChatComponentText(text));
|
player.addChatMessage(new TextComponentString(text));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -318,11 +318,11 @@ public class DynBucketTest
|
||||||
public Packet getDescriptionPacket() {
|
public Packet getDescriptionPacket() {
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
writeToNBT(tag);
|
writeToNBT(tag);
|
||||||
return new S35PacketUpdateTileEntity(this.getPos(), this.getBlockMetadata(), tag);
|
return new SPacketUpdateTileEntity(this.getPos(), this.getBlockMetadata(), tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
|
||||||
super.onDataPacket(net, pkt);
|
super.onDataPacket(net, pkt);
|
||||||
readFromNBT(pkt.getNbtCompound());
|
readFromNBT(pkt.getNbtCompound());
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,11 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockWall;
|
import net.minecraft.block.BlockWall;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
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.block.state.IBlockState;
|
||||||
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
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.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
|
@ -102,8 +102,8 @@ public class ForgeBlockStatesLoaderDebug {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockState createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockState(this, VARIANT);
|
return new BlockStateContainer(this, VARIANT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package net.minecraftforge.debug;
|
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.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
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.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
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.block.model.ItemCameraTransforms;
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.util.EnumFacing;
|
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.event.ModelBakeEvent;
|
||||||
import net.minecraftforge.client.model.IFlexibleBakedModel;
|
import net.minecraftforge.client.model.IFlexibleBakedModel;
|
||||||
import net.minecraftforge.client.model.ISmartBlockModel;
|
import net.minecraftforge.client.model.ISmartBlockModel;
|
||||||
|
@ -133,9 +133,9 @@ public class LayerBreakingTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
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;
|
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.RenderLiving;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
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.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -20,7 +20,7 @@ import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
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.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.IBlockAccess;
|
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.IProperty;
|
||||||
import net.minecraft.block.properties.PropertyInteger;
|
import net.minecraft.block.properties.PropertyInteger;
|
||||||
import net.minecraft.block.state.BlockState;
|
import net.minecraft.block.state.BlockState;
|
||||||
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
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.EnumFacing;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
@ -158,7 +160,7 @@ public class ModelBakeEventDebug
|
||||||
if(te instanceof CustomTileEntity)
|
if(te instanceof CustomTileEntity)
|
||||||
{
|
{
|
||||||
CustomTileEntity cte = (CustomTileEntity) te;
|
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()];
|
IUnlistedProperty<Integer> property = properties[side.ordinal()];
|
||||||
Integer value = cte.getState().getValue(property);
|
Integer value = cte.getState().getValue(property);
|
||||||
if(value == null) value = 0;
|
if(value == null) value = 0;
|
||||||
|
@ -182,7 +184,7 @@ public class ModelBakeEventDebug
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockState createBlockState()
|
protected BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState(this, new IProperty[0], properties);
|
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)
|
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);
|
Vec3d v1 = rotate(new Vec3d(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);
|
Vec3d v2 = rotate(new Vec3d(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);
|
Vec3d v3 = rotate(new Vec3d(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 v4 = rotate(new Vec3d(x2 - .5, y - .5, z1 - .5), side).addVector(.5, .5, .5);
|
||||||
return new BakedQuad(Ints.concat(
|
return new BakedQuad(Ints.concat(
|
||||||
vertexToInts((float)v1.xCoord, (float)v1.yCoord, (float)v1.zCoord, -1, texture, 0, 0),
|
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),
|
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)
|
switch(side)
|
||||||
{
|
{
|
||||||
case DOWN: return new Vec3( vec.xCoord, -vec.yCoord, -vec.zCoord);
|
case DOWN: return new Vec3d( vec.xCoord, -vec.yCoord, -vec.zCoord);
|
||||||
case UP: return new Vec3( vec.xCoord, vec.yCoord, vec.zCoord);
|
case UP: return new Vec3d( vec.xCoord, vec.yCoord, vec.zCoord);
|
||||||
case NORTH: return new Vec3( vec.xCoord, vec.zCoord, -vec.yCoord);
|
case NORTH: return new Vec3d( vec.xCoord, vec.zCoord, -vec.yCoord);
|
||||||
case SOUTH: return new Vec3( vec.xCoord, -vec.zCoord, vec.yCoord);
|
case SOUTH: return new Vec3d( vec.xCoord, -vec.zCoord, vec.yCoord);
|
||||||
case WEST: return new Vec3(-vec.yCoord, vec.xCoord, vec.zCoord);
|
case WEST: return new Vec3d(-vec.yCoord, vec.xCoord, vec.zCoord);
|
||||||
case EAST: return new Vec3( vec.yCoord, -vec.xCoord, vec.zCoord);
|
case EAST: return new Vec3d( vec.yCoord, -vec.xCoord, vec.zCoord);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Vec3 revRotate(Vec3 vec, EnumFacing side)
|
private static Vec3d revRotate(Vec3d vec, EnumFacing side)
|
||||||
{
|
{
|
||||||
switch(side)
|
switch(side)
|
||||||
{
|
{
|
||||||
case DOWN: return new Vec3( vec.xCoord, -vec.yCoord, -vec.zCoord);
|
case DOWN: return new Vec3d( vec.xCoord, -vec.yCoord, -vec.zCoord);
|
||||||
case UP: return new Vec3( vec.xCoord, vec.yCoord, vec.zCoord);
|
case UP: return new Vec3d( vec.xCoord, vec.yCoord, vec.zCoord);
|
||||||
case NORTH: return new Vec3( vec.xCoord, -vec.zCoord, vec.yCoord);
|
case NORTH: return new Vec3d( vec.xCoord, -vec.zCoord, vec.yCoord);
|
||||||
case SOUTH: return new Vec3( vec.xCoord, vec.zCoord, -vec.yCoord);
|
case SOUTH: return new Vec3d( vec.xCoord, vec.zCoord, -vec.yCoord);
|
||||||
case WEST: return new Vec3( vec.yCoord, -vec.xCoord, vec.zCoord);
|
case WEST: return new Vec3d( vec.yCoord, -vec.xCoord, vec.zCoord);
|
||||||
case EAST: return new Vec3(-vec.yCoord, vec.xCoord, vec.zCoord);
|
case EAST: return new Vec3d(-vec.yCoord, vec.xCoord, vec.zCoord);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||||
import net.minecraft.client.resources.model.ModelBakery;
|
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
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.IProperty;
|
||||||
import net.minecraft.block.properties.PropertyBool;
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
import net.minecraft.block.properties.PropertyDirection;
|
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.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.text.TextComponentString;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ITickable;
|
import net.minecraft.util.ITickable;
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -86,26 +86,26 @@ public class ModelLoaderRegistryDebug
|
||||||
B3DLoader.instance.addDomain(MODID.toLowerCase());
|
B3DLoader.instance.addDomain(MODID.toLowerCase());
|
||||||
Item item = Item.getItemFromBlock(CustomModelBlock.instance);
|
Item item = Item.getItemFromBlock(CustomModelBlock.instance);
|
||||||
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + CustomModelBlock.name, "inventory"));
|
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + CustomModelBlock.name, "inventory"));
|
||||||
|
|
||||||
OBJLoader.instance.addDomain(MODID.toLowerCase());
|
OBJLoader.instance.addDomain(MODID.toLowerCase());
|
||||||
Item item2 = Item.getItemFromBlock(OBJTesseractBlock.instance);
|
Item item2 = Item.getItemFromBlock(OBJTesseractBlock.instance);
|
||||||
ModelLoader.setCustomModelResourceLocation(item2, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJTesseractBlock.name, "inventory"));
|
ModelLoader.setCustomModelResourceLocation(item2, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJTesseractBlock.name, "inventory"));
|
||||||
|
|
||||||
Item item3 = Item.getItemFromBlock(OBJVertexColoring1.instance);
|
Item item3 = Item.getItemFromBlock(OBJVertexColoring1.instance);
|
||||||
ModelLoader.setCustomModelResourceLocation(item3, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJVertexColoring1.name, "inventory"));
|
ModelLoader.setCustomModelResourceLocation(item3, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJVertexColoring1.name, "inventory"));
|
||||||
|
|
||||||
Item item4 = Item.getItemFromBlock(OBJDirectionEye.instance);
|
Item item4 = Item.getItemFromBlock(OBJDirectionEye.instance);
|
||||||
ModelLoader.setCustomModelResourceLocation(item4, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJDirectionEye.name, "inventory"));
|
ModelLoader.setCustomModelResourceLocation(item4, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJDirectionEye.name, "inventory"));
|
||||||
|
|
||||||
Item item5 = Item.getItemFromBlock(OBJVertexColoring2.instance);
|
Item item5 = Item.getItemFromBlock(OBJVertexColoring2.instance);
|
||||||
ModelLoader.setCustomModelResourceLocation(item5, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJVertexColoring2.name, "inventory"));
|
ModelLoader.setCustomModelResourceLocation(item5, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJVertexColoring2.name, "inventory"));
|
||||||
|
|
||||||
Item item6 = Item.getItemFromBlock(OBJDirectionBlock.instance);
|
Item item6 = Item.getItemFromBlock(OBJDirectionBlock.instance);
|
||||||
ModelLoader.setCustomModelResourceLocation(item6, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJDirectionBlock.name, "inventory"));
|
ModelLoader.setCustomModelResourceLocation(item6, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJDirectionBlock.name, "inventory"));
|
||||||
|
|
||||||
Item item7 = Item.getItemFromBlock(OBJCustomDataBlock.instance);
|
Item item7 = Item.getItemFromBlock(OBJCustomDataBlock.instance);
|
||||||
ModelLoader.setCustomModelResourceLocation(item7, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJCustomDataBlock.name, "inventory"));
|
ModelLoader.setCustomModelResourceLocation(item7, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJCustomDataBlock.name, "inventory"));
|
||||||
|
|
||||||
Item item8 = Item.getItemFromBlock(OBJDynamicEye.instance);
|
Item item8 = Item.getItemFromBlock(OBJDynamicEye.instance);
|
||||||
ModelLoader.setCustomModelResourceLocation(item8, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJDynamicEye.name, "inventory"));
|
ModelLoader.setCustomModelResourceLocation(item8, 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + OBJDynamicEye.name, "inventory"));
|
||||||
}
|
}
|
||||||
|
@ -127,10 +127,10 @@ public class ModelLoaderRegistryDebug
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube() { return false; }
|
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFullCube() { return false; }
|
public boolean isFullCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isVisuallyOpaque() { return false; }
|
public boolean isVisuallyOpaque() { return false; }
|
||||||
|
@ -140,19 +140,19 @@ public class ModelLoaderRegistryDebug
|
||||||
{
|
{
|
||||||
return this.getDefaultState().withProperty(FACING, getFacingFromEntity(world, pos, placer));
|
return this.getDefaultState().withProperty(FACING, getFacingFromEntity(world, pos, placer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta)
|
public IBlockState getStateFromMeta(int meta)
|
||||||
{
|
{
|
||||||
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetaFromState(IBlockState state)
|
public int getMetaFromState(IBlockState state)
|
||||||
{
|
{
|
||||||
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||||
{
|
{
|
||||||
|
@ -174,13 +174,13 @@ public class ModelLoaderRegistryDebug
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState createBlockState()
|
public BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{B3DLoader.B3DFrameProperty.instance});
|
return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{B3DLoader.B3DFrameProperty.instance});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn)
|
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)
|
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 OBJTesseractBlock instance = new OBJTesseractBlock();
|
||||||
public static final String name = "OBJTesseractBlock";
|
public static final String name = "OBJTesseractBlock";
|
||||||
private ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
private ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
||||||
|
|
||||||
private OBJTesseractBlock()
|
private OBJTesseractBlock()
|
||||||
{
|
{
|
||||||
super(Material.iron);
|
super(Material.iron);
|
||||||
setCreativeTab(CreativeTabs.tabBlock);
|
setCreativeTab(CreativeTabs.tabBlock);
|
||||||
setUnlocalizedName(MODID + ":" + name);
|
setUnlocalizedName(MODID + ":" + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||||
{
|
{
|
||||||
return new OBJTesseractTileEntity();
|
return new OBJTesseractTileEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube() { return false; }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFullCube() { return false; }
|
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFullCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isVisuallyOpaque() { return false; }
|
public boolean isVisuallyOpaque() { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
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);
|
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);
|
return ((IExtendedBlockState) this.state.getBaseState()).withProperty(OBJModel.OBJProperty.instance, retState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
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();
|
model = ModelLoaderRegistry.getMissingModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isSneaking())
|
if (player.isSneaking())
|
||||||
{
|
{
|
||||||
tileEntity.decrement();
|
tileEntity.decrement();
|
||||||
|
@ -275,7 +275,7 @@ public class ModelLoaderRegistryDebug
|
||||||
tileEntity.increment();
|
tileEntity.increment();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
OBJBakedModel objBaked = (OBJBakedModel) Minecraft.getMinecraft().getBlockRendererDispatcher().getModelFromBlockState(state, world, pos);
|
OBJBakedModel objBaked = (OBJBakedModel) Minecraft.getMinecraft().getBlockRendererDispatcher().getModelFromBlockState(state, world, pos);
|
||||||
|
@ -284,25 +284,25 @@ public class ModelLoaderRegistryDebug
|
||||||
world.markBlockRangeForRenderUpdate(pos, pos);
|
world.markBlockRangeForRenderUpdate(pos, pos);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasTileEntity(IBlockState state)
|
public boolean hasTileEntity(IBlockState state)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class OBJTesseractTileEntity extends TileEntity
|
public static class OBJTesseractTileEntity extends TileEntity
|
||||||
{
|
{
|
||||||
private int counter = 1;
|
private int counter = 1;
|
||||||
private int max = 2;
|
private int max = 2;
|
||||||
public List<String> visible = new ArrayList<String>();
|
public List<String> visible = new ArrayList<String>();
|
||||||
|
|
||||||
public OBJTesseractTileEntity()
|
public OBJTesseractTileEntity()
|
||||||
{
|
{
|
||||||
this.visible.add(OBJModel.Group.ALL);
|
this.visible.add(OBJModel.Group.ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void increment()
|
public void increment()
|
||||||
{
|
{
|
||||||
if (this.visible.contains(OBJModel.Group.ALL)) this.visible.remove(OBJModel.Group.ALL);
|
if (this.visible.contains(OBJModel.Group.ALL)) this.visible.remove(OBJModel.Group.ALL);
|
||||||
|
@ -313,10 +313,10 @@ public class ModelLoaderRegistryDebug
|
||||||
}
|
}
|
||||||
this.counter++;
|
this.counter++;
|
||||||
this.visible.add(Integer.toString(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);
|
if (this.worldObj.isRemote) Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void decrement()
|
public void decrement()
|
||||||
{
|
{
|
||||||
if (this.visible.contains(OBJModel.Group.ALL)) this.visible.remove(OBJModel.Group.ALL);
|
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.visible.remove(Integer.toString(this.counter));
|
||||||
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);
|
if (this.worldObj.isRemote) Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset()
|
public void reset()
|
||||||
{
|
{
|
||||||
this.counter = 1;
|
this.counter = 1;
|
||||||
|
@ -338,25 +338,25 @@ public class ModelLoaderRegistryDebug
|
||||||
this.visible.clear();
|
this.visible.clear();
|
||||||
this.visible.add(Integer.toString(this.counter));
|
this.visible.add(Integer.toString(this.counter));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMax()
|
public int getMax()
|
||||||
{
|
{
|
||||||
return this.max;
|
return this.max;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMax(int max)
|
public void setMax(int max)
|
||||||
{
|
{
|
||||||
this.max = max;
|
this.max = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setToMax()
|
public void setToMax()
|
||||||
{
|
{
|
||||||
this.counter = this.max;
|
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
|
* of the OBJ loader. See 'vertex_coloring.obj' and 'vertex_coloring.mtl' in
|
||||||
* 'test/resources/assets/forgedebugmodelloaderregistry/models/block/', to properly
|
* 'test/resources/assets/forgedebugmodelloaderregistry/models/block/', to properly
|
||||||
* utilize this feature an obj file must have 1 'usemtl' key before every vertex as shown,
|
* 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 OBJVertexColoring1 instance = new OBJVertexColoring1();
|
||||||
public static final String name = "OBJVertexColoring1";
|
public static final String name = "OBJVertexColoring1";
|
||||||
|
|
||||||
private OBJVertexColoring1()
|
private OBJVertexColoring1()
|
||||||
{
|
{
|
||||||
super(Material.iron);
|
super(Material.iron);
|
||||||
setCreativeTab(CreativeTabs.tabBlock);
|
setCreativeTab(CreativeTabs.tabBlock);
|
||||||
setUnlocalizedName(name);
|
setUnlocalizedName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube() { return false; }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFullCube() { return false; }
|
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFullCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isVisuallyOpaque() { return false; }
|
public boolean isVisuallyOpaque() { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This block demonstrates how to use IProperties and IUnlistedProperties together
|
* This block demonstrates how to use IProperties and IUnlistedProperties together
|
||||||
* in the same ExtendedBlockState. Similar to pistons, this block will face the player
|
* 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.
|
* the OBJ loader can load spheres.
|
||||||
* @author shadekiller666
|
* @author shadekiller666
|
||||||
*
|
*
|
||||||
|
@ -401,7 +401,7 @@ public class ModelLoaderRegistryDebug
|
||||||
public static final OBJDirectionEye instance = new OBJDirectionEye();
|
public static final OBJDirectionEye instance = new OBJDirectionEye();
|
||||||
public static final String name = "OBJDirectionEye";
|
public static final String name = "OBJDirectionEye";
|
||||||
private ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[] {FACING}, new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
private ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[] {FACING}, new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
||||||
|
|
||||||
private OBJDirectionEye()
|
private OBJDirectionEye()
|
||||||
{
|
{
|
||||||
super(Material.iron);
|
super(Material.iron);
|
||||||
|
@ -409,47 +409,47 @@ public class ModelLoaderRegistryDebug
|
||||||
setCreativeTab(CreativeTabs.tabBlock);
|
setCreativeTab(CreativeTabs.tabBlock);
|
||||||
setUnlocalizedName(name);
|
setUnlocalizedName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
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));
|
return this.getDefaultState().withProperty(FACING, getFacingFromEntity(world, pos, placer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta)
|
public IBlockState getStateFromMeta(int meta)
|
||||||
{
|
{
|
||||||
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetaFromState(IBlockState state)
|
public int getMetaFromState(IBlockState state)
|
||||||
{
|
{
|
||||||
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IBlockState getStateForEntityRender(IBlockState state)
|
public IBlockState getStateForEntityRender(IBlockState state)
|
||||||
{
|
{
|
||||||
return this.getDefaultState().withProperty(FACING, EnumFacing.NORTH);
|
return this.getDefaultState().withProperty(FACING, EnumFacing.NORTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState createBlockState()
|
public BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState(this, new IProperty[] {FACING}, new IUnlistedProperty[] {OBJModel.OBJProperty.instance});
|
return new ExtendedBlockState(this, new IProperty[] {FACING}, new IUnlistedProperty[] {OBJModel.OBJProperty.instance});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube() { return false; }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFullCube() { return false; }
|
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFullCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isVisuallyOpaque() { return false; }
|
public boolean isVisuallyOpaque() { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
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);
|
OBJModel.OBJState retState = new OBJModel.OBJState(Arrays.asList(new String[]{OBJModel.Group.ALL}), true, transform);
|
||||||
return ((IExtendedBlockState) state).withProperty(OBJModel.OBJProperty.instance, retState);
|
return ((IExtendedBlockState) state).withProperty(OBJModel.OBJProperty.instance, retState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn)
|
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)
|
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();
|
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
|
* 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.
|
* and then back to the original color when right clicking on the block.
|
||||||
* @author shadekiller666
|
* @author shadekiller666
|
||||||
|
@ -489,22 +489,22 @@ public class ModelLoaderRegistryDebug
|
||||||
*/
|
*/
|
||||||
public static class OBJVertexColoring2 extends Block implements ITileEntityProvider
|
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";
|
public static final String name = "OBJVertexColoring2";
|
||||||
|
|
||||||
private OBJVertexColoring2()
|
private OBJVertexColoring2()
|
||||||
{
|
{
|
||||||
super(Material.iron);
|
super(Material.iron);
|
||||||
setCreativeTab(CreativeTabs.tabBlock);
|
setCreativeTab(CreativeTabs.tabBlock);
|
||||||
setUnlocalizedName(name);
|
setUnlocalizedName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||||
{
|
{
|
||||||
return new OBJVertexColoring2TileEntity();
|
return new OBJVertexColoring2TileEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class OBJVertexColoring2TileEntity extends TileEntity
|
public static class OBJVertexColoring2TileEntity extends TileEntity
|
||||||
{
|
{
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
|
@ -523,9 +523,9 @@ public class ModelLoaderRegistryDebug
|
||||||
private List<Vector4f> colorList = new ArrayList<Vector4f>();
|
private List<Vector4f> colorList = new ArrayList<Vector4f>();
|
||||||
private boolean hasFilledList = false;
|
private boolean hasFilledList = false;
|
||||||
private boolean shouldIncrement = true;
|
private boolean shouldIncrement = true;
|
||||||
|
|
||||||
public OBJVertexColoring2TileEntity() {}
|
public OBJVertexColoring2TileEntity() {}
|
||||||
|
|
||||||
public void cycleColors()
|
public void cycleColors()
|
||||||
{
|
{
|
||||||
if (this.worldObj.isRemote)
|
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.
|
* This block is a debug block that faces the player when placed, like a piston.
|
||||||
* @author shadekiller666
|
* @author shadekiller666
|
||||||
|
@ -589,7 +589,7 @@ public class ModelLoaderRegistryDebug
|
||||||
public static final OBJDirectionBlock instance = new OBJDirectionBlock();
|
public static final OBJDirectionBlock instance = new OBJDirectionBlock();
|
||||||
public static final String name = "OBJDirectionBlock";
|
public static final String name = "OBJDirectionBlock";
|
||||||
public ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
public ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
||||||
|
|
||||||
private OBJDirectionBlock()
|
private OBJDirectionBlock()
|
||||||
{
|
{
|
||||||
super(Material.iron);
|
super(Material.iron);
|
||||||
|
@ -597,34 +597,34 @@ public class ModelLoaderRegistryDebug
|
||||||
setCreativeTab(CreativeTabs.tabBlock);
|
setCreativeTab(CreativeTabs.tabBlock);
|
||||||
setUnlocalizedName(MODID + ":" + name);
|
setUnlocalizedName(MODID + ":" + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube() { return false; }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFullCube() { return false; }
|
public boolean isOpaqueCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isFullCube(IBlockState state) { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isVisuallyOpaque() { return false; }
|
public boolean isVisuallyOpaque() { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
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));
|
return this.getDefaultState().withProperty(FACING, getFacingFromEntity(world, pos, placer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta)
|
public IBlockState getStateFromMeta(int meta)
|
||||||
{
|
{
|
||||||
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetaFromState(IBlockState state)
|
public int getMetaFromState(IBlockState state)
|
||||||
{
|
{
|
||||||
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
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);
|
OBJModel.OBJState newState = new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true, transform);
|
||||||
return ((IExtendedBlockState) state).withProperty(OBJModel.OBJProperty.instance, newState);
|
return ((IExtendedBlockState) state).withProperty(OBJModel.OBJProperty.instance, newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState createBlockState()
|
public BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{OBJModel.OBJProperty.instance});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn)
|
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)
|
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();
|
return entityIn.getHorizontalFacing().getOpposite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This block is a testing block that will be used to test the use
|
* 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.
|
* 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 PropertyBool EAST = PropertyBool.create("east");
|
||||||
public static final OBJCustomDataBlock instance = new OBJCustomDataBlock();
|
public static final OBJCustomDataBlock instance = new OBJCustomDataBlock();
|
||||||
public static final String name = "OBJCustomDataBlock";
|
public static final String name = "OBJCustomDataBlock";
|
||||||
|
|
||||||
private OBJCustomDataBlock()
|
private OBJCustomDataBlock()
|
||||||
{
|
{
|
||||||
super(Material.iron);
|
super(Material.iron);
|
||||||
|
@ -684,44 +684,44 @@ public class ModelLoaderRegistryDebug
|
||||||
setCreativeTab(CreativeTabs.tabBlock);
|
setCreativeTab(CreativeTabs.tabBlock);
|
||||||
setUnlocalizedName(MODID + ":" + name);
|
setUnlocalizedName(MODID + ":" + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube()
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFullCube()
|
public boolean isFullCube(IBlockState state)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetaFromState(IBlockState state)
|
public int getMetaFromState(IBlockState state)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canConnectTo(IBlockAccess world, BlockPos pos)
|
public boolean canConnectTo(IBlockAccess world, BlockPos pos)
|
||||||
{
|
{
|
||||||
Block block = world.getBlockState(pos).getBlock();
|
Block block = world.getBlockState(pos).getBlock();
|
||||||
return block instanceof OBJCustomDataBlock;
|
return block instanceof OBJCustomDataBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
|
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()));
|
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
|
@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
|
* 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?
|
* player when placed, this one ALWAYS faces the player. I know, creepy right?
|
||||||
|
@ -739,31 +739,31 @@ public class ModelLoaderRegistryDebug
|
||||||
setCreativeTab(CreativeTabs.tabBlock);
|
setCreativeTab(CreativeTabs.tabBlock);
|
||||||
setUnlocalizedName(MODID + ":" + name);
|
setUnlocalizedName(MODID + ":" + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||||
{
|
{
|
||||||
return new OBJDynamicEyeTileEntity();
|
return new OBJDynamicEyeTileEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube()
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFullCube()
|
public boolean isFullCube(IBlockState state)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasTileEntity(IBlockState state)
|
public boolean hasTileEntity(IBlockState state)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||||
{
|
{
|
||||||
|
@ -777,23 +777,23 @@ public class ModelLoaderRegistryDebug
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState createBlockState()
|
public BlockStateContainer createBlockState()
|
||||||
{
|
{
|
||||||
return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {OBJModel.OBJProperty.instance});
|
return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {OBJModel.OBJProperty.instance});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class OBJDynamicEyeTileEntity extends TileEntity implements ITickable
|
public static class OBJDynamicEyeTileEntity extends TileEntity implements ITickable
|
||||||
{
|
{
|
||||||
public OBJModel.OBJState state;
|
public OBJModel.OBJState state;
|
||||||
|
|
||||||
public OBJDynamicEyeTileEntity()
|
public OBJDynamicEyeTileEntity()
|
||||||
{
|
{
|
||||||
this.state = new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true);
|
this.state = new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update()
|
public void update()
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,10 +2,10 @@ package net.minecraftforge.debug;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
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.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.util.EnumWorldBlockLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||||
|
@ -42,9 +42,9 @@ public class MultiLayerModelDebug
|
||||||
public boolean isFullCube() { return false; }
|
public boolean isFullCube() { return false; }
|
||||||
|
|
||||||
@Override
|
@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);
|
}, blockName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,13 +69,13 @@ public class PotionRegistryDebug {
|
||||||
int height = width;
|
int height = width;
|
||||||
/*
|
/*
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
VertexBuffer VertexBuffer = tessellator.getVertexBuffer();
|
||||||
worldrenderer.startDrawingQuads();
|
VertexBuffer.startDrawingQuads();
|
||||||
worldrenderer.setColorOpaque_I(potion.getLiquidColor());
|
VertexBuffer.setColorOpaque_I(potion.getLiquidColor());
|
||||||
worldrenderer.addVertexWithUV((double) x, (double) (y + height), 0.0D, sprite.getMinU(), sprite.getMaxV());
|
VertexBuffer.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());
|
VertexBuffer.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());
|
VertexBuffer.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.addVertexWithUV((double)x, (double)y, 0.0D, sprite.getMinU(), sprite.getMinV());
|
||||||
tessellator.draw();*/
|
tessellator.draw();*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,9 @@ import java.util.List;
|
||||||
import net.minecraft.command.CommandBase;
|
import net.minecraft.command.CommandBase;
|
||||||
import net.minecraft.command.CommandException;
|
import net.minecraft.command.CommandException;
|
||||||
import net.minecraft.command.ICommandSender;
|
import net.minecraft.command.ICommandSender;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.text.TextComponentString;
|
||||||
import net.minecraftforge.client.ClientCommandHandler;
|
import net.minecraftforge.client.ClientCommandHandler;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||||
|
@ -53,15 +54,15 @@ public class ClientCommandTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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)
|
if (args.length > 0)
|
||||||
{
|
{
|
||||||
sender.addChatMessage(new ChatComponentText("Input: " + Arrays.toString(args)));
|
sender.addChatMessage(new TextComponentString("Input: " + Arrays.toString(args)));
|
||||||
}
|
}
|
||||||
else
|
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.init.Items;
|
||||||
import net.minecraft.nbt.NBTBase;
|
import net.minecraft.nbt.NBTBase;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.text.TextComponentString;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
@ -45,8 +45,8 @@ public class TestCapabilityMod
|
||||||
public void onInteract(PlayerInteractEvent event)
|
public void onInteract(PlayerInteractEvent event)
|
||||||
{
|
{
|
||||||
if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
|
if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
|
||||||
if (event.entityPlayer.getHeldItem() == null) return;
|
if (event.entityPlayer.inventory.getCurrentItem() == null) return;
|
||||||
if (event.entityPlayer.getHeldItem().getItem() != Items.stick) 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
|
// 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);
|
TileEntity te = event.world.getTileEntity(event.pos);
|
||||||
|
@ -58,7 +58,7 @@ public class TestCapabilityMod
|
||||||
}
|
}
|
||||||
if (event.world.getBlockState(event.pos).getBlock() == Blocks.dirt)
|
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);
|
event.setCanceled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package net.minecraftforge.test;
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
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.Entity;
|
||||||
import net.minecraft.entity.item.EntityArmorStand;
|
import net.minecraft.entity.item.EntityArmorStand;
|
||||||
import net.minecraft.util.ResourceLocation;
|
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");
|
private static final ResourceLocation TEXTURE = new ResourceLocation("textures/blocks/stone.png");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue