mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
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:
1 parent
9d919f8ac9
commit
e68577ffd3
188 files changed
+1869
-1870
No files matched your search
@@ -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; }
|
||||
|
||||
Reference in new issue
Block a user