Skip to content

Commit

Permalink
Fix Shipwreck locations for 1.13-pre7 and newer
Browse files Browse the repository at this point in the history
Closes #418.
  • Loading branch information
Moulins committed Aug 25, 2018
1 parent 129d3fb commit da3a710
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/amidst/mojangapi/world/WorldBuilder.java
Expand Up @@ -239,7 +239,8 @@ private World create(
new ScatteredFeaturesLocationChecker(
seed,
biomeDataOracle,
(byte) 15, (byte) 8,
versionFeatures.getMaxDistanceScatteredFeatures_Shipwreck(),
(byte) 8,
versionFeatures.getValidBiomesAtMiddleOfChunk_Shipwreck(),
versionFeatures.getSeedForStructure_Shipwreck(),
buggyStructureCoordinateMath),
Expand Down
Expand Up @@ -49,6 +49,7 @@ public static VersionFeatures create(RecognisedVersion version) {
INSTANCE.seedForStructure_WitchHut.getValue(version),
INSTANCE.seedForStructure_OceanRuins.getValue(version),
INSTANCE.seedForStructure_Shipwreck.getValue(version),
INSTANCE.maxDistanceScatteredFeatures_Shipwreck.getValue(version),
INSTANCE.buggyStructureCoordinateMath.getValue(version));
}

Expand All @@ -75,6 +76,7 @@ public static VersionFeatures create(RecognisedVersion version) {
private final VersionFeature<Long> seedForStructure_WitchHut;
private final VersionFeature<Long> seedForStructure_OceanRuins;
private final VersionFeature<Long> seedForStructure_Shipwreck;
private final VersionFeature<Byte> maxDistanceScatteredFeatures_Shipwreck;
private final VersionFeature<Boolean> buggyStructureCoordinateMath;

private DefaultVersionFeatures() {
Expand Down Expand Up @@ -328,6 +330,12 @@ private DefaultVersionFeatures() {
.init(
165745295L
).construct();
this.maxDistanceScatteredFeatures_Shipwreck = VersionFeature.<Byte> builder()
.init(
(byte) 15
).since(RecognisedVersion._1_13_pre7,
(byte) 16
).construct();

this.buggyStructureCoordinateMath = VersionFeature.<Boolean> builder()
.init(
Expand Down
Expand Up @@ -35,6 +35,7 @@ public class VersionFeatures {
private final Long seedForStructure_WitchHut;
private final Long seedForStructure_OceanRuins;
private final Long seedForStructure_Shipwreck;
private final Byte maxDistanceScatteredFeatures_Shipwreck;
private final Boolean buggyStructureCoordinateMath;

public VersionFeatures(
Expand All @@ -61,6 +62,7 @@ public VersionFeatures(
Long seedForStructure_WitchHut,
Long seedForStructure_OceanRuins,
Long seedForStructure_Shipwreck,
Byte maxDistanceScatteredFeatures_Shipwreck,
Boolean buggyStructureCoordinateMath) {
this.enabledLayers = enabledLayers;
this.validBiomesForStructure_Spawn = validBiomesForStructure_Spawn;
Expand All @@ -85,6 +87,7 @@ public VersionFeatures(
this.seedForStructure_WitchHut = seedForStructure_WitchHut;
this.seedForStructure_OceanRuins = seedForStructure_OceanRuins;
this.seedForStructure_Shipwreck = seedForStructure_Shipwreck;
this.maxDistanceScatteredFeatures_Shipwreck = maxDistanceScatteredFeatures_Shipwreck;
this.buggyStructureCoordinateMath = buggyStructureCoordinateMath;
}

Expand Down Expand Up @@ -179,6 +182,10 @@ public Long getSeedForStructure_OceanRuins() {
public Long getSeedForStructure_Shipwreck() {
return seedForStructure_Shipwreck;
}

public Byte getMaxDistanceScatteredFeatures_Shipwreck() {
return maxDistanceScatteredFeatures_Shipwreck;
}

public Boolean getBuggyStructureCoordinateMath() {
return buggyStructureCoordinateMath;
Expand Down

0 comments on commit da3a710

Please sign in to comment.