Skip to content

Commit cf5ca70

Browse files
committed
and now make this work for 1.10.2
1 parent 9e97684 commit cf5ca70

File tree

15 files changed

+30
-32
lines changed

15 files changed

+30
-32
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ javadoc {
3434

3535
description = 'OreSpawn'
3636
def mod_file = getModFile()
37-
def mc_version = "1.11.2"
37+
def mc_version = "1.10.2"
3838
def short_version = getVersion("VERSION", mod_file)
3939
version = mc_version + "-" + short_version
4040
if (System.getenv().BUILD_NUMBER) {
@@ -69,9 +69,9 @@ if (secretFile.exists()) {
6969
}
7070

7171
minecraft {
72-
version = '1.11.2-13.20.1.2386'
72+
version = '1.10.2-12.18.3.2185'
7373
runDir = 'run'
74-
mappings = 'stable_32'
74+
mappings = 'stable_29'
7575
// coreMod = ""
7676
makeObfSourceJar = false
7777
}

src/main/java/com/mcmoddev/orespawn/EventHandlers.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void onChunkSave(ChunkDataEvent.Save ev) {
9292
.map(feat -> new NBTTagString(feat.getFeatureName()))
9393
.forEach(features::appendTag);
9494

95-
ChunkPos chunkCoords = new ChunkPos(ev.getChunk().x, ev.getChunk().z);
95+
ChunkPos chunkCoords = new ChunkPos(ev.getChunk().xPosition, ev.getChunk().zPosition);
9696

9797
if (!Config.getBoolean(Constants.RETROGEN_KEY) || chunks.contains(chunkCoords)) {
9898
dataTag.setTag(Constants.ORE_TAG, ores);
@@ -105,7 +105,7 @@ public void onChunkSave(ChunkDataEvent.Save ev) {
105105
@SubscribeEvent
106106
public void onChunkLoad(ChunkDataEvent.Load ev) {
107107
World world = ev.getWorld();
108-
ChunkPos chunkCoords = new ChunkPos(ev.getChunk().x, ev.getChunk().z);
108+
ChunkPos chunkCoords = new ChunkPos(ev.getChunk().xPosition, ev.getChunk().zPosition);
109109

110110
doBedrockRetrogen(chunkCoords);
111111

@@ -187,15 +187,15 @@ public void worldTick(WorldTickEvent ev) {
187187
ChunkPos p = chunks.pop();
188188
Random random = new Random(world.getSeed());
189189
// re-seed with something totally new :P
190-
random.setSeed((((random.nextLong() >> 4 + 1) + p.x) + ((random.nextLong() >> 2 + 1) + p.z)) ^ world.getSeed());
190+
random.setSeed((((random.nextLong() >> 4 + 1) + p.chunkXPos) + ((random.nextLong() >> 2 + 1) + p.chunkZPos)) ^ world.getSeed());
191191
ChunkProviderServer chunkProvider = (ChunkProviderServer) world.getChunkProvider();
192192
IChunkGenerator chunkGenerator = ObfuscationReflectionHelper.getPrivateValue(ChunkProviderServer.class, chunkProvider, "field_186029_c", "chunkGenerator");
193-
OreSpawn.API.getGenerator().generate(random, p.x, p.z, world, chunkGenerator, chunkProvider);
193+
OreSpawn.API.getGenerator().generate(random, p.chunkXPos, p.chunkZPos, world, chunkGenerator, chunkProvider);
194194
}
195195

196196
for (int c = 0; c < 5 && !retroChunks.isEmpty(); c++) {
197197
ChunkPos p = retroChunks.pop();
198-
OreSpawn.flatBedrock.retrogen(world, p.x, p.z);
198+
OreSpawn.flatBedrock.retrogen(world, p.chunkXPos, p.chunkZPos);
199199
}
200200
}
201201
}

src/main/java/com/mcmoddev/orespawn/OreSpawn.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
@Mod(modid = Constants.MODID,
4343
name = Constants.NAME,
4444
version = Constants.VERSION,
45-
acceptedMinecraftVersions = "[1.11.2,)")
45+
acceptedMinecraftVersions = "[1.10.2,)")
4646

4747
public class OreSpawn {
4848
@Instance

src/main/java/com/mcmoddev/orespawn/api/GeneratorParameters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public GeneratorParameters(ChunkPos chunkPos, OreList oreList, List<IBlockState>
2626
this.parameters.add(stringJsonElementEntry.getKey(), stringJsonElementEntry.getValue());
2727
}
2828

29-
this.chunk = new ChunkPos(chunkPos.x, chunkPos.z);
29+
this.chunk = new ChunkPos(chunkPos.chunkXPos, chunkPos.chunkZPos);
3030
this.ores = oreList;
3131
this.replacements = ImmutableList.copyOf(replacementBlocks);
3232
this.biomes = biomes;

src/main/java/com/mcmoddev/orespawn/commands/AddOreCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
100100

101101
this.putFile(file, ore, dimension);
102102

103-
player.sendStatusMessage(new TextComponentString("Added " + state.getBlock().getRegistryName().toString() + " to the json"), true);
103+
player.sendStatusMessage(new TextComponentString("Added " + state.getBlock().getRegistryName().toString() + " to the json"));
104104
}
105105

106106
private void setProperties(JsonObject oreArgs, JsonObject newOreArgs) {

src/main/java/com/mcmoddev/orespawn/commands/ClearChunkCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
4848

4949
EntityPlayer player = (EntityPlayer) sender;
5050
Chunk chunk = player.getEntityWorld().getChunkFromBlockCoords(player.getPosition());
51-
ChunkPos chunkPos = chunk.getPos();
51+
ChunkPos chunkPos = chunk.getChunkCoordIntPair();
5252
List<Block> blocks;
5353

5454
boolean flagClassic = args.length > 0 ? args[0].toLowerCase().equalsIgnoreCase("classic") : false;
@@ -64,7 +64,7 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
6464

6565
clearBlocks(chunkPos, blocks, overburden, flagClassic, player);
6666

67-
player.sendStatusMessage(new TextComponentString("chunk " + chunkPos.toString() + " cleared"), true);
67+
player.sendStatusMessage(new TextComponentString("chunk " + chunkPos.toString() + " cleared"));
6868
}
6969

7070
private void clearBlocks(ChunkPos chunkPos, List<Block> blocks, List<Block> overburden, boolean flagClassic, EntityPlayer player) {

src/main/java/com/mcmoddev/orespawn/impl/features/ClusterGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public void generate(World world, IChunkGenerator chunkGenerator, IChunkProvider
4141
BiomeLocation biomes = parameters.getBiomes();
4242

4343
// First, load cached blocks for neighboring chunk ore spawns
44-
int chunkX = pos.x;
45-
int chunkZ = pos.z;
44+
int chunkX = pos.chunkXPos;
45+
int chunkZ = pos.chunkZPos;
4646

4747
mergeDefaults(params, getDefaultParameters());
4848

src/main/java/com/mcmoddev/orespawn/impl/features/DefaultFeatureGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public void generate(World world, IChunkGenerator chunkGenerator, IChunkProvider
3838
BiomeLocation biomes = parameters.getBiomes();
3939

4040
// First, load cached blocks for neighboring chunk ore spawns
41-
int chunkX = pos.x;
42-
int chunkZ = pos.z;
41+
int chunkX = pos.chunkXPos;
42+
int chunkZ = pos.chunkZPos;
4343

4444
mergeDefaults(params, getDefaultParameters());
4545

src/main/java/com/mcmoddev/orespawn/impl/features/NormalCloudGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public void generate(World world, IChunkGenerator chunkGenerator, IChunkProvider
4040
OreList ores = parameters.getOres();
4141
BiomeLocation biomes = parameters.getBiomes();
4242
// First, load cached blocks for neighboring chunk ore spawns
43-
int chunkX = pos.x;
44-
int chunkZ = pos.z;
43+
int chunkX = pos.chunkXPos;
44+
int chunkZ = pos.chunkZPos;
4545

4646
mergeDefaults(params, getDefaultParameters());
4747

src/main/java/com/mcmoddev/orespawn/impl/features/PrecisionGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public void generate(World world, IChunkGenerator chunkGenerator, IChunkProvider
4444
BiomeLocation biomes = parameters.getBiomes();
4545

4646
// First, load cached blocks for neighboring chunk ore spawns
47-
int chunkX = pos.x;
48-
int chunkZ = pos.z;
47+
int chunkX = pos.chunkXPos;
48+
int chunkZ = pos.chunkZPos;
4949

5050
mergeDefaults(params, getDefaultParameters());
5151

@@ -150,7 +150,7 @@ private int spawnOreNode(FunctionParameterWrapper params, int nodeSize, HeightRa
150150

151151
private BlockPos fixMungeOffset(Vec3i offset, BlockPos spot, HeightRange heightRange, ChunkPos pos) {
152152
BlockPos p = spot.add(offset);
153-
ChunkPos x1z1 = new ChunkPos(pos.x + 1, pos.z + 1);
153+
ChunkPos x1z1 = new ChunkPos(pos.chunkXPos + 1, pos.chunkZPos + 1);
154154
int xMax = x1z1.getXEnd();
155155
int zMax = x1z1.getZEnd();
156156
int xMin = pos.getXStart();

0 commit comments

Comments
 (0)