Skip to content

Commit

Permalink
Add patches for 1.7.10
Browse files Browse the repository at this point in the history
Using custom mappings for mcp908
  • Loading branch information
irtimaled committed Feb 23, 2015
1 parent 35d361a commit 9ae3cd8
Show file tree
Hide file tree
Showing 14 changed files with 465 additions and 1 deletion.
3 changes: 2 additions & 1 deletion java/com/irtimaled/bbor/DimensionProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ public synchronized void refresh() {
private Set<BlockPos> getDoorsFromVillage(Village village) {
Set<BlockPos> doors = new HashSet<BlockPos>();
for (Object doorInfo : village.getVillageDoorInfoList()) {
doors.add(((VillageDoorInfo) doorInfo).getDoorBlockPos());
VillageDoorInfo villageDoorInfo = (VillageDoorInfo) doorInfo;
doors.add(villageDoorInfo.getDoorBlockPos());
}
return doors;
}
Expand Down
22 changes: 22 additions & 0 deletions patches/1.7.10/com.irtimaled.bbor.BoundingBox.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff -r -U 3 src/minecraft/com/irtimaled/bbor/BoundingBox.java src copy/minecraft/com/irtimaled/bbor/BoundingBox.java
--- src/minecraft/com/irtimaled/bbor/BoundingBox.java 2015-02-05 22:46:15.000000000 +0000
+++ src copy/minecraft/com/irtimaled/bbor/BoundingBox.java 2015-02-23 16:05:40.000000000 +0000
@@ -51,12 +51,12 @@
}

public AxisAlignedBB toAxisAlignedBB(boolean extendMaxByOne) {
- AxisAlignedBB axisAlignedBB = AxisAlignedBB.fromBounds(minBlockPos.getX(),
- minBlockPos.getY(),
- minBlockPos.getZ(),
- maxBlockPos.getX(),
- maxBlockPos.getY(),
- maxBlockPos.getZ());
+ AxisAlignedBB axisAlignedBB = AxisAlignedBB.getBoundingBox(minBlockPos.posX,
+ minBlockPos.posY,
+ minBlockPos.posZ,
+ maxBlockPos.posX,
+ maxBlockPos.posY,
+ maxBlockPos.posZ);
if (extendMaxByOne)
return axisAlignedBB.addCoord(1, 1, 1);
return axisAlignedBB;
16 changes: 16 additions & 0 deletions patches/1.7.10/com.irtimaled.bbor.BoundingBoxSlimeChunk.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff -r -U 3 src/minecraft/com/irtimaled/bbor/BoundingBoxSlimeChunk.java src copy/minecraft/com/irtimaled/bbor/BoundingBoxSlimeChunk.java
--- src/minecraft/com/irtimaled/bbor/BoundingBoxSlimeChunk.java 2015-02-05 22:46:15.000000000 +0000
+++ src copy/minecraft/com/irtimaled/bbor/BoundingBoxSlimeChunk.java 2015-02-23 16:05:40.000000000 +0000
@@ -11,8 +11,10 @@
}

public static BoundingBoxSlimeChunk from(ChunkCoordIntPair chunkCoordIntPair, Color color) {
- BlockPos minBlockPos = new BlockPos(chunkCoordIntPair.getXStart(), 1, chunkCoordIntPair.getZStart());
- BlockPos maxBlockPos = new BlockPos(chunkCoordIntPair.getXEnd(), 38, chunkCoordIntPair.getZEnd());
+ int chunkXStart = chunkCoordIntPair.chunkXPos << 4;
+ int chunkZStart = chunkCoordIntPair.chunkZPos << 4;
+ BlockPos minBlockPos = new BlockPos(chunkXStart, 1, chunkZStart);
+ BlockPos maxBlockPos = new BlockPos(chunkXStart + 15, 38, chunkZStart + 15);
return new BoundingBoxSlimeChunk(minBlockPos, maxBlockPos, color);
}

22 changes: 22 additions & 0 deletions patches/1.7.10/com.irtimaled.bbor.BoundingBoxVillage.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff -r -U 3 src/minecraft/com/irtimaled/bbor/BoundingBoxVillage.java src copy/minecraft/com/irtimaled/bbor/BoundingBoxVillage.java
--- src/minecraft/com/irtimaled/bbor/BoundingBoxVillage.java 2015-02-23 15:07:53.000000000 +0000
+++ src copy/minecraft/com/irtimaled/bbor/BoundingBoxVillage.java 2015-02-23 16:05:40.000000000 +0000
@@ -29,12 +29,12 @@
}

public static BoundingBoxVillage from(BlockPos center, Integer radius, Color color, boolean spawnsIronGolems, Set<BlockPos> doors) {
- BlockPos minBlockPos = new BlockPos(center.getX() - radius,
- center.getY() - 4,
- center.getZ() - radius);
- BlockPos maxBlockPos = new BlockPos(center.getX() + radius,
- center.getY() + 4,
- center.getZ() + radius);
+ BlockPos minBlockPos = new BlockPos(center.posX - radius,
+ center.posY - 4,
+ center.posZ - radius);
+ BlockPos maxBlockPos = new BlockPos(center.posX + radius,
+ center.posY + 4,
+ center.posZ + radius);
if (color == null)
color = getNextColor();
return new BoundingBoxVillage(center, radius, color, spawnsIronGolems, doors, minBlockPos, maxBlockPos);
241 changes: 241 additions & 0 deletions patches/1.7.10/com.irtimaled.bbor.ClientProxy.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
diff -r -U 3 src/minecraft/com/irtimaled/bbor/ClientProxy.java src copy/minecraft/com/irtimaled/bbor/ClientProxy.java
--- src/minecraft/com/irtimaled/bbor/ClientProxy.java 2015-02-23 15:36:23.000000000 +0000
+++ src copy/minecraft/com/irtimaled/bbor/ClientProxy.java 2015-02-23 16:16:23.000000000 +0000
@@ -70,7 +70,7 @@
playerZ = entityPlayer.lastTickPosZ + (entityPlayer.posZ - entityPlayer.lastTickPosZ) * (double) partialTicks;

if (this.active) {
- int activeDimensionId = entityPlayer.worldObj.provider.getDimensionId();
+ int activeDimensionId = entityPlayer.worldObj.provider.dimensionId;
if (boundingBoxCacheMap.containsKey(activeDimensionId)) {
renderBoundingBoxes(boundingBoxCacheMap.get(activeDimensionId).getBoundingBoxes());
}
@@ -114,9 +114,6 @@
if (configManager.drawWitchHuts.getBoolean()) {
loadStructureNbtFile(localStructuresFolder, cache, "Temple.dat", StructureType.WitchHut.getColor(), "TeSH");
}
- if (configManager.drawOceanMonuments.getBoolean()) {
- loadStructureNbtFile(localStructuresFolder, cache, "Monument.dat", StructureType.OceanMonument.getColor(), "*");
- }
if (configManager.drawMineShafts.getBoolean()) {
loadStructureNbtFile(localStructuresFolder, cache, "Mineshaft.dat", StructureType.MineShaft.getColor(), "*");
}
@@ -274,8 +271,8 @@
Set activeChunks = getActiveChunks(world);
for (BoundingBox bb : bbList) {

- if (activeChunks.contains(world.getChunkFromBlockCoords(bb.getMinBlockPos()).getChunkCoordIntPair()) ||
- activeChunks.contains(world.getChunkFromBlockCoords(bb.getMaxBlockPos()).getChunkCoordIntPair())) {
+ if (activeChunks.contains(world.getChunkFromBlockCoords(bb.getMinBlockPos().posX, bb.getMinBlockPos().posZ).getChunkCoordIntPair()) ||
+ activeChunks.contains(world.getChunkFromBlockCoords(bb.getMaxBlockPos().posX, bb.getMaxBlockPos().posZ).getChunkCoordIntPair())) {

if (bb instanceof BoundingBoxVillage) {
BoundingBoxVillage villageBB = (BoundingBoxVillage) bb;
@@ -341,7 +338,7 @@
}

private void renderRectangle(AxisAlignedBB aaBB, double minY, double maxY, Color color, Boolean fill) {
- aaBB = new AxisAlignedBB(aaBB.minX, minY, aaBB.minZ, aaBB.maxX, maxY, aaBB.maxZ);
+ aaBB = AxisAlignedBB.getBoundingBox(aaBB.minX, minY, aaBB.minZ, aaBB.maxX, maxY, aaBB.maxZ);
renderCuboid(aaBB, color, fill);
}

@@ -351,12 +348,12 @@

private void renderIronGolemSpawnArea(BoundingBoxVillage villageBB) {
BlockPos center = villageBB.getCenter();
- AxisAlignedBB abb = new AxisAlignedBB(new BlockPos(center.getX() - 8,
- center.getY() - 3,
- center.getZ() - 8),
- new BlockPos(center.getX() + 8,
- center.getY() + 3,
- center.getZ() + 8));
+ AxisAlignedBB abb = AxisAlignedBB.getBoundingBox(center.posX - 8,
+ center.posY - 3,
+ center.posZ - 8,
+ center.posX + 8,
+ center.posY + 3,
+ center.posZ + 8);
renderCuboid(abb.addCoord(1, 1, 1), villageBB.getColor(), false);
}

@@ -364,21 +361,20 @@
OffsetPoint center = new OffsetPoint(villageBB.getCenter());
Color color = villageBB.getColor();
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
- Tessellator tessellator = Tessellator.getInstance();
- WorldRenderer worldRenderer = tessellator.getWorldRenderer();
+ Tessellator tessellator = Tessellator.instance;

int colorR = color.getRed();
int colorG = color.getGreen();
int colorB = color.getBlue();

- worldRenderer.startDrawing(GL11.GL_LINES);
- worldRenderer.setColorRGBA(colorR, colorG, colorB, 255);
+ tessellator.startDrawing(GL11.GL_LINES);
+ tessellator.setColorRGBA(colorR, colorG, colorB, 255);
for (BlockPos door : villageBB.getDoors()) {
OffsetPoint point = new OffsetPoint(door);


- worldRenderer.addVertex(point.getX(), point.getY(), point.getZ());
- worldRenderer.addVertex(center.getX(), center.getY(), center.getZ());
+ tessellator.addVertex(point.getX(), point.getY(), point.getZ());
+ tessellator.addVertex(center.getX(), center.getY(), center.getZ());
}
tessellator.draw();
}
@@ -406,63 +402,62 @@
}

private void renderCuboid(AxisAlignedBB bb, int alphaChannel, Color color) {
- Tessellator tessellator = Tessellator.getInstance();
- WorldRenderer worldRenderer = tessellator.getWorldRenderer();
+ Tessellator tessellator = Tessellator.instance;

int colorR = color.getRed();
int colorG = color.getGreen();
int colorB = color.getBlue();

- worldRenderer.startDrawing(GL11.GL_QUADS);
- worldRenderer.setColorRGBA(colorR, colorG, colorB, alphaChannel);
- worldRenderer.addVertex(bb.minX, bb.minY, bb.minZ);
- worldRenderer.addVertex(bb.maxX, bb.minY, bb.minZ);
- worldRenderer.addVertex(bb.maxX, bb.minY, bb.maxZ);
- worldRenderer.addVertex(bb.minX, bb.minY, bb.maxZ);
+ tessellator.startDrawing(GL11.GL_QUADS);
+ tessellator.setColorRGBA(colorR, colorG, colorB, alphaChannel);
+ tessellator.addVertex(bb.minX, bb.minY, bb.minZ);
+ tessellator.addVertex(bb.maxX, bb.minY, bb.minZ);
+ tessellator.addVertex(bb.maxX, bb.minY, bb.maxZ);
+ tessellator.addVertex(bb.minX, bb.minY, bb.maxZ);
tessellator.draw();

if (bb.minY == bb.maxY) {
return;
}

- worldRenderer.startDrawing(GL11.GL_QUADS);
- worldRenderer.setColorRGBA(colorR, colorG, colorB, alphaChannel);
- worldRenderer.addVertex(bb.minX, bb.maxY, bb.minZ);
- worldRenderer.addVertex(bb.maxX, bb.maxY, bb.minZ);
- worldRenderer.addVertex(bb.maxX, bb.maxY, bb.maxZ);
- worldRenderer.addVertex(bb.minX, bb.maxY, bb.maxZ);
+ tessellator.startDrawing(GL11.GL_QUADS);
+ tessellator.setColorRGBA(colorR, colorG, colorB, alphaChannel);
+ tessellator.addVertex(bb.minX, bb.maxY, bb.minZ);
+ tessellator.addVertex(bb.maxX, bb.maxY, bb.minZ);
+ tessellator.addVertex(bb.maxX, bb.maxY, bb.maxZ);
+ tessellator.addVertex(bb.minX, bb.maxY, bb.maxZ);
tessellator.draw();

- worldRenderer.startDrawing(GL11.GL_QUADS);
- worldRenderer.setColorRGBA(colorR, colorG, colorB, alphaChannel);
- worldRenderer.addVertex(bb.minX, bb.minY, bb.maxZ);
- worldRenderer.addVertex(bb.minX, bb.maxY, bb.maxZ);
- worldRenderer.addVertex(bb.maxX, bb.maxY, bb.maxZ);
- worldRenderer.addVertex(bb.maxX, bb.minY, bb.maxZ);
+ tessellator.startDrawing(GL11.GL_QUADS);
+ tessellator.setColorRGBA(colorR, colorG, colorB, alphaChannel);
+ tessellator.addVertex(bb.minX, bb.minY, bb.maxZ);
+ tessellator.addVertex(bb.minX, bb.maxY, bb.maxZ);
+ tessellator.addVertex(bb.maxX, bb.maxY, bb.maxZ);
+ tessellator.addVertex(bb.maxX, bb.minY, bb.maxZ);
tessellator.draw();

- worldRenderer.startDrawing(GL11.GL_QUADS);
- worldRenderer.setColorRGBA(colorR, colorG, colorB, alphaChannel);
- worldRenderer.addVertex(bb.minX, bb.minY, bb.minZ);
- worldRenderer.addVertex(bb.minX, bb.maxY, bb.minZ);
- worldRenderer.addVertex(bb.maxX, bb.maxY, bb.minZ);
- worldRenderer.addVertex(bb.maxX, bb.minY, bb.minZ);
+ tessellator.startDrawing(GL11.GL_QUADS);
+ tessellator.setColorRGBA(colorR, colorG, colorB, alphaChannel);
+ tessellator.addVertex(bb.minX, bb.minY, bb.minZ);
+ tessellator.addVertex(bb.minX, bb.maxY, bb.minZ);
+ tessellator.addVertex(bb.maxX, bb.maxY, bb.minZ);
+ tessellator.addVertex(bb.maxX, bb.minY, bb.minZ);
tessellator.draw();

- worldRenderer.startDrawing(GL11.GL_QUADS);
- worldRenderer.setColorRGBA(colorR, colorG, colorB, alphaChannel);
- worldRenderer.addVertex(bb.minX, bb.minY, bb.minZ);
- worldRenderer.addVertex(bb.minX, bb.minY, bb.maxZ);
- worldRenderer.addVertex(bb.minX, bb.maxY, bb.maxZ);
- worldRenderer.addVertex(bb.minX, bb.maxY, bb.minZ);
+ tessellator.startDrawing(GL11.GL_QUADS);
+ tessellator.setColorRGBA(colorR, colorG, colorB, alphaChannel);
+ tessellator.addVertex(bb.minX, bb.minY, bb.minZ);
+ tessellator.addVertex(bb.minX, bb.minY, bb.maxZ);
+ tessellator.addVertex(bb.minX, bb.maxY, bb.maxZ);
+ tessellator.addVertex(bb.minX, bb.maxY, bb.minZ);
tessellator.draw();

- worldRenderer.startDrawing(GL11.GL_QUADS);
- worldRenderer.setColorRGBA(colorR, colorG, colorB, alphaChannel);
- worldRenderer.addVertex(bb.maxX, bb.minY, bb.minZ);
- worldRenderer.addVertex(bb.maxX, bb.minY, bb.maxZ);
- worldRenderer.addVertex(bb.maxX, bb.maxY, bb.maxZ);
- worldRenderer.addVertex(bb.maxX, bb.maxY, bb.minZ);
+ tessellator.startDrawing(GL11.GL_QUADS);
+ tessellator.setColorRGBA(colorR, colorG, colorB, alphaChannel);
+ tessellator.addVertex(bb.maxX, bb.minY, bb.minZ);
+ tessellator.addVertex(bb.maxX, bb.minY, bb.maxZ);
+ tessellator.addVertex(bb.maxX, bb.maxY, bb.maxZ);
+ tessellator.addVertex(bb.maxX, bb.maxY, bb.minZ);
tessellator.draw();
}

@@ -488,12 +483,11 @@
GL11.glEnable(GL11.GL_POINT_SMOOTH);
GL11.glPointSize(2f);

- Tessellator tessellator = Tessellator.getInstance();
- WorldRenderer worldRenderer = tessellator.getWorldRenderer();
- worldRenderer.startDrawing(GL11.GL_POINTS);
- worldRenderer.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 255);
+ Tessellator tessellator = Tessellator.instance;
+ tessellator.startDrawing(GL11.GL_POINTS);
+ tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 255);
for (OffsetPoint point : buildPoints(center, radius)) {
- worldRenderer.addVertex(point.getX(), point.getY(), point.getZ());
+ tessellator.addVertex(point.getX(), point.getY(), point.getZ());
}
tessellator.draw();
}
@@ -510,9 +504,9 @@
}

public OffsetPoint(BlockPos blockPos) {
- x = blockPos.getX();
- y = blockPos.getY();
- z = blockPos.getZ();
+ x = blockPos.posX;
+ y = blockPos.posY;
+ z = blockPos.posZ;
}

public double getX() {
@@ -555,7 +549,7 @@
Set<BoundingBox> boundingBoxes = new HashSet<BoundingBox>();
if (worldData != null) {
World world = Minecraft.getMinecraft().theWorld;
- int dimensionId = world.provider.getDimensionId();
+ int dimensionId = world.provider.dimensionId;
if (dimensionId == 0) {
if (configManager.drawWorldSpawn.getBoolean()) {
boundingBoxes.add(getWorldSpawnBoundingBox(worldData.getSpawnX(), worldData.getSpawnZ()));
@@ -606,9 +600,9 @@

private BoundingBox getSpawnChunksBoundingBox(int spawnX, int spawnZ, int size, Color color) {
double chunkSize = 16;
- double midOffset = chunkSize * (size / 2);
- double midX = Math.round((float) (spawnX / chunkSize)) * chunkSize;
- double midZ = Math.round((float) (spawnZ / chunkSize)) * chunkSize;
+ int midOffset = (int) chunkSize * (size / 2);
+ int midX = Math.round((float) (spawnX / chunkSize)) * (int) chunkSize;
+ int midZ = Math.round((float) (spawnZ / chunkSize)) * (int) chunkSize;
BlockPos minBlockPos = new BlockPos(midX - midOffset, 0, midZ - midOffset);
if (spawnX / chunkSize % 0.5D == 0.0D && spawnZ / chunkSize % 0.5D == 0.0D) {
midX += chunkSize;
20 changes: 20 additions & 0 deletions patches/1.7.10/com.irtimaled.bbor.CommonProxy.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff -r -U 3 src/minecraft/com/irtimaled/bbor/CommonProxy.java src copy/minecraft/com/irtimaled/bbor/CommonProxy.java
--- src/minecraft/com/irtimaled/bbor/CommonProxy.java 2015-02-23 14:01:07.000000000 +0000
+++ src copy/minecraft/com/irtimaled/bbor/CommonProxy.java 2015-02-23 16:05:40.000000000 +0000
@@ -25,14 +25,14 @@
if (chunkProvider instanceof ChunkProviderServer) {
chunkProvider = ReflectionHelper.getPrivateValue(ChunkProviderServer.class, (ChunkProviderServer) chunkProvider, IChunkProvider.class);
setWorldData(new WorldData(world.getSeed(), world.getWorldInfo().getSpawnX(), world.getWorldInfo().getSpawnZ()));
- int dimensionId = world.provider.getDimensionId();
+ int dimensionId = world.provider.dimensionId;
Logger.info("create world dimension: %d, %s (chunkprovider: %s) (seed: %d)", dimensionId, world.getClass().toString(), chunkProvider.getClass().toString(), worldData.getSeed());
boundingBoxCacheMap.put(dimensionId, new DimensionProcessor(eventHandler, configManager, world, dimensionId, chunkProvider));
}
}

public void chunkLoaded(Chunk chunk) {
- int dimensionId = chunk.getWorld().provider.getDimensionId();
+ int dimensionId = chunk.worldObj.provider.dimensionId;
if (boundingBoxCacheMap.containsKey(dimensionId)) {
boundingBoxCacheMap.get(dimensionId).refresh();
}
19 changes: 19 additions & 0 deletions patches/1.7.10/com.irtimaled.bbor.ConfigManager.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff -r -U 3 src/minecraft/com/irtimaled/bbor/ConfigManager.java src copy/minecraft/com/irtimaled/bbor/ConfigManager.java
--- src/minecraft/com/irtimaled/bbor/ConfigManager.java 2015-02-23 15:36:23.000000000 +0000
+++ src copy/minecraft/com/irtimaled/bbor/ConfigManager.java 2015-02-23 16:05:40.000000000 +0000
@@ -16,7 +16,6 @@
public Setting drawStrongholds;
public Setting drawMineShafts;
public Setting drawNetherFortresses;
- public Setting drawOceanMonuments;
public Setting alwaysVisible;
public Setting renderVillageAsSphere;
public Setting drawIronGolemSpawnArea;
@@ -48,7 +47,6 @@
drawStrongholds = SetupBooleanProperty(config, "features", "drawStrongholds", false, "If set to true stronghold bounding boxes are drawn. (default: false)");
drawMineShafts = SetupBooleanProperty(config, "features", "drawMineShafts", false, "If set to true mineshaft bounding boxes are drawn. (default: false)");
drawNetherFortresses = SetupBooleanProperty(config, "features", "drawNetherFortresses", true, "If set to true nether fortress bounding boxes are drawn. (default: true)");
- drawOceanMonuments = SetupBooleanProperty(config, "features", "drawOceanMonuments", true, "If set to true ocean monument bounding boxes are drawn. (default: true)");
drawSlimeChunks = SetupBooleanProperty(config, "features", "drawSlimeChunks", true, "If set to true slime chunks bounding boxes are drawn. (default: true)");
slimeChunkMaxY = SetupIntegerProperty(config, "features", "slimeChunkMaxY", -1, "The maximum top of the slime chunk bounding box. If set to -1 it will use the value when activated, if set to 0 it will always track the player's feet. (default: -1)");
drawWorldSpawn = SetupBooleanProperty(config, "features", "drawWorldSpawn", true, "If set to true world spawn and spawn chunks bounding boxes are drawn. (default: true)");
Loading

0 comments on commit 9ae3cd8

Please sign in to comment.