mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Update mappings to 09/21 snapshots.
Conflict with getMatrix in ITransformation, so renamed to getMatrixVec.
This commit is contained in:
1 parent
5ed03945a0
commit
94e1a8e0a4
210 files changed
+1052
-978
No files matched your search
@@ -270,18 +270,18 @@ public class BiomeDictionary
|
||||
*/
|
||||
public static void makeBestGuess(Biome biome)
|
||||
{
|
||||
Type type = Type.fromVanilla(biome.func_201856_r());
|
||||
Type type = Type.fromVanilla(biome.getCategory());
|
||||
if (type != null)
|
||||
{
|
||||
BiomeDictionary.addTypes(biome, type);
|
||||
}
|
||||
|
||||
if (biome.getRainfall() > 0.85f)
|
||||
if (biome.getDownfall() > 0.85f)
|
||||
{
|
||||
BiomeDictionary.addTypes(biome, WET);
|
||||
}
|
||||
|
||||
if (biome.getRainfall() < 0.15f)
|
||||
if (biome.getDownfall() < 0.15f)
|
||||
{
|
||||
BiomeDictionary.addTypes(biome, DRY);
|
||||
}
|
||||
@@ -296,14 +296,14 @@ public class BiomeDictionary
|
||||
BiomeDictionary.addTypes(biome, COLD);
|
||||
}
|
||||
|
||||
if (biome.isHighHumidity() && biome.getBaseHeight() < 0.0F && (biome.getHeightVariation() <= 0.3F && biome.getHeightVariation() >= 0.0F))
|
||||
if (biome.isHighHumidity() && biome.getDepth() < 0.0F && (biome.getScale() <= 0.3F && biome.getScale() >= 0.0F))
|
||||
{
|
||||
BiomeDictionary.addTypes(biome, SWAMP);
|
||||
}
|
||||
|
||||
if (biome.getBaseHeight() <= -0.5F)
|
||||
if (biome.getDepth() <= -0.5F)
|
||||
{
|
||||
if (biome.getHeightVariation() == 0.0F)
|
||||
if (biome.getScale() == 0.0F)
|
||||
{
|
||||
BiomeDictionary.addTypes(biome, RIVER);
|
||||
}
|
||||
@@ -313,12 +313,12 @@ public class BiomeDictionary
|
||||
}
|
||||
}
|
||||
|
||||
if (biome.getHeightVariation() >= 0.4F && biome.getHeightVariation() < 1.5F)
|
||||
if (biome.getScale() >= 0.4F && biome.getScale() < 1.5F)
|
||||
{
|
||||
BiomeDictionary.addTypes(biome, HILLS);
|
||||
}
|
||||
|
||||
if (biome.getHeightVariation() >= 1.5F)
|
||||
if (biome.getScale() >= 1.5F)
|
||||
{
|
||||
BiomeDictionary.addTypes(biome, MOUNTAIN);
|
||||
}
|
||||
@@ -367,76 +367,76 @@ public class BiomeDictionary
|
||||
addTypes(Biomes.OCEAN, OCEAN );
|
||||
addTypes(Biomes.PLAINS, PLAINS );
|
||||
addTypes(Biomes.DESERT, HOT, DRY, SANDY );
|
||||
addTypes(Biomes.EXTREME_HILLS, MOUNTAIN, HILLS );
|
||||
addTypes(Biomes.MOUNTAINS, MOUNTAIN, HILLS );
|
||||
addTypes(Biomes.FOREST, FOREST );
|
||||
addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST );
|
||||
addTypes(Biomes.SWAMPLAND, WET, SWAMP );
|
||||
addTypes(Biomes.SWAMP, WET, SWAMP );
|
||||
addTypes(Biomes.RIVER, RIVER );
|
||||
addTypes(Biomes.HELL, HOT, DRY, NETHER );
|
||||
addTypes(Biomes.SKY, COLD, DRY, END );
|
||||
addTypes(Biomes.NETHER, HOT, DRY, NETHER );
|
||||
addTypes(Biomes.THE_END, COLD, DRY, END );
|
||||
addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY );
|
||||
addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY );
|
||||
addTypes(Biomes.ICE_PLAINS, COLD, SNOWY, WASTELAND );
|
||||
addTypes(Biomes.ICE_MOUNTAINS, COLD, SNOWY, MOUNTAIN );
|
||||
addTypes(Biomes.MUSHROOM_ISLAND, MUSHROOM, RARE );
|
||||
addTypes(Biomes.MUSHROOM_ISLAND_SHORE, MUSHROOM, BEACH, RARE );
|
||||
addTypes(Biomes.SNOWY_TUNDRA, COLD, SNOWY, WASTELAND );
|
||||
addTypes(Biomes.SNOWY_MOUNTAINS, COLD, SNOWY, MOUNTAIN );
|
||||
addTypes(Biomes.MUSHROOM_FIELDS, MUSHROOM, RARE );
|
||||
addTypes(Biomes.MUSHROOM_FIELD_SHORE, MUSHROOM, BEACH, RARE );
|
||||
addTypes(Biomes.BEACH, BEACH );
|
||||
addTypes(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS );
|
||||
addTypes(Biomes.FOREST_HILLS, FOREST, HILLS );
|
||||
addTypes(Biomes.WOODED_HILLS, FOREST, HILLS );
|
||||
addTypes(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
|
||||
addTypes(Biomes.EXTREME_HILLS_EDGE, MOUNTAIN );
|
||||
addTypes(Biomes.MOUNTAIN_EDGE, MOUNTAIN );
|
||||
addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE );
|
||||
addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS );
|
||||
addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE );
|
||||
addTypes(Biomes.DEEP_OCEAN, OCEAN );
|
||||
addTypes(Biomes.STONE_BEACH, BEACH );
|
||||
addTypes(Biomes.COLD_BEACH, COLD, BEACH, SNOWY );
|
||||
addTypes(Biomes.STONE_SHORE, BEACH );
|
||||
addTypes(Biomes.SNOWY_BEACH, COLD, BEACH, SNOWY );
|
||||
addTypes(Biomes.BIRCH_FOREST, FOREST );
|
||||
addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS );
|
||||
addTypes(Biomes.ROOFED_FOREST, SPOOKY, DENSE, FOREST );
|
||||
addTypes(Biomes.COLD_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY );
|
||||
addTypes(Biomes.COLD_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS );
|
||||
addTypes(Biomes.REDWOOD_TAIGA, COLD, CONIFEROUS, FOREST );
|
||||
addTypes(Biomes.REDWOOD_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
|
||||
addTypes(Biomes.EXTREME_HILLS_WITH_TREES, MOUNTAIN, FOREST, SPARSE );
|
||||
addTypes(Biomes.DARK_FOREST, SPOOKY, DENSE, FOREST );
|
||||
addTypes(Biomes.SNOWY_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY );
|
||||
addTypes(Biomes.SNOWY_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS );
|
||||
addTypes(Biomes.GIANT_TREE_TAIGA, COLD, CONIFEROUS, FOREST );
|
||||
addTypes(Biomes.GIANT_TREE_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
|
||||
addTypes(Biomes.WOODED_MOUNTAINS, MOUNTAIN, FOREST, SPARSE );
|
||||
addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE );
|
||||
addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE );
|
||||
addTypes(Biomes.MESA, MESA, SANDY );
|
||||
addTypes(Biomes.MESA_ROCK, MESA, SPARSE, SANDY );
|
||||
addTypes(Biomes.MESA_CLEAR_ROCK, MESA, SANDY );
|
||||
addTypes(Biomes.field_201936_P, END );
|
||||
addTypes(Biomes.field_201937_Q, END );
|
||||
addTypes(Biomes.field_201938_R, END );
|
||||
addTypes(Biomes.field_201939_S, END );
|
||||
addTypes(Biomes.field_203614_T, OCEAN, HOT );
|
||||
addTypes(Biomes.field_203615_U, OCEAN );
|
||||
addTypes(Biomes.field_203616_V, OCEAN, COLD );
|
||||
addTypes(Biomes.field_203617_W, OCEAN, HOT );
|
||||
addTypes(Biomes.field_203618_X, OCEAN );
|
||||
addTypes(Biomes.field_203619_Y, OCEAN, COLD );
|
||||
addTypes(Biomes.field_203620_Z, OCEAN, COLD );
|
||||
addTypes(Biomes.VOID, VOID );
|
||||
addTypes(Biomes.MUTATED_PLAINS, PLAINS, RARE );
|
||||
addTypes(Biomes.MUTATED_DESERT, HOT, DRY, SANDY, RARE );
|
||||
addTypes(Biomes.MUTATED_EXTREME_HILLS, MOUNTAIN, SPARSE, RARE );
|
||||
addTypes(Biomes.MUTATED_FOREST, FOREST, HILLS, RARE );
|
||||
addTypes(Biomes.MUTATED_TAIGA, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE );
|
||||
addTypes(Biomes.MUTATED_SWAMPLAND, WET, SWAMP, HILLS, RARE );
|
||||
addTypes(Biomes.MUTATED_ICE_FLATS, COLD, SNOWY, HILLS, RARE );
|
||||
addTypes(Biomes.MUTATED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE);
|
||||
addTypes(Biomes.MUTATED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE );
|
||||
addTypes(Biomes.MUTATED_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE );
|
||||
addTypes(Biomes.MUTATED_BIRCH_FOREST_HILLS, FOREST, DENSE, MOUNTAIN, RARE );
|
||||
addTypes(Biomes.MUTATED_ROOFED_FOREST, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE );
|
||||
addTypes(Biomes.MUTATED_TAIGA_COLD, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE);
|
||||
addTypes(Biomes.MUTATED_REDWOOD_TAIGA, DENSE, FOREST, RARE );
|
||||
addTypes(Biomes.MUTATED_REDWOOD_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE );
|
||||
addTypes(Biomes.MUTATED_EXTREME_HILLS_WITH_TREES, MOUNTAIN, SPARSE, RARE );
|
||||
addTypes(Biomes.MUTATED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
||||
addTypes(Biomes.MUTATED_SAVANNA_ROCK, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE);
|
||||
addTypes(Biomes.MUTATED_MESA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
||||
addTypes(Biomes.MUTATED_MESA_ROCK, HOT, DRY, SPARSE, HILLS, RARE );
|
||||
addTypes(Biomes.MUTATED_MESA_CLEAR_ROCK, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
||||
addTypes(Biomes.BADLANDS, MESA, SANDY );
|
||||
addTypes(Biomes.WOODED_BADLANDS_PLATEAU, MESA, SPARSE, SANDY );
|
||||
addTypes(Biomes.BADLANDS_PLATEAU, MESA, SANDY );
|
||||
addTypes(Biomes.SMALL_END_ISLANDS, END );
|
||||
addTypes(Biomes.END_MIDLANDS, END );
|
||||
addTypes(Biomes.END_HIGHLANDS, END );
|
||||
addTypes(Biomes.END_BARRENS, END );
|
||||
addTypes(Biomes.WARM_OCEAN, OCEAN, HOT );
|
||||
addTypes(Biomes.LUKEWARM_OCEAN, OCEAN );
|
||||
addTypes(Biomes.COLD_OCEAN, OCEAN, COLD );
|
||||
addTypes(Biomes.DEEP_WARM_OCEAN, OCEAN, HOT );
|
||||
addTypes(Biomes.DEEP_LUKEWARM_OCEAN, OCEAN );
|
||||
addTypes(Biomes.DEEP_COLD_OCEAN, OCEAN, COLD );
|
||||
addTypes(Biomes.DEEP_FROZEN_OCEAN, OCEAN, COLD );
|
||||
addTypes(Biomes.THE_VOID, VOID );
|
||||
addTypes(Biomes.SUNFLOWER_PLAINS, PLAINS, RARE );
|
||||
addTypes(Biomes.DESERT_LAKES, HOT, DRY, SANDY, RARE );
|
||||
addTypes(Biomes.GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE );
|
||||
addTypes(Biomes.FLOWER_FOREST, FOREST, HILLS, RARE );
|
||||
addTypes(Biomes.TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE );
|
||||
addTypes(Biomes.SWAMP_HILLS, WET, SWAMP, HILLS, RARE );
|
||||
addTypes(Biomes.ICE_SPIKES, COLD, SNOWY, HILLS, RARE );
|
||||
addTypes(Biomes.MODIFIED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE);
|
||||
addTypes(Biomes.MODIFIED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE );
|
||||
addTypes(Biomes.TALL_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE );
|
||||
addTypes(Biomes.TALL_BIRCH_HILLS, FOREST, DENSE, MOUNTAIN, RARE );
|
||||
addTypes(Biomes.DARK_FOREST_HILLS, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE );
|
||||
addTypes(Biomes.SNOWY_TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE);
|
||||
addTypes(Biomes.GIANT_SPRUCE_TAIGA, DENSE, FOREST, RARE );
|
||||
addTypes(Biomes.GIANT_SPRUCE_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE );
|
||||
addTypes(Biomes.MODIFIED_GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE );
|
||||
addTypes(Biomes.SHATTERED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
||||
addTypes(Biomes.SHATTERED_SAVANNA_PLATEAU, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE);
|
||||
addTypes(Biomes.ERODED_BADLANDS, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
||||
addTypes(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, HILLS, RARE );
|
||||
addTypes(Biomes.MODIFIED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
||||
|
||||
|
||||
if (DEBUG)
|
||||
|
||||
@@ -52,25 +52,25 @@ public class BiomeManager
|
||||
List<BiomeEntry> list = new ArrayList<BiomeEntry>();
|
||||
|
||||
list.add(new BiomeEntry(Biomes.FOREST, 10));
|
||||
list.add(new BiomeEntry(Biomes.ROOFED_FOREST, 10));
|
||||
list.add(new BiomeEntry(Biomes.EXTREME_HILLS, 10));
|
||||
list.add(new BiomeEntry(Biomes.DARK_FOREST, 10));
|
||||
list.add(new BiomeEntry(Biomes.MOUNTAINS, 10));
|
||||
list.add(new BiomeEntry(Biomes.PLAINS, 10));
|
||||
list.add(new BiomeEntry(Biomes.BIRCH_FOREST, 10));
|
||||
list.add(new BiomeEntry(Biomes.SWAMPLAND, 10));
|
||||
list.add(new BiomeEntry(Biomes.SWAMP, 10));
|
||||
|
||||
currentBiomes[BiomeType.WARM.ordinal()] = new TrackedList<BiomeEntry>(list);
|
||||
list.clear();
|
||||
|
||||
list.add(new BiomeEntry(Biomes.FOREST, 10));
|
||||
list.add(new BiomeEntry(Biomes.EXTREME_HILLS, 10));
|
||||
list.add(new BiomeEntry(Biomes.MOUNTAINS, 10));
|
||||
list.add(new BiomeEntry(Biomes.TAIGA, 10));
|
||||
list.add(new BiomeEntry(Biomes.PLAINS, 10));
|
||||
|
||||
currentBiomes[BiomeType.COOL.ordinal()] = new TrackedList<BiomeEntry>(list);
|
||||
list.clear();
|
||||
|
||||
list.add(new BiomeEntry(Biomes.ICE_PLAINS, 30));
|
||||
list.add(new BiomeEntry(Biomes.COLD_TAIGA, 10));
|
||||
list.add(new BiomeEntry(Biomes.SNOWY_TUNDRA, 30));
|
||||
list.add(new BiomeEntry(Biomes.SNOWY_TAIGA, 10));
|
||||
|
||||
currentBiomes[BiomeType.ICY.ordinal()] = new TrackedList<BiomeEntry>(list);
|
||||
list.clear();
|
||||
@@ -82,17 +82,17 @@ public class BiomeManager
|
||||
|
||||
public static void addSpawnBiome(Biome biome)
|
||||
{
|
||||
if (!BiomeProvider.field_201540_a.contains(biome))
|
||||
if (!BiomeProvider.BIOMES_TO_SPAWN_IN.contains(biome))
|
||||
{
|
||||
BiomeProvider.field_201540_a.add(biome);
|
||||
BiomeProvider.BIOMES_TO_SPAWN_IN.add(biome);
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeSpawnBiome(Biome biome)
|
||||
{
|
||||
if (BiomeProvider.field_201540_a.contains(biome))
|
||||
if (BiomeProvider.BIOMES_TO_SPAWN_IN.contains(biome))
|
||||
{
|
||||
BiomeProvider.field_201540_a.remove(biome);
|
||||
BiomeProvider.BIOMES_TO_SPAWN_IN.remove(biome);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public class DimensionManager
|
||||
|
||||
public static Dimension getProvider(int dim)
|
||||
{
|
||||
return getWorld(dim).provider;
|
||||
return getWorld(dim).dimension;
|
||||
}
|
||||
|
||||
public static Integer[] getIDs(boolean check)
|
||||
@@ -219,7 +219,7 @@ public class DimensionManager
|
||||
{
|
||||
worlds.put(id, world);
|
||||
weakWorldMap.put(world, world);
|
||||
LOGGER.info(DIMMGR,"Loading dimension {} ({}) ({})", id, world.getWorldInfo().getWorldName(), world.getMinecraftServer());
|
||||
LOGGER.info(DIMMGR,"Loading dimension {} ({}) ({})", id, world.getWorldInfo().getWorldName(), world.getServer());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -264,7 +264,7 @@ public class DimensionManager
|
||||
LOGGER.error(DIMMGR,"Cannot Hotload Dim: {}", dim, e);
|
||||
return; // If a provider hasn't been registered then we can't hotload the dim
|
||||
}
|
||||
MinecraftServer mcServer = overworld.getMinecraftServer();
|
||||
MinecraftServer mcServer = overworld.getServer();
|
||||
ISaveHandler savehandler = overworld.getSaveHandler();
|
||||
//WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
|
||||
|
||||
@@ -329,7 +329,7 @@ public class DimensionManager
|
||||
{
|
||||
if (dimensions.containsKey(dim))
|
||||
{
|
||||
Dimension ret = getProviderType(dim).createDimension();
|
||||
Dimension ret = getProviderType(dim).create();
|
||||
ret.setId(dim);
|
||||
return ret;
|
||||
}
|
||||
@@ -361,8 +361,8 @@ public class DimensionManager
|
||||
{
|
||||
return ForgeChunkManager.getPersistentChunksFor(world).isEmpty()
|
||||
&& world.playerEntities.isEmpty()
|
||||
&& !world.provider.getDimensionType().shouldLoadSpawn()
|
||||
&& !keepLoaded.contains(world.provider.getId());
|
||||
&& !world.dimension.getType().shouldLoadSpawn()
|
||||
&& !keepLoaded.contains(world.dimension.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -421,7 +421,7 @@ public class DimensionManager
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w));
|
||||
w.close();
|
||||
setWorld(id, null, w.getMinecraftServer());
|
||||
setWorld(id, null, w.getServer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ public class ForgeChunkManager
|
||||
try
|
||||
{
|
||||
NBTTagCompound forcedChunkData = CompressedStreamTools.read(chunkLoaderData);
|
||||
return forcedChunkData.getTagList("TicketList", Constants.NBT.TAG_COMPOUND).size() > 0;
|
||||
return forcedChunkData.getList("TicketList", Constants.NBT.TAG_COMPOUND).size() > 0;
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
@@ -499,10 +499,10 @@ public class ForgeChunkManager
|
||||
LOGGER.warn(CHUNK_MANAGER, "Unable to read forced chunk data at {} - it will be ignored", chunkLoaderData.getAbsolutePath(), e);
|
||||
return;
|
||||
}
|
||||
NBTTagList ticketList = forcedChunkData.getTagList("TicketList", Constants.NBT.TAG_COMPOUND);
|
||||
NBTTagList ticketList = forcedChunkData.getList("TicketList", Constants.NBT.TAG_COMPOUND);
|
||||
for (int i = 0; i < ticketList.size(); i++)
|
||||
{
|
||||
NBTTagCompound ticketHolder = ticketList.getCompoundTagAt(i);
|
||||
NBTTagCompound ticketHolder = ticketList.getCompound(i);
|
||||
String modId = ticketHolder.getString("Owner");
|
||||
boolean isPlayer = ForgeVersion.MOD_ID.equals(modId);
|
||||
|
||||
@@ -518,17 +518,17 @@ public class ForgeChunkManager
|
||||
continue;
|
||||
}
|
||||
|
||||
NBTTagList tickets = ticketHolder.getTagList("Tickets", Constants.NBT.TAG_COMPOUND);
|
||||
NBTTagList tickets = ticketHolder.getList("Tickets", Constants.NBT.TAG_COMPOUND);
|
||||
for (int j = 0; j < tickets.size(); j++)
|
||||
{
|
||||
NBTTagCompound ticket = tickets.getCompoundTagAt(j);
|
||||
NBTTagCompound ticket = tickets.getCompound(j);
|
||||
modId = ticket.hasKey("ModId") ? ticket.getString("ModId") : modId;
|
||||
Type type = Type.values()[ticket.getByte("Type")];
|
||||
//byte ticketChunkDepth = ticket.getByte("ChunkListDepth");
|
||||
Ticket tick = new Ticket(modId, type, world);
|
||||
if (ticket.hasKey("ModData"))
|
||||
{
|
||||
tick.modData = ticket.getCompoundTag("ModData");
|
||||
tick.modData = ticket.getCompound("ModData");
|
||||
}
|
||||
if (ticket.hasKey("Player"))
|
||||
{
|
||||
@@ -545,8 +545,8 @@ public class ForgeChunkManager
|
||||
}
|
||||
if (type == Type.ENTITY)
|
||||
{
|
||||
tick.entityChunkX = ticket.getInteger("chunkX");
|
||||
tick.entityChunkZ = ticket.getInteger("chunkZ");
|
||||
tick.entityChunkX = ticket.getInt("chunkX");
|
||||
tick.entityChunkZ = ticket.getInt("chunkZ");
|
||||
UUID uuid = new UUID(ticket.getLong("PersistentIDMSB"), ticket.getLong("PersistentIDLSB"));
|
||||
// add the ticket to the "pending entity" list
|
||||
pendingEntities.put(uuid, tick);
|
||||
@@ -936,10 +936,10 @@ public class ForgeChunkManager
|
||||
{
|
||||
ticket.setTag("ModData", tick.modData);
|
||||
}
|
||||
if (tick.ticketType == Type.ENTITY && tick.entity != null && tick.entity.writeToNBTOptional(new NBTTagCompound()))
|
||||
if (tick.ticketType == Type.ENTITY && tick.entity != null && tick.entity.writeUnlessPassenger(new NBTTagCompound()))
|
||||
{
|
||||
ticket.setInteger("chunkX", MathHelper.floor(tick.entity.chunkCoordX));
|
||||
ticket.setInteger("chunkZ", MathHelper.floor(tick.entity.chunkCoordZ));
|
||||
ticket.setInt("chunkX", MathHelper.floor(tick.entity.chunkCoordX));
|
||||
ticket.setInt("chunkZ", MathHelper.floor(tick.entity.chunkCoordZ));
|
||||
ticket.setLong("PersistentIDMSB", tick.entity.getUniqueID().getMostSignificantBits());
|
||||
ticket.setLong("PersistentIDLSB", tick.entity.getUniqueID().getLeastSignificantBits());
|
||||
tickets.add(ticket);
|
||||
@@ -996,8 +996,8 @@ public class ForgeChunkManager
|
||||
ChunkEntry entry = cache.getIfPresent(ChunkPos.asLong(chunk.x, chunk.z));
|
||||
if (entry != null)
|
||||
{
|
||||
entry.nbt.setTag("Entities", nbt.getTagList("Entities", Constants.NBT.TAG_COMPOUND));
|
||||
entry.nbt.setTag("TileEntities", nbt.getTagList("TileEntities", Constants.NBT.TAG_COMPOUND));
|
||||
entry.nbt.setTag("Entities", nbt.getList("Entities", Constants.NBT.TAG_COMPOUND));
|
||||
entry.nbt.setTag("TileEntities", nbt.getList("TileEntities", Constants.NBT.TAG_COMPOUND));
|
||||
|
||||
ClassInheritanceMultiMap<Entity>[] entityLists = chunk.getEntityLists();
|
||||
for (int i = 0; i < entityLists.length; ++i)
|
||||
@@ -1027,17 +1027,17 @@ public class ForgeChunkManager
|
||||
|
||||
private static void loadChunkEntities(Chunk chunk, NBTTagCompound nbt, World world)
|
||||
{
|
||||
NBTTagList entities = nbt.getTagList("Entities", Constants.NBT.TAG_COMPOUND);
|
||||
NBTTagList entities = nbt.getList("Entities", Constants.NBT.TAG_COMPOUND);
|
||||
for (int i = 0; i < entities.size(); ++i)
|
||||
{
|
||||
AnvilChunkLoader.readChunkEntity(entities.getCompoundTagAt(i), world, chunk);
|
||||
AnvilChunkLoader.readChunkEntity(entities.getCompound(i), world, chunk);
|
||||
chunk.setHasEntities(true);
|
||||
}
|
||||
|
||||
NBTTagList tileEntities = nbt.getTagList("TileEntities", Constants.NBT.TAG_COMPOUND);
|
||||
NBTTagList tileEntities = nbt.getList("TileEntities", Constants.NBT.TAG_COMPOUND);
|
||||
for (int i = 0; i < tileEntities.size(); ++i)
|
||||
{
|
||||
TileEntity tileEntity = TileEntity.func_203403_c(tileEntities.getCompoundTagAt(i));
|
||||
TileEntity tileEntity = TileEntity.create(tileEntities.getCompound(i));
|
||||
if (tileEntity != null) chunk.addTileEntity(tileEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,10 +456,10 @@ public class ForgeHooks
|
||||
}
|
||||
*/
|
||||
ItemStack result;
|
||||
boolean isCreative = player.capabilities.isCreativeMode;
|
||||
boolean isCreative = player.abilities.isCreativeMode;
|
||||
TileEntity te = null;
|
||||
|
||||
if (target.typeOfHit == RayTraceResult.Type.BLOCK)
|
||||
if (target.type == RayTraceResult.Type.BLOCK)
|
||||
{
|
||||
IBlockState state = world.getBlockState(target.getBlockPos());
|
||||
|
||||
@@ -475,12 +475,12 @@ public class ForgeHooks
|
||||
}
|
||||
else
|
||||
{
|
||||
if (target.typeOfHit != RayTraceResult.Type.ENTITY || target.entityHit == null || !isCreative)
|
||||
if (target.type != RayTraceResult.Type.ENTITY || target.entity == null || !isCreative)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
result = target.entityHit.getPickedResult(target);
|
||||
result = target.entity.getPickedResult(target);
|
||||
}
|
||||
|
||||
if (result.isEmpty())
|
||||
@@ -490,13 +490,13 @@ public class ForgeHooks
|
||||
|
||||
if (te != null)
|
||||
{
|
||||
Minecraft.getMinecraft().storeTEInStack(result, te);
|
||||
Minecraft.getInstance().storeTEInStack(result, te);
|
||||
}
|
||||
|
||||
if (isCreative)
|
||||
{
|
||||
player.inventory.setPickedItemStack(result);
|
||||
Minecraft.getMinecraft().playerController.sendSlotPacket(player.getHeldItem(EnumHand.MAIN_HAND), 36 + player.inventory.currentItem);
|
||||
Minecraft.getInstance().playerController.sendSlotPacket(player.getHeldItem(EnumHand.MAIN_HAND), 36 + player.inventory.currentItem);
|
||||
return true;
|
||||
}
|
||||
int slot = player.inventory.getSlotFor(result);
|
||||
@@ -505,7 +505,7 @@ public class ForgeHooks
|
||||
if (InventoryPlayer.isHotbar(slot))
|
||||
player.inventory.currentItem = slot;
|
||||
else
|
||||
Minecraft.getMinecraft().playerController.pickItem(slot);
|
||||
Minecraft.getInstance().playerController.pickItem(slot);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -610,7 +610,7 @@ public class ForgeHooks
|
||||
}
|
||||
else
|
||||
{
|
||||
AxisAlignedBB bb = entity.getEntityBoundingBox();
|
||||
AxisAlignedBB bb = entity.getBoundingBox();
|
||||
int mX = MathHelper.floor(bb.minX);
|
||||
int mY = MathHelper.floor(bb.minY);
|
||||
int mZ = MathHelper.floor(bb.minZ);
|
||||
@@ -769,7 +769,7 @@ public class ForgeHooks
|
||||
|
||||
if (!entityPlayer.isAllowEdit())
|
||||
{
|
||||
if (itemstack.isEmpty() || !itemstack.func_206848_a(world.func_205772_D(), new BlockWorldState(world, pos, false)))
|
||||
if (itemstack.isEmpty() || !itemstack.canDestroy(world.getTags(), new BlockWorldState(world, pos, false)))
|
||||
preCancelEvent = true;
|
||||
}
|
||||
}
|
||||
@@ -809,8 +809,8 @@ public class ForgeHooks
|
||||
/* TODO: Talk to Sponge folk about World rollbacks.
|
||||
public static EnumActionResult onPlaceItemIntoWorld(@Nonnull ItemUseContext context)
|
||||
{
|
||||
ItemStack itemstack = context.func_195996_i();
|
||||
World world = context.func_195991_k();
|
||||
ItemStack itemstack = context.getItem();
|
||||
World world = context.getWorld();
|
||||
|
||||
// handle all placement events here
|
||||
int meta = itemstack.getItemDamage();
|
||||
@@ -826,7 +826,7 @@ public class ForgeHooks
|
||||
world.captureBlockSnapshots = true;
|
||||
}
|
||||
|
||||
EnumActionResult ret = itemstack.getItem().func_195939_a(context);
|
||||
EnumActionResult ret = itemstack.getItem().onItemUse(context);
|
||||
world.captureBlockSnapshots = false;
|
||||
|
||||
if (ret == EnumActionResult.SUCCESS)
|
||||
@@ -845,15 +845,15 @@ public class ForgeHooks
|
||||
world.capturedBlockSnapshots.clear();
|
||||
|
||||
// make sure to set pre-placement item data for event
|
||||
itemstack.func_196085_b(meta);
|
||||
itemstack.setDamage(meta);
|
||||
itemstack.setCount(size);
|
||||
if (nbt != null)
|
||||
{
|
||||
itemstack.setTagCompound(nbt);
|
||||
}
|
||||
|
||||
EntityPlayer player = context.func_195999_j();
|
||||
EnumFacing side = context.func_196000_l();
|
||||
EntityPlayer player = context.getPlayer();
|
||||
EnumFacing side = context.getFace();
|
||||
|
||||
if (blockSnapshots.size() > 1)
|
||||
{
|
||||
@@ -878,7 +878,7 @@ public class ForgeHooks
|
||||
else
|
||||
{
|
||||
// Change the stack to its new content
|
||||
itemstack.func_196085_b(newMeta);
|
||||
itemstack.setDamage(newMeta);
|
||||
itemstack.setCount(newSize);
|
||||
if (nbt != null)
|
||||
{
|
||||
@@ -940,7 +940,7 @@ public class ForgeHooks
|
||||
if (stack.getItem().hasContainerItem(stack))
|
||||
{
|
||||
stack = stack.getItem().getContainerItem(stack);
|
||||
if (!stack.isEmpty() && stack.isItemStackDamageable() && stack.getItemDamage() > stack.getMaxDamage())
|
||||
if (!stack.isEmpty() && stack.isDamageable() && stack.getDamage() > stack.getMaxDamage())
|
||||
{
|
||||
ForgeEventFactory.onPlayerDestroyItem(craftingPlayer.get(), stack, null);
|
||||
return ItemStack.EMPTY;
|
||||
@@ -1232,7 +1232,7 @@ public class ForgeHooks
|
||||
NBTTagList enchantmentsNbt = ItemEnchantedBook.getEnchantments(itemStack);
|
||||
if (enchantmentsNbt.size() == 1)
|
||||
{
|
||||
NBTTagCompound nbttagcompound = enchantmentsNbt.getCompoundTagAt(0);
|
||||
NBTTagCompound nbttagcompound = enchantmentsNbt.getCompound(0);
|
||||
Enchantment enchantment = Enchantment.getEnchantmentByID(nbttagcompound.getShort("id"));
|
||||
if (enchantment != null)
|
||||
{
|
||||
@@ -1255,7 +1255,7 @@ public class ForgeHooks
|
||||
}
|
||||
else if (item instanceof ItemSpawnEgg)
|
||||
{
|
||||
ResourceLocation resourceLocation = ((ItemSpawnEgg)item).func_208076_b(null).getRegistryName();
|
||||
ResourceLocation resourceLocation = ((ItemSpawnEgg)item).getType(null).getRegistryName();
|
||||
if (resourceLocation != null)
|
||||
{
|
||||
return resourceLocation.getNamespace();
|
||||
@@ -1319,8 +1319,8 @@ public class ForgeHooks
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidState func_204610_c(BlockPos p_204610_1_) {
|
||||
return Fluids.field_204541_a.func_207188_f();
|
||||
public IFluidState getFluidState(BlockPos pos) {
|
||||
return Fluids.EMPTY.getDefaultState();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook
|
||||
|
||||
if (event.isWorldRunning() && tmpStairs != disableStairSlabCulling)
|
||||
{
|
||||
DistExecutor.runWhenOn(Dist.CLIENT,()->()-> Minecraft.getMinecraft().renderGlobal.loadRenderers());
|
||||
DistExecutor.runWhenOn(Dist.CLIENT,()->()-> Minecraft.getInstance().renderGlobal.loadRenderers());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -435,7 +435,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook
|
||||
@Override
|
||||
public void readData(SaveHandler handler, WorldInfo info, NBTTagCompound tag)
|
||||
{
|
||||
DimensionManager.loadDimensionDataMap(tag.hasKey("DimensionData") ? tag.getCompoundTag("DimensionData") : null);
|
||||
DimensionManager.loadDimensionDataMap(tag.hasKey("DimensionData") ? tag.getCompound("DimensionData") : null);
|
||||
// TODO fluids FluidRegistry.loadFluidDefaults(tag);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,4 +27,4 @@ public interface IPlantable
|
||||
{
|
||||
EnumPlantType getPlantType(IWorldReader world, BlockPos pos);
|
||||
IBlockState getPlant(IWorldReader world, BlockPos pos);
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public interface ISpecialArmor
|
||||
}
|
||||
|
||||
double totalArmor = entity.getTotalArmorValue();
|
||||
double totalToughness = entity.getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).getAttributeValue();
|
||||
double totalToughness = entity.getAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).getValue();
|
||||
|
||||
if (source.isUnblockable())
|
||||
{
|
||||
@@ -169,7 +169,7 @@ public interface ISpecialArmor
|
||||
{
|
||||
ItemArmor armor = (ItemArmor)stack.getItem();
|
||||
prop = new ArmorProperties(0, 0, Integer.MAX_VALUE);
|
||||
prop.Armor = armor.func_200881_e();
|
||||
prop.Armor = armor.getDamageReduceAmount();
|
||||
prop.Toughness = armor.getToughness();
|
||||
}
|
||||
if (prop != null)
|
||||
|
||||
@@ -63,7 +63,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
|
||||
@Override public IPlayerFileData getPlayerNBTManager() { return parent.getPlayerNBTManager(); }
|
||||
@Override public void flush() { parent.flush(); }
|
||||
@Override public File getWorldDirectory() { return parent.getWorldDirectory(); }
|
||||
@Override public DataFixer func_197718_i() { return parent.func_197718_i(); }
|
||||
@Override public DataFixer getFixer() { return parent.getFixer(); }
|
||||
|
||||
@Override
|
||||
public File getMapFileFromName(String name)
|
||||
@@ -76,7 +76,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
|
||||
File file = new File(dataDir, name + ".dat");
|
||||
if (!file.exists())
|
||||
{
|
||||
switch (world.provider.getId())
|
||||
switch (world.dimension.getId())
|
||||
{
|
||||
case -1:
|
||||
if (name.equalsIgnoreCase("FORTRESS")) copyFile(name, file);
|
||||
|
||||
@@ -40,7 +40,7 @@ public class VanillaBrewingRecipe implements IBrewingRecipe {
|
||||
public boolean isInput(ItemStack stack)
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
return item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
|
||||
return item == Items.POTION || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -124,7 +124,7 @@ public class ChunkIOExecutor
|
||||
ChunkIOProvider task = tasks.get(key);
|
||||
if (task == null)
|
||||
{
|
||||
LOGGER.warn("Attempted to dequeue chunk that wasn't queued? {} @ ({}, {})", world.provider.getId(), x, z);
|
||||
LOGGER.warn("Attempted to dequeue chunk that wasn't queued? {} @ ({}, {})", world.dimension.getId(), x, z);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ class QueuedChunk {
|
||||
result.append(" x: " + x + NEW_LINE);
|
||||
result.append(" z: " + z + NEW_LINE);
|
||||
result.append(" world: " + world.getWorldInfo().getWorldName() + NEW_LINE);
|
||||
result.append(" dimension: " + world.provider.getId() + NEW_LINE);
|
||||
result.append(" provider: " + world.provider.getClass().getName() + NEW_LINE);
|
||||
result.append(" dimension: " + world.dimension.getId() + NEW_LINE);
|
||||
result.append(" provider: " + world.dimension.getClass().getName() + NEW_LINE);
|
||||
result.append("}");
|
||||
|
||||
return result.toString();
|
||||
|
||||
@@ -439,4 +439,4 @@ public class ConfigCategory implements Map<String, Property>
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public class CompoundIngredient extends Ingredient
|
||||
@Override
|
||||
public CompoundIngredient parse(PacketBuffer buffer)
|
||||
{
|
||||
return new CompoundIngredient(Stream.generate(() -> Ingredient.func_199566_b(buffer)).limit(buffer.readVarInt()).collect(Collectors.toList()));
|
||||
return new CompoundIngredient(Stream.generate(() -> Ingredient.fromBuffer(buffer)).limit(buffer.readVarInt()).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,7 +131,7 @@ public class CompoundIngredient extends Ingredient
|
||||
public void write(PacketBuffer buffer, CompoundIngredient ingredient)
|
||||
{
|
||||
buffer.writeVarInt(ingredient.children.size());
|
||||
ingredient.children.forEach(c -> c.func_199564_a(buffer));
|
||||
ingredient.children.forEach(c -> c.writeToBuffer(buffer));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -111,11 +111,11 @@ public class CraftingHelper
|
||||
public static final IIngredientSerializer<CompoundIngredient> INGREDIENT_COMPOUND = register(new ResourceLocation("forge", "compound"), new CompoundIngredient.Serializer());
|
||||
public static final IIngredientSerializer<Ingredient> INGREDIENT_VANILLA = register(new ResourceLocation("minecraft", "item"), new IIngredientSerializer<Ingredient>() {
|
||||
public Ingredient parse(PacketBuffer buffer) {
|
||||
return Ingredient.func_209357_a(Stream.generate(() -> new Ingredient.SingleItemList(buffer.readItemStack())).limit(buffer.readVarInt()));
|
||||
return Ingredient.fromItemListStream(Stream.generate(() -> new Ingredient.SingleItemList(buffer.readItemStack())).limit(buffer.readVarInt()));
|
||||
}
|
||||
|
||||
public Ingredient parse(JsonObject json) {
|
||||
return Ingredient.func_209357_a(Stream.of(Ingredient.func_199803_a(json)));
|
||||
return Ingredient.fromItemListStream(Stream.of(Ingredient.deserializeItemList(json)));
|
||||
}
|
||||
|
||||
public void write(PacketBuffer buffer, Ingredient ingredient) {
|
||||
@@ -248,9 +248,9 @@ public class CraftingHelper
|
||||
|
||||
tmp.setTag("tag", nbt);
|
||||
tmp.setString("id", itemName);
|
||||
tmp.setInteger("Count", JsonUtils.getInt(json, "count", 1));
|
||||
tmp.setInt("Count", JsonUtils.getInt(json, "count", 1));
|
||||
|
||||
return ItemStack.func_199557_a(tmp);
|
||||
return ItemStack.read(tmp);
|
||||
}
|
||||
catch (CommandSyntaxException e)
|
||||
{
|
||||
@@ -292,15 +292,15 @@ public class CraftingHelper
|
||||
|
||||
public static void reloadConstants(IResourceManager manager) {
|
||||
Map<ResourceLocation, IItemList> ret = new HashMap<>();
|
||||
for(ResourceLocation key : manager.func_199003_a("recipes", filename -> filename.equals("_constants.json")))
|
||||
for(ResourceLocation key : manager.getAllResourceLocations("recipes", filename -> filename.equals("_constants.json")))
|
||||
{
|
||||
String path = key.getPath();
|
||||
if (!path.equals("recipes/_constants.json")) //Top level only
|
||||
continue;
|
||||
|
||||
try (IResource iresource = manager.func_199002_a(key))
|
||||
try (IResource iresource = manager.getResource(key))
|
||||
{
|
||||
JsonObject[] elements = JsonUtils.gsonDeserialize(GSON, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), JsonObject[].class);
|
||||
JsonObject[] elements = JsonUtils.fromJson(GSON, IOUtils.toString(iresource.getInputStream(), StandardCharsets.UTF_8), JsonObject[].class);
|
||||
for (int x = 0; x < elements.length; x++)
|
||||
{
|
||||
JsonObject json = elements[x];
|
||||
@@ -328,7 +328,7 @@ public class CraftingHelper
|
||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(items));
|
||||
}
|
||||
else if (json.has("tag"))
|
||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), Ingredient.func_199803_a(json));
|
||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), Ingredient.deserializeItemList(json));
|
||||
else if (json.has("item"))
|
||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(Lists.newArrayList(getItemStack(JsonUtils.getJsonObject(json, "item"), true))));
|
||||
else
|
||||
|
||||
@@ -44,7 +44,7 @@ public class IngredientNBT extends Ingredient
|
||||
if (input == null)
|
||||
return false;
|
||||
//Can't use areItemStacksEqualUsingNBTShareTag because it compares stack size as well
|
||||
return this.stack.getItem() == input.getItem() && this.stack.getItemDamage() == input.getItemDamage() && ItemStack.areItemStackShareTagsEqual(this.stack, input);
|
||||
return this.stack.getItem() == input.getItem() && this.stack.getDamage() == input.getDamage() && ItemStack.areItemStackShareTagsEqual(this.stack, input);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,13 +37,13 @@ public class StackList implements IItemList
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ItemStack> func_199799_a()
|
||||
public Collection<ItemStack> getStacks()
|
||||
{
|
||||
return items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObject func_200303_b()
|
||||
public JsonObject toJson()
|
||||
{
|
||||
if (items.size() == 1)
|
||||
return toJson(items.iterator().next());
|
||||
@@ -61,8 +61,8 @@ public class StackList implements IItemList
|
||||
ret.addProperty("item", stack.getItem().getRegistryName().toString());
|
||||
if (stack.getCount() != 1)
|
||||
ret.addProperty("count", stack.getCount());
|
||||
if (stack.getTagCompound() != null)
|
||||
ret.addProperty("nbt", stack.getTagCompound().toString()); //TODO: Better serialization?
|
||||
if (stack.getTag() != null)
|
||||
ret.addProperty("nbt", stack.getTag().toString()); //TODO: Better serialization?
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,4 +23,4 @@
|
||||
package net.minecraftforge.common.crafting;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
@@ -139,7 +139,7 @@ public interface IForgeBlock
|
||||
*/
|
||||
default boolean doesSideBlockRendering(IBlockState state, IWorldReader world, BlockPos pos, EnumFacing face)
|
||||
{
|
||||
return state.func_200015_d(world, pos);
|
||||
return state.isOpaqueCube(world, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,7 +237,7 @@ public interface IForgeBlock
|
||||
{
|
||||
if (world instanceof IWorldWriter)
|
||||
{
|
||||
((IWorldWriter)world).setBlockState(pos, state.func_206870_a(BlockBed.OCCUPIED,occupied), 4);
|
||||
((IWorldWriter)world).setBlockState(pos, state.with(BlockBed.OCCUPIED,occupied), 4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ public interface IForgeBlock
|
||||
*/
|
||||
default EnumFacing getBedDirection(IBlockState state, IWorldReader world, BlockPos pos)
|
||||
{
|
||||
return state.getValue(BlockHorizontal.FACING);
|
||||
return state.get(BlockHorizontal.HORIZONTAL_FACING);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -264,7 +264,7 @@ public interface IForgeBlock
|
||||
*/
|
||||
default boolean isBedFoot(IBlockState state, IWorldReader world, BlockPos pos)
|
||||
{
|
||||
return state.getValue(BlockBed.PART) == BedPart.FOOT;
|
||||
return state.get(BlockBed.PART) == BedPart.FOOT;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -408,7 +408,7 @@ public interface IForgeBlock
|
||||
default boolean canPlaceTorchOnTop(IBlockState state, IWorldReader world, BlockPos pos)
|
||||
{
|
||||
if (state.isTopSolid() || state.getBlockFaceShape(world, pos, EnumFacing.UP) == BlockFaceShape.SOLID)
|
||||
return this.getBlock() != Blocks.END_GATEWAY && this.getBlock() != Blocks.field_196628_cT;
|
||||
return this.getBlock() != Blocks.END_GATEWAY && this.getBlock() != Blocks.JACK_O_LANTERN;
|
||||
else
|
||||
return this.getBlock() instanceof BlockFence || this.getBlock() == Blocks.COBBLESTONE_WALL || this.getBlock() instanceof BlockGlass;
|
||||
}
|
||||
@@ -514,19 +514,19 @@ public interface IForgeBlock
|
||||
return this.getBlock() == Blocks.CACTUS && this.getBlock() == Blocks.SAND;
|
||||
}
|
||||
|
||||
if (plant.getBlock() == Blocks.field_196608_cF)
|
||||
if (plant.getBlock() == Blocks.SUGAR_CANE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (plantable instanceof BlockBush && ((BlockBush)plantable).func_196260_a(state, world, pos))
|
||||
if (plantable instanceof BlockBush && ((BlockBush)plantable).isValidPosition(state, world, pos))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case Desert: return this.getBlock() == Blocks.SAND || this.getBlock() == Blocks.HARDENED_CLAY ||
|
||||
case Desert: return this.getBlock() == Blocks.SAND || this.getBlock() == Blocks.TERRACOTTA ||
|
||||
this.getBlock() instanceof BlockGlazedTerracotta;
|
||||
case Nether: return this.getBlock() == Blocks.SOUL_SAND;
|
||||
case Crop: return this.getBlock() == Blocks.FARMLAND;
|
||||
@@ -578,7 +578,7 @@ public interface IForgeBlock
|
||||
default boolean isFertile(IBlockState state, IWorldReader world, BlockPos pos)
|
||||
{
|
||||
if (this.getBlock() == Blocks.FARMLAND)
|
||||
return state.getValue(BlockFarmland.MOISTURE) > 0;
|
||||
return state.get(BlockFarmland.MOISTURE) > 0;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -598,7 +598,7 @@ public interface IForgeBlock
|
||||
*/
|
||||
default int getLightOpacity(IBlockState state, IWorldReader world, BlockPos pos)
|
||||
{
|
||||
return state.func_200016_a(world, pos);
|
||||
return state.getOpacity(world, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -630,7 +630,7 @@ public interface IForgeBlock
|
||||
|
||||
default boolean rotateBlock(IBlockState state, IWorld world, BlockPos pos, EnumFacing axis)
|
||||
{
|
||||
state.func_206871_b().keySet().forEach(prop ->
|
||||
state.getValues().keySet().forEach(prop ->
|
||||
{
|
||||
if (prop.getName().equals("facing") || prop.getName().equals("rotation") && prop.getValueClass() == EnumFacing.class)
|
||||
{
|
||||
@@ -640,13 +640,13 @@ public interface IForgeBlock
|
||||
IBlockState newState;
|
||||
@SuppressWarnings("unchecked")
|
||||
IProperty<EnumFacing> facingIProperty = (IProperty<EnumFacing>) prop;
|
||||
EnumFacing facing = state.getValue(facingIProperty);
|
||||
EnumFacing facing = state.get(facingIProperty);
|
||||
Collection<EnumFacing> validFacing = facingIProperty.getAllowedValues();
|
||||
|
||||
// rotate horizontal facings clockwise
|
||||
if (validFacing.size() == 4 && !validFacing.contains(EnumFacing.UP) && !validFacing.contains(EnumFacing.DOWN))
|
||||
{
|
||||
newState = state.func_206870_a(facingIProperty, facing.rotateY());
|
||||
newState = state.with(facingIProperty, facing.rotateY());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -654,11 +654,11 @@ public interface IForgeBlock
|
||||
EnumFacing rotatedFacing = facing.rotateAround(axis.getAxis());
|
||||
if (validFacing.contains(rotatedFacing))
|
||||
{
|
||||
newState = state.func_206870_a(facingIProperty, rotatedFacing);
|
||||
newState = state.with(facingIProperty, rotatedFacing);
|
||||
}
|
||||
else // abnormal facing property, just cycle it
|
||||
{
|
||||
newState = state.cycleProperty(facingIProperty);
|
||||
newState = state.cycle(facingIProperty);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -879,7 +879,7 @@ public interface IForgeBlock
|
||||
@SuppressWarnings("deprecation")
|
||||
default IBlockState getStateForPlacement(IBlockState state, EnumFacing facing, IBlockState state2, IWorld world, BlockPos pos1, BlockPos pos2, EnumHand hand)
|
||||
{
|
||||
return this.getBlock().func_196271_a(state, facing, state2, world, pos1, pos2);
|
||||
return this.getBlock().updatePostPlacement(state, facing, state2, world, pos1, pos2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
|
||||
|
||||
default void deserializeNBT(NBTTagCompound nbt)
|
||||
{
|
||||
getEntity().readFromNBT(nbt);
|
||||
getEntity().read(nbt);
|
||||
}
|
||||
|
||||
default NBTTagCompound serializeNBT()
|
||||
@@ -63,7 +63,7 @@ public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
|
||||
{
|
||||
ret.setString("id", getEntity().getEntityString());
|
||||
}
|
||||
return getEntity().writeToNBT(ret);
|
||||
return getEntity().writeWithoutTypeId(ret);
|
||||
}
|
||||
|
||||
boolean canUpdate();
|
||||
@@ -125,7 +125,7 @@ public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemSpawnEgg egg = ItemSpawnEgg.func_200889_b(getEntity().func_200600_R());
|
||||
ItemSpawnEgg egg = ItemSpawnEgg.getEgg(getEntity().getType());
|
||||
if (egg != null) return new ItemStack(egg);
|
||||
}
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
@@ -52,7 +52,7 @@ public interface IForgeFluid
|
||||
*/
|
||||
default boolean isEntityInside(IFluidState state, IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
|
||||
{
|
||||
return state.func_206884_a(tag) && yToTest - pos.getY() < state.func_206885_f() + 0.1F;
|
||||
return state.isTagged(tag) && yToTest - pos.getY() < state.getHeight() + 0.1F;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,6 +96,6 @@ public interface IForgeFluid
|
||||
*/
|
||||
default float getExplosionResistance(IFluidState state, IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
||||
{
|
||||
return state.func_210200_l();
|
||||
return state.getExplosionResistance();
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public interface IForgeFluidState
|
||||
*/
|
||||
default boolean isEntityInside(IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
|
||||
{
|
||||
return getFluidState().func_206886_c().isEntityInside(getFluidState(), world, pos, entity, yToTest, tag, testingHead);
|
||||
return getFluidState().getFluid().isEntityInside(getFluidState(), world, pos, entity, yToTest, tag, testingHead);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,6 @@ public interface IForgeFluidState
|
||||
*/
|
||||
default float getExplosionResistance(IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
||||
{
|
||||
return getFluidState().func_206886_c().getExplosionResistance(getFluidState(), world, pos, exploder, explosion);
|
||||
return getFluidState().getFluid().getExplosionResistance(getFluidState(), world, pos, exploder, explosion);
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public interface IForgeItem
|
||||
@SuppressWarnings("deprecation")
|
||||
default Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack)
|
||||
{
|
||||
return getItem().getItemAttributeModifiers(slot);
|
||||
return getItem().getAttributeModifiers(slot);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +133,7 @@ public interface IForgeItem
|
||||
@Nullable
|
||||
default NBTTagCompound getNBTShareTag(ItemStack stack)
|
||||
{
|
||||
return stack.getTagCompound();
|
||||
return stack.getTag();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,7 +145,7 @@ public interface IForgeItem
|
||||
*/
|
||||
default void readNBTShareTag(ItemStack stack, @Nullable NBTTagCompound nbt)
|
||||
{
|
||||
stack.setTagCompound(nbt);
|
||||
stack.setTag(nbt);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +286,7 @@ public interface IForgeItem
|
||||
*/
|
||||
default java.util.Collection<ItemGroup> getCreativeTabs()
|
||||
{
|
||||
return java.util.Collections.singletonList(getItem().getCreativeTab());
|
||||
return java.util.Collections.singletonList(getItem().getGroup());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -454,7 +454,7 @@ public interface IForgeItem
|
||||
*/
|
||||
default int getDamage(ItemStack stack)
|
||||
{
|
||||
return !stack.hasTagCompound() ? 0 : stack.getTagCompound().getInteger("Damage");
|
||||
return !stack.hasTag() ? 0 : stack.getTag().getInt("Damage");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -467,7 +467,7 @@ public interface IForgeItem
|
||||
*/
|
||||
default boolean showDurabilityBar(ItemStack stack)
|
||||
{
|
||||
return stack.isItemDamaged();
|
||||
return stack.isDamaged();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -479,7 +479,7 @@ public interface IForgeItem
|
||||
*/
|
||||
default double getDurabilityForDisplay(ItemStack stack)
|
||||
{
|
||||
return (double) stack.getItemDamage() / (double) stack.getMaxDamage();
|
||||
return (double) stack.getDamage() / (double) stack.getMaxDamage();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -517,7 +517,7 @@ public interface IForgeItem
|
||||
*/
|
||||
default boolean isDamaged(ItemStack stack)
|
||||
{
|
||||
return stack.getItemDamage() > 0;
|
||||
return stack.getDamage() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -529,7 +529,7 @@ public interface IForgeItem
|
||||
*/
|
||||
default void setDamage(ItemStack stack, int damage)
|
||||
{
|
||||
stack.func_196082_o().setInteger("Damage", Math.max(0, damage));
|
||||
stack.getOrCreateTag().setInt("Damage", Math.max(0, damage));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -570,7 +570,7 @@ public interface IForgeItem
|
||||
@SuppressWarnings("deprecation")
|
||||
default int getItemStackLimit(ItemStack stack)
|
||||
{
|
||||
return getItem().getItemStackLimit();
|
||||
return getItem().getMaxStackSize();
|
||||
}
|
||||
|
||||
Set<ToolType> getToolTypes(ItemStack stack);
|
||||
@@ -654,7 +654,7 @@ public interface IForgeItem
|
||||
default boolean shouldCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack)
|
||||
{
|
||||
return !(newStack.getItem() == oldStack.getItem() && ItemStack.areItemStackTagsEqual(newStack, oldStack)
|
||||
&& (newStack.isItemStackDamageable() || newStack.getItemDamage() == oldStack.getItemDamage()));
|
||||
&& (newStack.isDamageable() || newStack.getDamage() == oldStack.getDamage()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -704,7 +704,7 @@ public interface IForgeItem
|
||||
.builder();
|
||||
for (ResourceLocation location : ((RegistrySimple<ResourceLocation, IItemPropertyGetter>) getItem().properties).getKeys())
|
||||
{
|
||||
final IItemPropertyGetter parameter = getItem().properties.getObject(location);
|
||||
final IItemPropertyGetter parameter = getItem().properties.get(location);
|
||||
builder.put(location.toString(), input -> parameter.call(stack, world, entity));
|
||||
}
|
||||
return builder.build();
|
||||
|
||||
@@ -101,16 +101,16 @@ public interface IForgeItemStack extends ICapabilitySerializable<NBTTagCompound>
|
||||
|
||||
default EnumActionResult onItemUseFirst(ItemUseContext context)
|
||||
{
|
||||
EntityPlayer entityplayer = context.func_195999_j();
|
||||
BlockPos blockpos = context.func_195995_a();
|
||||
BlockWorldState blockworldstate = new BlockWorldState(context.func_195991_k(), blockpos, false);
|
||||
if (entityplayer != null && !entityplayer.capabilities.allowEdit && !getStack().func_206847_b(context.func_195991_k().func_205772_D(), blockworldstate)) {
|
||||
EntityPlayer entityplayer = context.getPlayer();
|
||||
BlockPos blockpos = context.getPos();
|
||||
BlockWorldState blockworldstate = new BlockWorldState(context.getWorld(), blockpos, false);
|
||||
if (entityplayer != null && !entityplayer.abilities.allowEdit && !getStack().canPlaceOn(context.getWorld().getTags(), blockworldstate)) {
|
||||
return EnumActionResult.PASS;
|
||||
} else {
|
||||
Item item = getStack().getItem();
|
||||
EnumActionResult enumactionresult = item.onItemUseFirst(getStack(), context);
|
||||
if (entityplayer != null && enumactionresult == EnumActionResult.SUCCESS) {
|
||||
entityplayer.addStat(StatList.OBJECT_USE_STATS.func_199076_b(item));
|
||||
entityplayer.addStat(StatList.ITEM_USED.get(item));
|
||||
}
|
||||
|
||||
return enumactionresult;
|
||||
@@ -120,7 +120,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<NBTTagCompound>
|
||||
default NBTTagCompound serializeNBT()
|
||||
{
|
||||
NBTTagCompound ret = new NBTTagCompound();
|
||||
getStack().writeToNBT(ret);
|
||||
getStack().write(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,14 +30,14 @@ public interface IForgeTileEntity extends ICapabilitySerializable<NBTTagCompound
|
||||
@Override
|
||||
default void deserializeNBT(NBTTagCompound nbt)
|
||||
{
|
||||
getTileEntity().readFromNBT(nbt);
|
||||
getTileEntity().read(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
default NBTTagCompound serializeNBT()
|
||||
{
|
||||
NBTTagCompound ret = new NBTTagCompound();
|
||||
getTileEntity().writeToNBT(ret);
|
||||
getTileEntity().write(ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -33,4 +33,4 @@ public interface IModelState
|
||||
* if no part is provided, global model transformation is returned.
|
||||
*/
|
||||
Optional<TRSRTransformation> apply(Optional<? extends IModelPart> part);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.util.EnumFacing;
|
||||
*/
|
||||
public interface ITransformation
|
||||
{
|
||||
Matrix4f getMatrix();
|
||||
Matrix4f getMatrixVec();
|
||||
|
||||
EnumFacing rotate(EnumFacing facing);
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static Matrix4f getMatrix(EnumFacing facing)
|
||||
{
|
||||
return getRotation(facing).getMatrix();
|
||||
return getRotation(facing).getMatrixVec();
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -153,15 +153,15 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||
{
|
||||
if (this.isIdentity()) return b;
|
||||
if (b.isIdentity()) return this;
|
||||
Matrix4f m = getMatrix();
|
||||
m.mul(b.getMatrix());
|
||||
Matrix4f m = getMatrixVec();
|
||||
m.mul(b.getMatrixVec());
|
||||
return new TRSRTransformation(m);
|
||||
}
|
||||
|
||||
public TRSRTransformation inverse()
|
||||
{
|
||||
if (this.isIdentity()) return this;
|
||||
Matrix4f m = getMatrix();
|
||||
Matrix4f m = getMatrixVec();
|
||||
m.invert();
|
||||
return new TRSRTransformation(m);
|
||||
}
|
||||
@@ -547,7 +547,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||
}
|
||||
|
||||
@Override
|
||||
public Matrix4f getMatrix()
|
||||
public Matrix4f getMatrixVec()
|
||||
{
|
||||
return (Matrix4f)matrix.clone();
|
||||
}
|
||||
@@ -645,7 +645,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||
{
|
||||
if (transform.isIdentity()) return transform;
|
||||
|
||||
Matrix4f ret = new Matrix4f(transform.getMatrix()), tmp = new Matrix4f();
|
||||
Matrix4f ret = new Matrix4f(transform.getMatrixVec()), tmp = new Matrix4f();
|
||||
tmp.setIdentity();
|
||||
tmp.m03 = tmp.m13 = tmp.m23 = .5f;
|
||||
ret.mul(tmp, ret);
|
||||
@@ -661,7 +661,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||
{
|
||||
if (transform.isIdentity()) return transform;
|
||||
|
||||
Matrix4f ret = new Matrix4f(transform.getMatrix()), tmp = new Matrix4f();
|
||||
Matrix4f ret = new Matrix4f(transform.getMatrixVec()), tmp = new Matrix4f();
|
||||
tmp.setIdentity();
|
||||
tmp.m03 = tmp.m13 = tmp.m23 = -.5f;
|
||||
ret.mul(tmp, ret);
|
||||
@@ -692,28 +692,28 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static Vector3f toVecmath(net.minecraft.client.renderer.Vector3f vec)
|
||||
{
|
||||
return new Vector3f(vec.func_195899_a(), vec.func_195900_b(), vec.func_195902_c());
|
||||
return new Vector3f(vec.getX(), vec.getY(), vec.getZ());
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static Vector4f toVecmath(net.minecraft.client.renderer.Vector4f vec)
|
||||
{
|
||||
return new Vector4f(vec.func_195910_a(), vec.func_195913_b(), vec.func_195914_c(), vec.func_195915_d());
|
||||
return new Vector4f(vec.getX(), vec.getY(), vec.getZ(), vec.getW());
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static Matrix4f toVecmath(net.minecraft.client.renderer.Matrix4f m)
|
||||
{
|
||||
return new Matrix4f(
|
||||
m.func_195885_a(0, 0), m.func_195885_a(1, 0), m.func_195885_a(2, 0), m.func_195885_a(3, 0),
|
||||
m.func_195885_a(0, 1), m.func_195885_a(1, 1), m.func_195885_a(2, 1), m.func_195885_a(3, 1),
|
||||
m.func_195885_a(0, 2), m.func_195885_a(1, 2), m.func_195885_a(2, 2), m.func_195885_a(3, 2),
|
||||
m.func_195885_a(0, 3), m.func_195885_a(1, 3), m.func_195885_a(2, 3), m.func_195885_a(3, 3));
|
||||
m.get(0, 0), m.get(1, 0), m.get(2, 0), m.get(3, 0),
|
||||
m.get(0, 1), m.get(1, 1), m.get(2, 1), m.get(3, 1),
|
||||
m.get(0, 2), m.get(1, 2), m.get(2, 2), m.get(3, 2),
|
||||
m.get(0, 3), m.get(1, 3), m.get(2, 3), m.get(3, 3));
|
||||
}
|
||||
|
||||
public static Quat4f toVecmath(net.minecraft.client.renderer.Quaternion q)
|
||||
{
|
||||
return new Quat4f(q.func_195889_a(), q.func_195891_b(), q.func_195893_c(), q.func_195894_d());
|
||||
return new Quat4f(q.getX(), q.getY(), q.getZ(), q.getW());
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -738,7 +738,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||
m.getRow(x, row);
|
||||
for (int y = 0; y < 4; y++)
|
||||
{
|
||||
r.func_195878_a(x, y, row[y]);
|
||||
r.set(x, y, row[y]);
|
||||
}
|
||||
}
|
||||
return r;
|
||||
|
||||
@@ -218,13 +218,13 @@ public final class AnimationStateMachine implements IAnimationStateMachine
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static IAnimationStateMachine load(IResourceManager manager, ResourceLocation location, ImmutableMap<String, ITimeValue> customParameters)
|
||||
{
|
||||
try (IResource resource = manager.func_199002_a(location))
|
||||
try (IResource resource = manager.getResource(location))
|
||||
{
|
||||
ClipResolver clipResolver = new ClipResolver();
|
||||
ParameterResolver parameterResolver = new ParameterResolver(customParameters);
|
||||
Clips.CommonClipTypeAdapterFactory.INSTANCE.setClipResolver(clipResolver);
|
||||
TimeValues.CommonTimeValueTypeAdapterFactory.INSTANCE.setValueResolver(parameterResolver);
|
||||
AnimationStateMachine asm = asmGson.fromJson(new InputStreamReader(resource.func_199027_b(), StandardCharsets.UTF_8), AnimationStateMachine.class);
|
||||
AnimationStateMachine asm = asmGson.fromJson(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8), AnimationStateMachine.class);
|
||||
clipResolver.asm = asm;
|
||||
parameterResolver.asm = asm;
|
||||
asm.initialize();
|
||||
|
||||
@@ -580,4 +580,4 @@ public final class Clips
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,4 +44,4 @@ public class FluidIdRegistryMessageHandler extends SimpleChannelInboundHandler<F
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
*/
|
||||
@@ -56,4 +56,4 @@ public class ForgeNetworkHandler
|
||||
clientChannel.pipeline().addAfter(handlerName, "FluidIdRegistryHandler", new FluidIdRegistryMessageHandler());
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
@@ -41,4 +41,4 @@ public class ForgeRuntimeCodec extends FMLIndexedMessageToMessageCodec<ForgeMess
|
||||
msg.fromBytes(source);
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
+1
-1
@@ -36,4 +36,4 @@ public class ServerToClientConnectionEstablishedHandler extends ChannelInboundHa
|
||||
ctx.fireUserEventTriggered(evt);
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
@@ -99,9 +99,9 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public <T extends Comparable<T>, V extends T> S func_206870_a(@Nonnull IProperty<T> property, @Nonnull V value)
|
||||
public <T extends Comparable<T>, V extends T> S with(@Nonnull IProperty<T> property, @Nonnull V value)
|
||||
{
|
||||
S clean = super.func_206870_a(property, value);
|
||||
S clean = super.with(property, value);
|
||||
if (clean == this.cleanState) {
|
||||
return (S) this;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
|
||||
return clean;
|
||||
}
|
||||
|
||||
return (S) new ExtendedStateHolder(field_206876_a, ((IStateHolder)clean).func_206871_b(), unlistedProperties, this.cleanState);
|
||||
return (S) new ExtendedStateHolder(object, ((IStateHolder)clean).getValues(), unlistedProperties, this.cleanState);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,7 +128,7 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
|
||||
}
|
||||
if (!property.isValid(value))
|
||||
{
|
||||
throw new IllegalArgumentException("Cannot set unlisted property " + property + " to " + value + " on object " + field_206876_a + ", it is not an allowed value");
|
||||
throw new IllegalArgumentException("Cannot set unlisted property " + property + " to " + value + " on object " + object + ", it is not an allowed value");
|
||||
}
|
||||
boolean clean = true;
|
||||
ImmutableMap.Builder<IUnlistedProperty<?>, Optional<?>> builder = ImmutableMap.builder();
|
||||
@@ -143,7 +143,7 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
|
||||
{ // no dynamic properties, lookup normal state
|
||||
return (S) cleanState;
|
||||
}
|
||||
return (S) new ExtendedStateHolder(field_206876_a, func_206871_b(), builder.build(), this.cleanState);
|
||||
return (S) new ExtendedStateHolder(object, getValues(), builder.build(), this.cleanState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -63,7 +63,7 @@ public class BlockSnapshot
|
||||
public BlockSnapshot(World world, BlockPos pos, IBlockState state, @Nullable NBTTagCompound nbt)
|
||||
{
|
||||
this.setWorld(world);
|
||||
this.dimId = world.provider.getId();
|
||||
this.dimId = world.dimension.getId();
|
||||
this.pos = pos.toImmutable();
|
||||
this.setReplacedBlock(state);
|
||||
this.registryName = state.getBlock().getRegistryName();
|
||||
@@ -113,12 +113,12 @@ public class BlockSnapshot
|
||||
public static BlockSnapshot readFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
return new BlockSnapshot(
|
||||
tag.getInteger("dimension"),
|
||||
new BlockPos(tag.getInteger("posX"), tag.getInteger("posY"), tag.getInteger("posZ")),
|
||||
tag.getInt("dimension"),
|
||||
new BlockPos(tag.getInt("posX"), tag.getInt("posY"), tag.getInt("posZ")),
|
||||
new ResourceLocation(tag.getString("blockMod"), tag.getString("blockName")),
|
||||
tag.getInteger("metadata"),
|
||||
tag.getInteger("flag"),
|
||||
tag.getBoolean("hasTE") ? tag.getCompoundTag("tileEntity") : null);
|
||||
tag.getInt("metadata"),
|
||||
tag.getInt("flag"),
|
||||
tag.getBoolean("hasTE") ? tag.getCompound("tileEntity") : null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -126,7 +126,7 @@ public class BlockSnapshot
|
||||
{
|
||||
if (te == null) return null;
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
te.writeToNBT(nbt);
|
||||
te.write(nbt);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public class BlockSnapshot
|
||||
{
|
||||
if (this.replacedBlock == null)
|
||||
{
|
||||
this.replacedBlock = ForgeRegistries.BLOCKS.getValue(getRegistryName()).func_196257_b(getMeta());
|
||||
this.replacedBlock = ForgeRegistries.BLOCKS.getValue(getRegistryName()).getStateById(getMeta());
|
||||
}
|
||||
return this.replacedBlock;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ public class BlockSnapshot
|
||||
@Nullable
|
||||
public TileEntity getTileEntity()
|
||||
{
|
||||
return getNbt() != null ? TileEntity.func_203403_c(getNbt()) : null;
|
||||
return getNbt() != null ? TileEntity.create(getNbt()) : null;
|
||||
}
|
||||
|
||||
public boolean restore()
|
||||
@@ -202,7 +202,7 @@ public class BlockSnapshot
|
||||
te = world.getTileEntity(pos);
|
||||
if (te != null)
|
||||
{
|
||||
te.readFromNBT(getNbt());
|
||||
te.read(getNbt());
|
||||
te.markDirty();
|
||||
}
|
||||
}
|
||||
@@ -218,12 +218,12 @@ public class BlockSnapshot
|
||||
{
|
||||
compound.setString("blockMod", getRegistryName().getNamespace());
|
||||
compound.setString("blockName", getRegistryName().getPath());
|
||||
compound.setInteger("posX", getPos().getX());
|
||||
compound.setInteger("posY", getPos().getY());
|
||||
compound.setInteger("posZ", getPos().getZ());
|
||||
compound.setInteger("flag", getFlag());
|
||||
compound.setInteger("dimension", getDimId());
|
||||
compound.setInteger("metadata", getMeta());
|
||||
compound.setInt("posX", getPos().getX());
|
||||
compound.setInt("posY", getPos().getY());
|
||||
compound.setInt("posZ", getPos().getZ());
|
||||
compound.setInt("flag", getFlag());
|
||||
compound.setInt("dimension", getDimId());
|
||||
compound.setInt("metadata", getMeta());
|
||||
|
||||
compound.setBoolean("hasTE", getNbt() != null);
|
||||
|
||||
|
||||
@@ -77,4 +77,4 @@ public class ChunkCoordComparator implements java.util.Comparator<ChunkPos>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public class Constants
|
||||
* NBT Tag type IDS, used when storing the nbt to disc, Should align with NBTBase.getId,
|
||||
* table used in NBTBase.func_150283_g
|
||||
*
|
||||
* Main use is checking tag type in NBTTagCompound.func_150297_b(String, int)
|
||||
* Main use is checking tag type in NBTTagCompound.contains(String, int)
|
||||
*
|
||||
*/
|
||||
public static class NBT
|
||||
|
||||
@@ -38,7 +38,7 @@ public class FakePlayer extends EntityPlayerMP
|
||||
{
|
||||
public FakePlayer(WorldServer world, GameProfile name)
|
||||
{
|
||||
super(world.getMinecraftServer(), world, name, new PlayerInteractionManager(world));
|
||||
super(world.getServer(), world, name, new PlayerInteractionManager(world));
|
||||
}
|
||||
|
||||
@Override public Vec3d getPositionVector(){ return new Vec3d(0, 0, 0); }
|
||||
@@ -46,10 +46,10 @@ public class FakePlayer extends EntityPlayerMP
|
||||
@Override public void sendMessage(ITextComponent component) {}
|
||||
@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(DamageSource source){ return true; }
|
||||
@Override public boolean isInvulnerableTo(DamageSource source){ return true; }
|
||||
@Override public boolean canAttackPlayer(EntityPlayer player){ return false; }
|
||||
@Override public void onDeath(DamageSource source){ return; }
|
||||
@Override public void onUpdate(){ return; }
|
||||
@Override public void tick(){ return; }
|
||||
@Override public Entity changeDimension(int dim, ITeleporter teleporter){ return this; }
|
||||
@Override public void handleClientSettings(CPacketClientSettings pkt){ return; }
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class PacketUtil
|
||||
|
||||
if (stack.getItem().isDamageable() || stack.getItem().getShareTag())
|
||||
{
|
||||
nbttagcompound = stack.getTagCompound();
|
||||
nbttagcompound = stack.getTag();
|
||||
}
|
||||
|
||||
buffer.writeCompoundTag(nbttagcompound);
|
||||
|
||||
@@ -44,7 +44,7 @@ public class WorldCapabilityData extends WorldSavedData
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
public void read(NBTTagCompound nbt)
|
||||
{
|
||||
this.capNBT = nbt;
|
||||
if (serializable != null)
|
||||
@@ -55,7 +55,7 @@ public class WorldCapabilityData extends WorldSavedData
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
|
||||
public NBTTagCompound write(NBTTagCompound nbt)
|
||||
{
|
||||
if (serializable != null)
|
||||
nbt = serializable.serializeNBT();
|
||||
|
||||
Reference in new issue
Block a user