Updated FML:

MinecraftForge/FML@03fb1879d7 Fix obf error when right clicking a Empty Map.
MinecraftForge/FML@6bb9b8b953 Clean up FMLEventChannel. Closes #367.
MinecraftForge/FML@b7b3450dcd Update MCP mapping snapshot to latest crowdsourced names.
MinecraftForge/FML@8c9e8b5270 Fix isRemote, this is integral to so many parts of the code, everyone knows it by this name, People should not change it.
This commit is contained in:
Lex Manos committed 2014-02-05 01:14:24 -08:00
1 parent 9d919f8ac9
commit e68577ffd3
188 files changed
+1869 -1870

No files matched your search

-1
View File
@@ -1,7 +1,6 @@
package ibxm;
@SuppressWarnings("unused")
public class Channel {
public int pattern_loop_row;
-1
View File
@@ -10,7 +10,6 @@ public class Envelope {
set_num_points( 1 );
}
@SuppressWarnings("unused")
public void set_num_points( int num_points ) {
int point;
if( num_points <= 0 ) {
-1
View File
@@ -69,7 +69,6 @@ public class FastTracker2 {
return module;
}
@SuppressWarnings("unused")
private static Pattern read_xm_pattern( DataInput data_input, int num_channels ) throws IOException {
int pattern_header_length, packing_type, num_rows, pattern_data_length;
byte[] structure_header, pattern_header, pattern_data;
-1
View File
@@ -85,7 +85,6 @@ public class IBXM {
clear_vol_ramp_buffer();
}
@SuppressWarnings("unused")
public void seek( int sample_position ) {
int idx;
set_sequence_index( 0, 0 );
-1
View File
@@ -57,7 +57,6 @@ public class ScreamTracker3 {
return s3m_identifier.equals( "SCRM" );
}
@SuppressWarnings("unused")
public static Module load_s3m( byte[] header_96_bytes, DataInput data_input ) throws IOException {
int num_pattern_orders, num_instruments, num_patterns, num_channels;
int flags, tracker_version, master_volume, panning, channel_config, sequence_length;
@@ -74,20 +74,20 @@ public class ClientCommandHandler extends CommandHandler
}
else
{
sender.func_145747_a(format(RED, "commands.generic.permission"));
sender.addChatMessage(format(RED, "commands.generic.permission"));
}
}
catch (WrongUsageException wue)
{
sender.func_145747_a(format(RED, "commands.generic.usage", format(RED, wue.getMessage(), wue.getErrorOjbects())));
sender.addChatMessage(format(RED, "commands.generic.usage", format(RED, wue.getMessage(), wue.getErrorOjbects())));
}
catch (CommandException ce)
{
sender.func_145747_a(format(RED, ce.getMessage(), ce.getErrorOjbects()));
sender.addChatMessage(format(RED, ce.getMessage(), ce.getErrorOjbects()));
}
catch (Throwable t)
{
sender.func_145747_a(format(RED, "commands.generic.exception"));
sender.addChatMessage(format(RED, "commands.generic.exception"));
t.printStackTrace();
}
@@ -98,7 +98,7 @@ public class ClientCommandHandler extends CommandHandler
private ChatComponentTranslation format(EnumChatFormatting color, String str, Object... args)
{
ChatComponentTranslation ret = new ChatComponentTranslation(str, args);
ret.func_150256_b().func_150238_a(color);
ret.getChatStyle().setColor(color);
return ret;
}
@@ -90,12 +90,12 @@ public class ForgeHooksClient
boolean is3D = customRenderer.shouldUseRenderHelper(ENTITY, item, BLOCK_3D);
engine.bindTexture(item.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
Block block = item.getItem() instanceof ItemBlock ? Block.func_149634_a(item.getItem()) : null;
if (is3D || (block != null && RenderBlocks.func_147739_a(block.func_149645_b())))
Block block = item.getItem() instanceof ItemBlock ? Block.getBlockFromItem(item.getItem()) : null;
if (is3D || (block != null && RenderBlocks.renderItemIn3d(block.getRenderType())))
{
int renderType = (block != null ? block.func_149645_b() : 1);
int renderType = (block != null ? block.getRenderType() : 1);
float scale = (renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2 ? 0.5F : 0.25F);
boolean blend = block != null && block.func_149701_w() > 0;
boolean blend = block != null && block.getRenderBlockPass() > 0;
if (RenderItem.renderInFrame)
{
@@ -108,7 +108,7 @@ public class ForgeHooksClient
{
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.func_148821_a(770, 771, 1, 0);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
}
GL11.glScalef(scale, scale, scale);
@@ -169,9 +169,9 @@ public class ForgeHooksClient
}
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
renderBlocks.field_147844_c = inColor;
renderBlocks.useInventoryTint = inColor;
customRenderer.renderItem(INVENTORY, item, renderBlocks);
renderBlocks.field_147844_c = true;
renderBlocks.useInventoryTint = true;
GL11.glPopMatrix();
}
else
@@ -233,7 +233,7 @@ public class ForgeHooksClient
int x = MathHelper.floor_double(entity.posX);
int y = MathHelper.floor_double(entity.posY);
int z = MathHelper.floor_double(entity.posZ);
Block block = mc.theWorld.func_147439_a(x, y, z);
Block block = mc.theWorld.getBlock(x, y, z);
if (block != null && block.isBed(mc.theWorld, x, y, z, entity))
{
@@ -260,8 +260,8 @@ public class ForgeHooksClient
{
MinecraftForge.EVENT_BUS.post(new TextureStitchEvent.Post(map));
FluidRegistry.WATER.setIcons(BlockLiquid.func_149803_e("water_still"), BlockLiquid.func_149803_e("water_flow"));
FluidRegistry.LAVA.setIcons(BlockLiquid.func_149803_e("lava_still"), BlockLiquid.func_149803_e("lava_flow"));
FluidRegistry.WATER.setIcons(BlockLiquid.getLiquidIcon("water_still"), BlockLiquid.getLiquidIcon("water_flow"));
FluidRegistry.LAVA.setIcons(BlockLiquid.getLiquidIcon("lava_still"), BlockLiquid.getLiquidIcon("lava_flow"));
}
/**
@@ -280,7 +280,7 @@ public class ForgeHooksClient
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc.ingameGUI != null)
{
mc.ingameGUI.func_146158_b().func_146227_a(new ChatComponentTranslation("forge.texture.preload.warning", texture));
mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("forge.texture.preload.warning", texture));
}
}
}
@@ -366,9 +366,9 @@ public class ForgeHooksClient
GameSettings settings = Minecraft.getMinecraft().gameSettings;
int[] ranges = ForgeModContainer.blendRanges;
int distance = 0;
if (settings.fancyGraphics && settings.field_151451_c >= 0 && settings.field_151451_c < ranges.length)
if (settings.fancyGraphics && settings.renderDistanceChunks >= 0 && settings.renderDistanceChunks < ranges.length)
{
distance = ranges[settings.field_151451_c];
distance = ranges[settings.renderDistanceChunks];
}
int r = 0;
@@ -381,7 +381,7 @@ public class ForgeHooksClient
for (int z = -distance; z <= distance; ++z)
{
BiomeGenBase biome = world.getBiomeGenForCoords(playerX + x, playerZ + z);
int colour = biome.getSkyColorByTemp(biome.func_150564_a(playerX + x, playerY, playerZ + z));
int colour = biome.getSkyColorByTemp(biome.getFloatTemperature(playerX + x, playerY, playerZ + z));
r += (colour & 0xFF0000) >> 16;
g += (colour & 0x00FF00) >> 8;
b += colour & 0x0000FF;
@@ -111,7 +111,7 @@ public class GuiIngameForge extends GuiIngame
}
else
{
OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
}
if (renderHelmet) renderHelmet(res, partialTicks, hasScreen, mouseX, mouseY);
@@ -162,7 +162,7 @@ public class GuiIngameForge extends GuiIngame
}
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GL11.glDisable(GL11.GL_ALPHA_TEST);
renderChat(width, height);
@@ -217,9 +217,9 @@ public class GuiIngameForge extends GuiIngame
if (pre(CROSSHAIRS)) return;
bind(Gui.icons);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.func_148821_a(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0);
OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0);
drawTexturedModalRect(width / 2 - 7, height / 2 - 7, 0, 0, 16, 16);
OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GL11.glDisable(GL11.GL_BLEND);
post(CROSSHAIRS);
}
@@ -244,7 +244,7 @@ public class GuiIngameForge extends GuiIngame
if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() != null)
{
if (itemstack.getItem() == Item.func_150898_a(Blocks.pumpkin))
if (itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin))
{
renderPumpkinBlur(res.getScaledWidth(), res.getScaledHeight());
}
@@ -312,7 +312,7 @@ public class GuiIngameForge extends GuiIngame
int left = width / 2 + 91;
int top = height - right_height;
if (mc.thePlayer.isInsideOfMaterial(Material.field_151586_h))
if (mc.thePlayer.isInsideOfMaterial(Material.water))
{
int air = mc.thePlayer.getAir();
int full = MathHelper.ceiling_double_int((double)(air - 2) * 10.0D / 300.0D);
@@ -499,7 +499,7 @@ public class GuiIngameForge extends GuiIngame
if (pre(EXPERIENCE)) return;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
if (mc.playerController.func_78763_f())
if (mc.playerController.gameIsSurvivalOrAdventure())
{
mc.mcProfiler.startSection("expBar");
int cap = this.mc.thePlayer.xpBarCap();
@@ -521,7 +521,7 @@ public class GuiIngameForge extends GuiIngame
this.mc.mcProfiler.endSection();
if (mc.playerController.func_78763_f() && mc.thePlayer.experienceLevel > 0)
if (mc.playerController.gameIsSurvivalOrAdventure() && mc.thePlayer.experienceLevel > 0)
{
mc.mcProfiler.startSection("expLevel");
boolean flag1 = false;
@@ -588,7 +588,7 @@ public class GuiIngameForge extends GuiIngame
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
FontRenderer font = highlightingItemStack.getItem().getFontRenderer(highlightingItemStack);
if (font != null)
{
@@ -612,7 +612,7 @@ public class GuiIngameForge extends GuiIngame
protected void renderHUDText(int width, int height)
{
mc.mcProfiler.startSection("forgeHudText");
OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
ArrayList<String> left = new ArrayList<String>();
ArrayList<String> right = new ArrayList<String>();
@@ -621,11 +621,11 @@ public class GuiIngameForge extends GuiIngame
long time = mc.theWorld.getTotalWorldTime();
if (time >= 120500L)
{
right.add(I18n.getStringParams("demo.demoExpired"));
right.add(I18n.format("demo.demoExpired"));
}
else
{
right.add(I18n.getStringParams("demo.remainingTime", StringUtils.ticksToElapsedTime((int)(120500L - time))));
right.add(I18n.format("demo.remainingTime", StringUtils.ticksToElapsedTime((int)(120500L - time))));
}
}
@@ -676,9 +676,9 @@ public class GuiIngameForge extends GuiIngame
}
left.add(String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", mc.thePlayer.capabilities.getWalkSpeed(), mc.thePlayer.capabilities.getFlySpeed(), mc.thePlayer.onGround, mc.theWorld.getHeightValue(x, z)));
if (mc.entityRenderer != null && mc.entityRenderer.func_147702_a())
if (mc.entityRenderer != null && mc.entityRenderer.isShaderActive())
{
left.add(String.format("shader: %s", mc.entityRenderer.func_147706_e().func_148022_b()));
left.add(String.format("shader: %s", mc.entityRenderer.getShaderGroup().getShaderGroupName()));
}
right.add(null);
@@ -727,7 +727,7 @@ public class GuiIngameForge extends GuiIngame
GL11.glPushMatrix();
GL11.glTranslatef((float)(width / 2), (float)(height - 48), 0.0F);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
int color = (recordIsPlaying ? Color.HSBtoRGB(hue / 50.0F, 0.7F, 0.6F) & WHITE : WHITE);
fontrenderer.drawString(recordPlaying, -fontrenderer.getStringWidth(recordPlaying) / 2, -4, color | (opacity << 24));
GL11.glDisable(GL11.GL_BLEND);
@@ -747,7 +747,7 @@ public class GuiIngameForge extends GuiIngame
GL11.glPushMatrix();
GL11.glTranslatef((float)event.posX, (float)event.posY, 0.0F);
persistantChatGUI.func_146230_a(updateCounter);
persistantChatGUI.drawChat(updateCounter);
GL11.glPopMatrix();
post(CHAT);
@@ -761,12 +761,12 @@ public class GuiIngameForge extends GuiIngame
ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().func_96539_a(0);
NetHandlerPlayClient handler = mc.thePlayer.sendQueue;
if (mc.gameSettings.keyBindPlayerList.func_151470_d() && (!mc.isIntegratedServerRunning() || handler.field_147303_b.size() > 1 || scoreobjective != null))
if (mc.gameSettings.keyBindPlayerList.getIsKeyPressed() && (!mc.isIntegratedServerRunning() || handler.playerInfoList.size() > 1 || scoreobjective != null))
{
if (pre(PLAYER_LIST)) return;
this.mc.mcProfiler.startSection("playerList");
List<GuiPlayerInfo> players = (List<GuiPlayerInfo>)handler.field_147303_b;
int maxPlayers = handler.field_147304_c;
List<GuiPlayerInfo> players = (List<GuiPlayerInfo>)handler.playerInfoList;
int maxPlayers = handler.currentServerMaxPlayers;
int rows = maxPlayers;
int columns = 1;
@@ -37,7 +37,6 @@ import net.minecraftforge.client.model.ModelFormatException;
/**
* Techne model importer, based on iChun's Hats importer
*/
@SuppressWarnings("unused")
@SideOnly(Side.CLIENT)
public class TechneModel extends ModelBase implements IModelCustom {
public static final List<String> cubeTypes = Arrays.asList(
@@ -62,7 +62,7 @@ public class BiomeDictionary
*/
public static boolean registerBiomeType(BiomeGenBase biome, Type ... types)
{
if(BiomeGenBase.func_150565_n()[biome.biomeID] != null)
if(BiomeGenBase.getBiomeGenArray()[biome.biomeID] != null)
{
for(Type type : types)
{
@@ -202,9 +202,9 @@ public class BiomeDictionary
*/
public static void registerAllBiomesAndGenerateEvents()
{
for(int i = 0; i < BiomeGenBase.func_150565_n().length; i++)
for(int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++)
{
BiomeGenBase biome = BiomeGenBase.func_150565_n()[i];
BiomeGenBase biome = BiomeGenBase.getBiomeGenArray()[i];
if(biome == null)
{
@@ -243,25 +243,25 @@ public class BiomeDictionary
BiomeDictionary.registerBiomeType(biome, FOREST);
}
}
else if(biome.maxHeight <= 0.3F && biome.maxHeight >= 0.0F)
else if(biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F)
{
if(!biome.isHighHumidity() || biome.minHeight >= 0.0F)
if(!biome.isHighHumidity() || biome.rootHeight >= 0.0F)
{
BiomeDictionary.registerBiomeType(biome, PLAINS);
}
}
if(biome.isHighHumidity() && biome.minHeight < 0.0F && (biome.maxHeight <= 0.3F && biome.maxHeight >= 0.0F))
if(biome.isHighHumidity() && biome.rootHeight < 0.0F && (biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F))
{
BiomeDictionary.registerBiomeType(biome, SWAMP);
}
if(biome.minHeight <= -0.5F)
if(biome.rootHeight <= -0.5F)
{
BiomeDictionary.registerBiomeType(biome, WATER);
}
if(biome.maxHeight >= 1.5F)
if(biome.heightVariation >= 1.5F)
{
BiomeDictionary.registerBiomeType(biome, MOUNTAIN);
}
@@ -140,7 +140,6 @@ public class ChestGenHooks
public static void removeItem(String category, ItemStack item){ getInfo(category).removeItem(item); }
public static ItemStack getOneItem(String category, Random rand){ return getInfo(category).getOneItem(rand); }
@SuppressWarnings("unused")
private String category;
private int countMin = 0;
private int countMax = 0;
@@ -193,7 +193,7 @@ public class DimensionManager
worlds.put(id, world);
weakWorldMap.put(world, world);
MinecraftServer.getServer().worldTickTimes.put(id, new long[100]);
FMLLog.info("Loading dimension %d (%s) (%s)", id, world.getWorldInfo().getWorldName(), world.getMinecraftServer());
FMLLog.info("Loading dimension %d (%s) (%s)", id, world.getWorldInfo().getWorldName(), world.func_73046_m());
}
else
{
@@ -238,7 +238,7 @@ public class DimensionManager
System.err.println("Cannot Hotload Dim: " + e.getMessage());
return; // If a provider hasn't been registered then we can't hotload the dim
}
MinecraftServer mcServer = overworld.getMinecraftServer();
MinecraftServer mcServer = overworld.func_73046_m();
ISaveHandler savehandler = overworld.getSaveHandler();
WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
@@ -369,7 +369,7 @@ public class ForgeChunkManager
try
{
NBTTagCompound forcedChunkData = CompressedStreamTools.read(chunkLoaderData);
return forcedChunkData.func_150295_c("TicketList", 9).tagCount() > 0;
return forcedChunkData.getTagList("TicketList", 9).tagCount() > 0;
}
catch (IOException e)
{
@@ -409,10 +409,10 @@ public class ForgeChunkManager
FMLLog.log(Level.WARN, e, "Unable to read forced chunk data at %s - it will be ignored", chunkLoaderData.getAbsolutePath());
return;
}
NBTTagList ticketList = forcedChunkData.func_150295_c("TicketList", 9);
NBTTagList ticketList = forcedChunkData.getTagList("TicketList", 9);
for (int i = 0; i < ticketList.tagCount(); i++)
{
NBTTagCompound ticketHolder = (NBTTagCompound)ticketList.func_150305_b(i);
NBTTagCompound ticketHolder = (NBTTagCompound)ticketList.getCompoundTagAt(i);
String modId = ticketHolder.getString("Owner");
boolean isPlayer = "Forge".equals(modId);
@@ -428,10 +428,10 @@ public class ForgeChunkManager
continue;
}
NBTTagList tickets = ticketHolder.func_150295_c("Tickets", 9);
NBTTagList tickets = ticketHolder.getTagList("Tickets", 9);
for (int j = 0; j < tickets.tagCount(); j++)
{
NBTTagCompound ticket = (NBTTagCompound) tickets.func_150305_b(j);
NBTTagCompound ticket = (NBTTagCompound) tickets.getCompoundTagAt(j);
modId = ticket.hasKey("ModId") ? ticket.getString("ModId") : modId;
Type type = Type.values()[ticket.getByte("Type")];
//byte ticketChunkDepth = ticket.getByte("ChunkListDepth");
@@ -75,7 +75,7 @@ public class ForgeHooks
public static boolean canHarvestBlock(Block block, EntityPlayer player, int metadata)
{
if (block.func_149688_o().isToolNotRequired())
if (block.getMaterial().isToolNotRequired())
{
return true;
}
@@ -84,13 +84,13 @@ public class ForgeHooks
String tool = block.getHarvestTool(metadata);
if (stack == null || tool == null)
{
return player.func_146099_a(block);
return player.canHarvestBlock(block);
}
int toolLevel = stack.getItem().getHarvestLevel(stack, tool);
if (toolLevel < 0)
{
return player.func_146099_a(block);
return player.canHarvestBlock(block);
}
return toolLevel >= block.getHarvestLevel(metadata);
@@ -106,7 +106,7 @@ public class ForgeHooks
public static float blockStrength(Block block, EntityPlayer player, World world, int x, int y, int z)
{
int metadata = world.getBlockMetadata(x, y, z);
float hardness = block.func_149712_f(world, x, y, z);
float hardness = block.getBlockHardness(world, x, y, z);
if (hardness < 0.0F)
{
return 0.0F;
@@ -206,7 +206,7 @@ public class ForgeHooks
int x = target.blockX;
int y = target.blockY;
int z = target.blockZ;
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block.isAir(world, x, y, z))
{
@@ -314,7 +314,7 @@ public class ForgeHooks
{
for (int z2 = mZ; z2 < bb.maxZ; z2++)
{
block = world.func_147439_a(x2, y2, z2);
block = world.getBlock(x2, y2, z2);
if (block != null && block.isLadder(world, x2, y2, z2, entity))
{
return true;
@@ -355,12 +355,12 @@ public class ForgeHooks
public static float getEnchantPower(World world, int x, int y, int z)
{
return world.func_147439_a(x, y, z).getEnchantPowerBonus(world, x, y, z);
return world.getBlock(x, y, z).getEnchantPowerBonus(world, x, y, z);
}
public static ChatComponentTranslation onServerChatEvent(NetHandlerPlayServer net, String raw, ChatComponentTranslation comp)
{
ServerChatEvent event = new ServerChatEvent(net.field_147369_b, raw, comp);
ServerChatEvent event = new ServerChatEvent(net.playerEntity, raw, comp);
if (MinecraftForge.EVENT_BUS.post(event))
{
return null;
@@ -389,16 +389,16 @@ public class ForgeHooks
}
// Tell client the block is gone immediately then process events
if (world.func_147438_o(x, y, z) == null)
if (world.getTileEntity(x, y, z) == null)
{
S23PacketBlockChange packet = new S23PacketBlockChange(x, y, z, world);
packet.field_148883_d = Blocks.air;
packet.field_148884_e = 0;
entityPlayer.playerNetServerHandler.func_147359_a(packet);
entityPlayer.playerNetServerHandler.sendPacket(packet);
}
// Post the block break event
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
int blockMetadata = world.getBlockMetadata(x, y, z);
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(x, y, z, world, block, blockMetadata, entityPlayer);
event.setCanceled(preCancelEvent);
@@ -408,16 +408,16 @@ public class ForgeHooks
if (event.isCanceled())
{
// Let the client know the block still exists
entityPlayer.playerNetServerHandler.func_147359_a(new S23PacketBlockChange(x, y, z, world));
entityPlayer.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
// Update any tile entity data for this block
TileEntity tileentity = world.func_147438_o(x, y, z);
TileEntity tileentity = world.getTileEntity(x, y, z);
if (tileentity != null)
{
Packet pkt = tileentity.func_145844_m();
Packet pkt = tileentity.getDescriptionPacket();
if (pkt != null)
{
entityPlayer.playerNetServerHandler.func_147359_a(pkt);
entityPlayer.playerNetServerHandler.sendPacket(pkt);
}
}
}
@@ -15,7 +15,6 @@ import net.minecraft.world.WorldServer;
public class WorldSpecificSaveHandler implements ISaveHandler
{
@SuppressWarnings("unused")
private WorldServer world;
private ISaveHandler parent;
private File dataDir;
@@ -688,7 +688,6 @@ public class Configuration
public static class UnicodeInputStreamReader extends Reader
{
private final InputStreamReader input;
@SuppressWarnings("unused")
private final String defaultEnc;
public UnicodeInputStreamReader(InputStream source, String encoding) throws IOException
@@ -28,7 +28,7 @@ public class FakePlayer extends EntityPlayerMP
return new ChunkCoordinates(0,0,0);
}
@Override public void func_146105_b(IChatComponent chatmessagecomponent){}
@Override public void addChatComponentMessage(IChatComponent chatmessagecomponent){}
@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 boolean isEntityInvulnerable(){ return true; }
@@ -16,7 +16,7 @@ public class ServerChatEvent extends Event
super();
this.message = message;
this.player = player;
this.username = player.func_146103_bH().getName();
this.username = player.getGameProfile().getName();
this.component = component;
}
}
@@ -16,11 +16,11 @@ public class DeferredBiomeDecorator extends BiomeDecorator {
}
@Override
public void func_150512_a(World par1World, Random par2Random, BiomeGenBase biome, int par3, int par4)
public void decorateChunk(World par1World, Random par2Random, BiomeGenBase biome, int par3, int par4)
{
fireCreateEventAndReplace(biome);
// On first call to decorate, we fire and substitute ourselves, if we haven't already done so
biome.theBiomeDecorator.func_150512_a(par1World, par2Random, biome, par3, par4);
biome.theBiomeDecorator.decorateChunk(par1World, par2Random, biome, par3, par4);
}
public void fireCreateEventAndReplace(BiomeGenBase biome)
{
@@ -80,7 +80,7 @@ public class BlockEvent extends Event {
}
else
{
int meta = block.func_149643_k(world, x, y, z);
int meta = block.getDamageValue(world, x, y, z);
int bonusLevel = EnchantmentHelper.getFortuneModifier(player);
this.exp = block.getExpDrop(world, meta, bonusLevel);
}
@@ -24,7 +24,6 @@ import net.minecraft.world.World;
* @author King Lemming, OvermindDL1
*
*/
@SuppressWarnings("unused")
public abstract class BlockFluidBase extends Block implements IFluidBlock
{
protected final static Map<Block, Boolean> defaultDisplacements = Maps.newHashMap();
@@ -54,9 +53,9 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
public BlockFluidBase(Fluid fluid, Material material)
{
super(material);
this.func_149676_a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.func_149675_a(true);
this.func_149649_H();
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.setTickRandomly(true);
this.disableStats();
this.fluidName = fluid.getName();
this.density = fluid.density;
@@ -115,9 +114,9 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
*/
public boolean canDisplace(IBlockAccess world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z).isAir(world, x, y, z)) return true;
if (world.getBlock(x, y, z).isAir(world, x, y, z)) return true;
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block == this)
{
@@ -129,8 +128,8 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
return displacements.get(block);
}
Material material = block.func_149688_o();
if (material.blocksMovement() || material == Material.field_151567_E)
Material material = block.getMaterial();
if (material.blocksMovement() || material == Material.portal)
{
return false;
}
@@ -156,12 +155,12 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
*/
public boolean displaceIfPossible(World world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z).isAir(world, x, y, z))
if (world.getBlock(x, y, z).isAir(world, x, y, z))
{
return true;
}
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block == this)
{
return false;
@@ -171,14 +170,14 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
{
if (displacements.get(block))
{
block.func_149697_b(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
return true;
}
return false;
}
Material material = block.func_149688_o();
if (material.blocksMovement() || material == Material.field_151567_E)
Material material = block.getMaterial();
if (material.blocksMovement() || material == Material.portal)
{
return false;
}
@@ -186,7 +185,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
int density = getDensity(world, x, y, z);
if (density == Integer.MAX_VALUE)
{
block.func_149697_b(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
return true;
}
@@ -203,21 +202,21 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
public abstract int getQuantaValue(IBlockAccess world, int x, int y, int z);
@Override
public abstract boolean func_149678_a(int meta, boolean fullHit);
public abstract boolean canCollideCheck(int meta, boolean fullHit);
public abstract int getMaxRenderHeightMeta();
/* BLOCK FUNCTIONS */
@Override
public void func_149726_b(World world, int x, int y, int z)
public void onBlockAdded(World world, int x, int y, int z)
{
world.func_147464_a(x, y, z, this, tickRate);
world.scheduleBlockUpdate(x, y, z, this, tickRate);
}
@Override
public void func_149695_a(World world, int x, int y, int z, Block block)
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
world.func_147464_a(x, y, z, this, tickRate);
world.scheduleBlockUpdate(x, y, z, this, tickRate);
}
// Used to prevent updates on chunk generation
@@ -228,37 +227,37 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
}
@Override
public boolean func_149655_b(IBlockAccess world, int x, int y, int z)
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z)
{
return true;
}
@Override
public AxisAlignedBB func_149668_a(World world, int x, int y, int z)
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
{
return null;
}
@Override
public Item func_149650_a(int par1, Random par2Random, int par3)
public Item getItemDropped(int par1, Random par2Random, int par3)
{
return null;
}
@Override
public int func_149745_a(Random par1Random)
public int quantityDropped(Random par1Random)
{
return 0;
}
@Override
public int func_149738_a(World world)
public int tickRate(World world)
{
return tickRate;
}
@Override
public void func_149640_a(World world, int x, int y, int z, Entity entity, Vec3 vec)
public void velocityToAddToEntity(World world, int x, int y, int z, Entity entity, Vec3 vec)
{
if (densityDir > 0) return;
Vec3 vec_flow = this.getFlowVector(world, x, y, z);
@@ -279,19 +278,19 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
}
@Override
public int func_149645_b()
public int getRenderType()
{
return FluidRegistry.renderIdFluid;
}
@Override
public boolean func_149662_c()
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean func_149686_d()
public boolean renderAsNormalBlock()
{
return false;
}
@@ -307,7 +306,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
*/
@Override
public int func_149677_c(IBlockAccess world, int x, int y, int z)
public int getMixedBrightnessForBlock(IBlockAccess world, int x, int y, int z)
{
int lightThis = world.getLightBrightnessForSkyBlocks(x, y, z, 0);
int lightUp = world.getLightBrightnessForSkyBlocks(x, y + 1, z, 0);
@@ -320,26 +319,26 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
}
@Override
public int func_149701_w()
public int getRenderBlockPass()
{
return renderPass;
}
@Override
public boolean func_149646_a(IBlockAccess world, int x, int y, int z, int side)
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side)
{
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block != this)
{
return !block.func_149662_c();
return !block.isOpaqueCube();
}
return block.func_149688_o() == this.func_149688_o() ? false : super.func_149646_a(world, x, y, z, side);
return block.getMaterial() == this.getMaterial() ? false : super.shouldSideBeRendered(world, x, y, z, side);
}
/* FLUID FUNCTIONS */
public static final int getDensity(IBlockAccess world, int x, int y, int z)
{
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (!(block instanceof BlockFluidBase))
{
return Integer.MAX_VALUE;
@@ -349,7 +348,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
public static final int getTemperature(IBlockAccess world, int x, int y, int z)
{
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (!(block instanceof BlockFluidBase))
{
return Integer.MAX_VALUE;
@@ -359,8 +358,8 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
public static double getFlowDirection(IBlockAccess world, int x, int y, int z)
{
Block block = world.func_147439_a(x, y, z);
if (!block.func_149688_o().isLiquid())
Block block = world.getBlock(x, y, z);
if (!block.getMaterial().isLiquid())
{
return -1000.0;
}
@@ -415,7 +414,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
int otherDecay = quantaPerBlock - getQuantaValue(world, x2, y, z2);
if (otherDecay >= quantaPerBlock)
{
if (!world.func_147439_a(x2, y, z2).func_149688_o().blocksMovement())
if (!world.getBlock(x2, y, z2).getMaterial().blocksMovement())
{
otherDecay = quantaPerBlock - getQuantaValue(world, x2, y - 1, z2);
if (otherDecay >= 0)
@@ -432,17 +431,17 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
}
}
if (world.func_147439_a(x, y + 1, z) == this)
if (world.getBlock(x, y + 1, z) == this)
{
boolean flag =
func_149747_d(world, x, y, z - 1, 2) ||
func_149747_d(world, x, y, z + 1, 3) ||
func_149747_d(world, x - 1, y, z, 4) ||
func_149747_d(world, x + 1, y, z, 5) ||
func_149747_d(world, x, y + 1, z - 1, 2) ||
func_149747_d(world, x, y + 1, z + 1, 3) ||
func_149747_d(world, x - 1, y + 1, z, 4) ||
func_149747_d(world, x + 1, y + 1, z, 5);
isBlockSolid(world, x, y, z - 1, 2) ||
isBlockSolid(world, x, y, z + 1, 3) ||
isBlockSolid(world, x - 1, y, z, 4) ||
isBlockSolid(world, x + 1, y, z, 5) ||
isBlockSolid(world, x, y + 1, z - 1, 2) ||
isBlockSolid(world, x, y + 1, z + 1, 3) ||
isBlockSolid(world, x - 1, y + 1, z, 4) ||
isBlockSolid(world, x + 1, y + 1, z, 5);
if (flag)
{
@@ -43,12 +43,12 @@ public class BlockFluidClassic extends BlockFluidBase
@Override
public int getQuantaValue(IBlockAccess world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z) == Blocks.air)
if (world.getBlock(x, y, z) == Blocks.air)
{
return 0;
}
if (world.func_147439_a(x, y, z) != this)
if (world.getBlock(x, y, z) != this)
{
return -1;
}
@@ -58,7 +58,7 @@ public class BlockFluidClassic extends BlockFluidBase
}
@Override
public boolean func_149678_a(int meta, boolean fullHit)
public boolean canCollideCheck(int meta, boolean fullHit)
{
return fullHit && meta == 0;
}
@@ -81,7 +81,7 @@ public class BlockFluidClassic extends BlockFluidBase
}
@Override
public void func_149674_a(World world, int x, int y, int z, Random rand)
public void updateTick(World world, int x, int y, int z, Random rand)
{
int quantaRemaining = quantaPerBlock - world.getBlockMetadata(x, y, z);
int expQuanta = -101;
@@ -91,11 +91,11 @@ public class BlockFluidClassic extends BlockFluidBase
{
int y2 = y - densityDir;
if (world.func_147439_a(x, y2, z ) == this ||
world.func_147439_a(x - 1, y2, z ) == this ||
world.func_147439_a(x + 1, y2, z ) == this ||
world.func_147439_a(x, y2, z - 1) == this ||
world.func_147439_a(x, y2, z + 1) == this)
if (world.getBlock(x, y2, z ) == this ||
world.getBlock(x - 1, y2, z ) == this ||
world.getBlock(x + 1, y2, z ) == this ||
world.getBlock(x, y2, z - 1) == this ||
world.getBlock(x, y2, z + 1) == this)
{
expQuanta = quantaPerBlock - 1;
}
@@ -117,13 +117,13 @@ public class BlockFluidClassic extends BlockFluidBase
if (expQuanta <= 0)
{
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, y, z, Blocks.air);
}
else
{
world.setBlockMetadataWithNotify(x, y, z, quantaPerBlock - expQuanta, 3);
world.func_147464_a(x, y, z, this, tickRate);
world.func_147459_d(x, y, z, this);
world.scheduleBlockUpdate(x, y, z, this, tickRate);
world.notifyBlocksOfNeighborChange(x, y, z, this);
}
}
}
@@ -149,7 +149,7 @@ public class BlockFluidClassic extends BlockFluidBase
if (isSourceBlock(world, x, y, z) || !isFlowingVertically(world, x, y, z))
{
if (world.func_147439_a(x, y - densityDir, z) == this)
if (world.getBlock(x, y - densityDir, z) == this)
{
flowMeta = 1;
}
@@ -164,13 +164,13 @@ public class BlockFluidClassic extends BlockFluidBase
public boolean isFlowingVertically(IBlockAccess world, int x, int y, int z)
{
return world.func_147439_a(x, y + densityDir, z) == this ||
(world.func_147439_a(x, y, z) == this && canFlowInto(world, x, y + densityDir, z));
return world.getBlock(x, y + densityDir, z) == this ||
(world.getBlock(x, y, z) == this && canFlowInto(world, x, y + densityDir, z));
}
public boolean isSourceBlock(IBlockAccess world, int x, int y, int z)
{
return world.func_147439_a(x, y, z) == this && world.getBlockMetadata(x, y, z) == 0;
return world.getBlock(x, y, z) == this && world.getBlockMetadata(x, y, z) == 0;
}
protected boolean[] getOptimalFlowDirections(World world, int x, int y, int z)
@@ -275,15 +275,15 @@ public class BlockFluidClassic extends BlockFluidBase
if (meta < 0) return;
if (displaceIfPossible(world, x, y, z))
{
world.func_147465_d(x, y, z, this, meta, 3);
world.setBlock(x, y, z, this, meta, 3);
}
}
protected boolean canFlowInto(IBlockAccess world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z).isAir(world, x, y, z)) return true;
if (world.getBlock(x, y, z).isAir(world, x, y, z)) return true;
Block block = world.func_147439_a(x, y, z);
Block block = world.getBlock(x, y, z);
if (block == this)
{
return true;
@@ -294,11 +294,11 @@ public class BlockFluidClassic extends BlockFluidBase
return displacements.get(block);
}
Material material = block.func_149688_o();
Material material = block.getMaterial();
if (material.blocksMovement() ||
material == Material.field_151586_h ||
material == Material.field_151587_i ||
material == Material.field_151567_E)
material == Material.water ||
material == Material.lava ||
material == Material.portal)
{
return false;
}
@@ -340,7 +340,7 @@ public class BlockFluidClassic extends BlockFluidBase
if (doDrain)
{
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, y, z, Blocks.air);
}
return stack.copy();
@@ -26,12 +26,12 @@ public class BlockFluidFinite extends BlockFluidBase
@Override
public int getQuantaValue(IBlockAccess world, int x, int y, int z)
{
if (world.func_147439_a(x, y, z).isAir(world, x, y, z))
if (world.getBlock(x, y, z).isAir(world, x, y, z))
{
return 0;
}
if (world.func_147439_a(x, y, z) != this)
if (world.getBlock(x, y, z) != this)
{
return -1;
}
@@ -41,7 +41,7 @@ public class BlockFluidFinite extends BlockFluidBase
}
@Override
public boolean func_149678_a(int meta, boolean fullHit)
public boolean canCollideCheck(int meta, boolean fullHit)
{
return fullHit && meta == quantaPerBlock - 1;
}
@@ -53,7 +53,7 @@ public class BlockFluidFinite extends BlockFluidBase
}
@Override
public void func_149674_a(World world, int x, int y, int z, Random rand)
public void updateTick(World world, int x, int y, int z, Random rand)
{
boolean changed = false;
int quantaRemaining = world.getBlockMetadata(x, y, z) + 1;
@@ -82,10 +82,10 @@ public class BlockFluidFinite extends BlockFluidBase
// Flow out if possible
int lowerthan = quantaRemaining - 1;
if (displaceIfPossible(world, x, y, z - 1)) world.func_147449_b(x, y, z - 1, Blocks.air);
if (displaceIfPossible(world, x, y, z + 1)) world.func_147449_b(x, y, z + 1, Blocks.air);
if (displaceIfPossible(world, x - 1, y, z )) world.func_147449_b(x - 1, y, z, Blocks.air);
if (displaceIfPossible(world, x + 1, y, z )) world.func_147449_b(x + 1, y, z, Blocks.air);
if (displaceIfPossible(world, x, y, z - 1)) world.setBlock(x, y, z - 1, Blocks.air);
if (displaceIfPossible(world, x, y, z + 1)) world.setBlock(x, y, z + 1, Blocks.air);
if (displaceIfPossible(world, x - 1, y, z )) world.setBlock(x - 1, y, z, Blocks.air);
if (displaceIfPossible(world, x + 1, y, z )) world.setBlock(x + 1, y, z, Blocks.air);
int north = getQuantaValueBelow(world, x, y, z - 1, lowerthan);
int south = getQuantaValueBelow(world, x, y, z + 1, lowerthan);
int west = getQuantaValueBelow(world, x - 1, y, z, lowerthan);
@@ -141,13 +141,13 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (newnorth == 0)
{
world.func_147449_b(x, y, z - 1, Blocks.air);
world.setBlock(x, y, z - 1, Blocks.air);
}
else
{
world.func_147465_d(x, y, z - 1, this, newnorth - 1, 2);
world.setBlock(x, y, z - 1, this, newnorth - 1, 2);
}
world.func_147464_a(x, y, z - 1, this, tickRate);
world.scheduleBlockUpdate(x, y, z - 1, this, tickRate);
}
--count;
}
@@ -165,13 +165,13 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (newsouth == 0)
{
world.func_147449_b(x, y, z + 1, Blocks.air);
world.setBlock(x, y, z + 1, Blocks.air);
}
else
{
world.func_147465_d(x, y, z + 1, this, newsouth - 1, 2);
world.setBlock(x, y, z + 1, this, newsouth - 1, 2);
}
world.func_147464_a(x, y, z + 1, this, tickRate);
world.scheduleBlockUpdate(x, y, z + 1, this, tickRate);
}
--count;
}
@@ -188,13 +188,13 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (newwest == 0)
{
world.func_147449_b(x - 1, y, z, Blocks.air);
world.setBlock(x - 1, y, z, Blocks.air);
}
else
{
world.func_147465_d(x - 1, y, z, this, newwest - 1, 2);
world.setBlock(x - 1, y, z, this, newwest - 1, 2);
}
world.func_147464_a(x - 1, y, z, this, tickRate);
world.scheduleBlockUpdate(x - 1, y, z, this, tickRate);
}
--count;
}
@@ -212,13 +212,13 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (neweast == 0)
{
world.func_147449_b(x + 1, y, z, Blocks.air);
world.setBlock(x + 1, y, z, Blocks.air);
}
else
{
world.func_147465_d(x + 1, y, z, this, neweast - 1, 2);
world.setBlock(x + 1, y, z, this, neweast - 1, 2);
}
world.func_147464_a(x + 1, y, z, this, tickRate);
world.scheduleBlockUpdate(x + 1, y, z, this, tickRate);
}
--count;
}
@@ -235,7 +235,7 @@ public class BlockFluidFinite extends BlockFluidBase
int otherY = y + densityDir;
if (otherY < 0 || otherY >= world.getHeight())
{
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, y, z, Blocks.air);
return 0;
}
@@ -245,15 +245,15 @@ public class BlockFluidFinite extends BlockFluidBase
amt += amtToInput;
if (amt > quantaPerBlock)
{
world.func_147465_d(x, otherY, z, this, quantaPerBlock - 1, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.setBlock(x, otherY, z, this, quantaPerBlock - 1, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
return amt - quantaPerBlock;
}
else if (amt > 0)
{
world.func_147465_d(x, otherY, z, this, amt - 1, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, otherY, z, this, amt - 1, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
world.setBlock(x, y, z, Blocks.air);
return 0;
}
return amtToInput;
@@ -265,9 +265,9 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (displaceIfPossible(world, x, otherY, z))
{
world.func_147465_d(x, otherY, z, this, amtToInput - 1, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.func_147449_b(x, y, z, Blocks.air);
world.setBlock(x, otherY, z, this, amtToInput - 1, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
world.setBlock(x, y, z, Blocks.air);
return 0;
}
else
@@ -280,12 +280,12 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (density_other < density) // then swap
{
BlockFluidBase block = (BlockFluidBase)world.func_147439_a(x, otherY, z);
BlockFluidBase block = (BlockFluidBase)world.getBlock(x, otherY, z);
int otherData = world.getBlockMetadata(x, otherY, z);
world.func_147465_d(x, otherY, z, this, amtToInput - 1, 3);
world.func_147465_d(x, y, z, block, otherData, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.func_147464_a(x, y, z, block, block.func_149738_a(world));
world.setBlock(x, otherY, z, this, amtToInput - 1, 3);
world.setBlock(x, y, z, block, otherData, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
world.scheduleBlockUpdate(x, y, z, block, block.tickRate(world));
return 0;
}
}
@@ -293,12 +293,12 @@ public class BlockFluidFinite extends BlockFluidBase
{
if (density_other > density)
{
BlockFluidBase block = (BlockFluidBase)world.func_147439_a(x, otherY, z);
BlockFluidBase block = (BlockFluidBase)world.getBlock(x, otherY, z);
int otherData = world.getBlockMetadata(x, otherY, z);
world.func_147465_d(x, otherY, z, this, amtToInput - 1, 3);
world.func_147465_d(x, y, z, block, otherData, 3);
world.func_147464_a(x, otherY, z, this, tickRate);
world.func_147464_a(x, y, z, block, block.func_149738_a(world));
world.setBlock(x, otherY, z, this, amtToInput - 1, 3);
world.setBlock(x, y, z, block, otherData, 3);
world.scheduleBlockUpdate(x, otherY, z, this, tickRate);
world.scheduleBlockUpdate(x, y, z, block, block.tickRate(world));
return 0;
}
}
@@ -26,7 +26,6 @@ import net.minecraftforge.common.MinecraftForge;
* @author King Lemming
*
*/
@SuppressWarnings("unused")
public abstract class FluidContainerRegistry
{
// Holder object that implements HashCode for an ItemStack,
@@ -34,14 +34,14 @@ public abstract class FluidRegistry
public String getLocalizedName() {
return StatCollector.translateToLocal("tile.water.name");
}
}.setBlock(Blocks.water).setUnlocalizedName(Blocks.water.func_149739_a());
}.setBlock(Blocks.water).setUnlocalizedName(Blocks.water.getUnlocalizedName());
public static final Fluid LAVA = new Fluid("lava") {
@Override
public String getLocalizedName() {
return StatCollector.translateToLocal("tile.lava.name");
}
}.setBlock(Blocks.lava).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Blocks.lava.func_149739_a());
}.setBlock(Blocks.lava).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Blocks.lava.getUnlocalizedName());
public static int renderIdFluid = -1;
@@ -127,7 +127,7 @@ public class FluidTank implements IFluidTank
if (tile != null)
{
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this));
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
}
return fluid.amount;
}
@@ -150,7 +150,7 @@ public class FluidTank implements IFluidTank
if (tile != null)
{
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this));
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
}
return filled;
}
@@ -180,7 +180,7 @@ public class FluidTank implements IFluidTank
if (tile != null)
{
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this));
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this));
}
}
return stack;
@@ -55,9 +55,9 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
public float getFluidHeightForRender(IBlockAccess world, int x, int y, int z, BlockFluidBase block)
{
if (world.func_147439_a(x, y, z) == block)
if (world.getBlock(x, y, z) == block)
{
if (world.func_147439_a(x, y - block.densityDir, z).func_149688_o().isLiquid())
if (world.getBlock(x, y - block.densityDir, z).getMaterial().isLiquid())
{
return 1;
}
@@ -67,7 +67,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
return 0.875F;
}
}
return !world.func_147439_a(x, y, z).func_149688_o().isSolid() && world.func_147439_a(x, y - block.densityDir, z) == block ? 1 : block.getQuantaPercentage(world, x, y, z) * 0.875F;
return !world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y - block.densityDir, z) == block ? 1 : block.getQuantaPercentage(world, x, y, z) * 0.875F;
}
/* ISimpleBlockRenderingHandler */
@@ -83,7 +83,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
}
Tessellator tessellator = Tessellator.instance;
int color = block.func_149720_d(world, x, y, z);
int color = block.colorMultiplier(world, x, y, z);
float red = (color >> 16 & 255) / 255.0F;
float green = (color >> 8 & 255) / 255.0F;
float blue = (color & 255) / 255.0F;
@@ -91,16 +91,16 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
BlockFluidBase theFluid = (BlockFluidBase) block;
int bMeta = world.getBlockMetadata(x, y, z);
boolean renderTop = world.func_147439_a(x, y - theFluid.densityDir, z) != theFluid;
boolean renderTop = world.getBlock(x, y - theFluid.densityDir, z) != theFluid;
boolean renderBottom = block.func_149646_a(world, x, y + theFluid.densityDir, z, 0) && world.func_147439_a(x, y + theFluid.densityDir, z) != theFluid;
boolean renderBottom = block.shouldSideBeRendered(world, x, y + theFluid.densityDir, z, 0) && world.getBlock(x, y + theFluid.densityDir, z) != theFluid;
boolean[] renderSides = new boolean[]
{
block.func_149646_a(world, x, y, z - 1, 2),
block.func_149646_a(world, x, y, z + 1, 3),
block.func_149646_a(world, x - 1, y, z, 4),
block.func_149646_a(world, x + 1, y, z, 5)
block.shouldSideBeRendered(world, x, y, z - 1, 2),
block.shouldSideBeRendered(world, x, y, z + 1, 3),
block.shouldSideBeRendered(world, x - 1, y, z, 4),
block.shouldSideBeRendered(world, x + 1, y, z, 5)
};
if (!renderTop && !renderBottom && !renderSides[0] && !renderSides[1] && !renderSides[2] && !renderSides[3])
@@ -138,15 +138,15 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
}
boolean rises = theFluid.densityDir == 1;
if (renderer.field_147837_f || renderTop)
if (renderer.renderAllFaces || renderTop)
{
rendered = true;
IIcon iconStill = getIcon(block.func_149691_a(1, bMeta));
IIcon iconStill = getIcon(block.getIcon(1, bMeta));
float flowDir = (float) BlockFluidBase.getFlowDirection(world, x, y, z);
if (flowDir > -999.0F)
{
iconStill = getIcon(block.func_149691_a(2, bMeta));
iconStill = getIcon(block.getIcon(2, bMeta));
}
heightNW -= RENDER_OFFSET;
@@ -181,7 +181,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
v3 = iconStill.getInterpolatedV(8.0F + (-zFlow - xFlow) * 16.0F);
}
tessellator.setBrightness(block.func_149677_c(world, x, y, z));
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue);
if (!rises)
@@ -200,19 +200,19 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
}
}
if (renderer.field_147837_f || renderBottom)
if (renderer.renderAllFaces || renderBottom)
{
rendered = true;
tessellator.setBrightness(block.func_149677_c(world, x, y - 1, z));
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z));
if (!rises)
{
tessellator.setColorOpaque_F(LIGHT_Y_NEG * red, LIGHT_Y_NEG * green, LIGHT_Y_NEG * blue);
renderer.func_147768_a(block, x, y + RENDER_OFFSET, z, getIcon(block.func_149691_a(0, bMeta)));
renderer.renderFaceYNeg(block, x, y + RENDER_OFFSET, z, getIcon(block.getIcon(0, bMeta)));
}
else
{
tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue);
renderer.func_147806_b(block, x, y + RENDER_OFFSET, z, getIcon(block.func_149691_a(1, bMeta)));
renderer.renderFaceYPos(block, x, y + RENDER_OFFSET, z, getIcon(block.getIcon(1, bMeta)));
}
}
@@ -229,8 +229,8 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
case 3: ++x2; break;
}
IIcon iconFlow = getIcon(block.func_149691_a(side + 2, bMeta));
if (renderer.field_147837_f || renderSides[side])
IIcon iconFlow = getIcon(block.getIcon(side + 2, bMeta));
if (renderer.renderAllFaces || renderSides[side])
{
rendered = true;
@@ -283,7 +283,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
float v1Flow = iconFlow.getInterpolatedV((1.0D - ty1) * 16.0D * 0.5D);
float v2Flow = iconFlow.getInterpolatedV((1.0D - ty2) * 16.0D * 0.5D);
float v3Flow = iconFlow.getInterpolatedV(8.0D);
tessellator.setBrightness(block.func_149677_c(world, x2, y, z2));
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x2, y, z2));
float sideLighting = 1.0F;
if (side < 2)
@@ -313,8 +313,8 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
}
}
}
renderer.field_147855_j = 0;
renderer.field_147857_k = 1;
renderer.renderMinY = 0;
renderer.renderMaxY = 1;
return rendered;
}
}
@@ -16,16 +16,16 @@ public class TileFluidHandler extends TileEntity implements IFluidHandler
protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME);
@Override
public void func_145839_a(NBTTagCompound tag)
public void readFromNBT(NBTTagCompound tag)
{
super.func_145839_a(tag);
super.readFromNBT(tag);
tank.readFromNBT(tag);
}
@Override
public void func_145841_b(NBTTagCompound tag)
public void writeToNBT(NBTTagCompound tag)
{
super.func_145841_b(tag);
super.writeToNBT(tag);
tank.writeToNBT(tag);
}
@@ -18,13 +18,11 @@ public class ForgeTimeTracker {
public static long tileEntityTrackingTime;
private Map<TileEntity,int[]> tileEntityTimings;
@SuppressWarnings("unused")
private Map<Entity,int[]> entityTimings;
private static final ForgeTimeTracker INSTANCE = new ForgeTimeTracker();
private WeakReference<TileEntity> tile;
@SuppressWarnings("unused")
private WeakReference<Entity> entity;
private long timing;
@@ -88,7 +88,7 @@ public class ForgeCommand extends CommandBase {
{
ForgeTimeTracker.tileEntityTrackingDuration = duration;
ForgeTimeTracker.tileEntityTracking = true;
sender.func_145747_a(new ChatComponentTranslation("commands.forge.tracking.te.enabled", duration));
sender.addChatMessage(new ChatComponentTranslation("commands.forge.tracking.te.enabled", duration));
}
private void doTPSLog(ICommandSender sender, String[] args)
@@ -111,17 +111,17 @@ public class ForgeCommand extends CommandBase {
{
double worldTickTime = ForgeCommand.mean(this.server.worldTickTimes.get(dimId)) * 1.0E-6D;
double worldTPS = Math.min(1000.0/worldTickTime, 20);
sender.func_145747_a(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dimId), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS)));
sender.addChatMessage(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dimId), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS)));
}
double meanTickTime = ForgeCommand.mean(this.server.tickTimeArray) * 1.0E-6D;
double meanTPS = Math.min(1000.0/meanTickTime, 20);
sender.func_145747_a(new ChatComponentTranslation("commands.forge.tps.summary","Overall", timeFormatter.format(meanTickTime), timeFormatter.format(meanTPS)));
sender.addChatMessage(new ChatComponentTranslation("commands.forge.tps.summary","Overall", timeFormatter.format(meanTickTime), timeFormatter.format(meanTPS)));
}
else
{
double worldTickTime = ForgeCommand.mean(this.server.worldTickTimes.get(dim)) * 1.0E-6D;
double worldTPS = Math.min(1000.0/worldTickTime, 20);
sender.func_145747_a(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dim), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS)));
sender.addChatMessage(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dim), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS)));
}
}
@@ -501,7 +501,6 @@ public class CodecIBXM implements ICodec
* @param maxLength Maximum size this array may be.
* @return New array.
*/
@SuppressWarnings("unused")
private static byte[] trimArray( byte[] array, int maxLength )
{
byte[] trimmedArray = null;
@@ -546,7 +545,6 @@ public class CodecIBXM implements ICodec
* @param two_bytes_data For stereo sounds.
* @return byte array containing the converted data.
*/
@SuppressWarnings("unused")
private static byte[] convertAudioBytes( byte[] audio_bytes,
boolean two_bytes_data )
{