Skip to content

Commit

Permalink
Updated build for Forge 1.11-13.19.1.2188 successfully compiles and r…
Browse files Browse the repository at this point in the history
…uns.
  • Loading branch information
Jared Hewitt committed Dec 7, 2016
1 parent 9c7060b commit f138f6e
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ compileJava {
}

minecraft {
version = "1.10.2-12.18.2.2099"
version = "1.11-13.19.1.2188"
runDir = "run"
mappings = "snapshot_nodoc_20161009"
replace '@VERSION@', version
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/CustomOreGen/FMLInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@Mod(modid="customoregen", useMetadata=true, version="@VERSION@", acceptedMinecraftVersions="[1.10]")
@Mod(modid="customoregen", name="Custom Ore Generation", useMetadata=true, version="1.11-1.4.2", acceptedMinecraftVersions="[1.11]")
public class FMLInterface implements IWorldGenerator
{
@Instance("customoregen")
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/CustomOreGen/Server/MapGenCloud.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import CustomOreGen.Util.PDist.Type;
import CustomOreGen.Util.Transform;
import CustomOreGen.Util.WireframeShapes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.StructureBoundingBox;
Expand Down Expand Up @@ -330,4 +331,10 @@ public double getAverageOreCount() {
double aboveNoiseCutoff = (1 - simplex.cdf(this.orVolumeNoiseCutoff.mean));
return v * this.orDensity.pdist.mean * aboveNoiseCutoff;
}

//@Override
public BlockPos getClosestStrongholdPos(World worldIn, BlockPos pos, boolean p_180706_3_) {
return null;
}

}
6 changes: 6 additions & 0 deletions src/main/java/CustomOreGen/Server/MapGenClusters.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import CustomOreGen.Util.Transform;
import CustomOreGen.Util.VolumeHelper;
import CustomOreGen.Util.WireframeShapes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.StructureBoundingBox;
Expand Down Expand Up @@ -230,4 +231,9 @@ public double getAverageOreCount() {
return volume;
}

//@Override
public BlockPos getClosestStrongholdPos(World worldIn, BlockPos pos, boolean p_180706_3_) {
return null;
}

}
17 changes: 13 additions & 4 deletions src/main/java/CustomOreGen/Server/MapGenOreDistribution.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import net.minecraft.world.gen.structure.StructureBoundingBox;
import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraft.world.gen.structure.StructureStart;
import net.minecraft.world.gen.structure.template.TemplateManager;

public abstract class MapGenOreDistribution extends MapGenStructure implements IOreDistribution
{
Expand Down Expand Up @@ -569,7 +570,11 @@ public BlockPos getNearestStructure(World world, BlockPos pos)
for (StructureComponent vc : (List<StructureComponent>)vs.getComponents()) {
if (vc.getComponentType() == 0)
{
BlockPos center = vc.getBoundingBoxCenter();
StructureBoundingBox bb = vc.getBoundingBox();
int xIn = bb.minX + (bb.maxX - bb.minX + 1) / 2;
int yIn = bb.minY + (bb.maxY - bb.minY + 1) / 2;
int zIn = bb.minZ + (bb.maxZ - bb.minZ + 1) / 2;
BlockPos center = new BlockPos(xIn, yIn, zIn);
int dist2 = (center.getX() - pos.getX()) * (center.getX() - pos.getX()) +
(center.getZ() - pos.getZ()) * (center.getZ() - pos.getZ());

Expand Down Expand Up @@ -728,8 +733,12 @@ public void buildWireframes()

for (StructureComponent comp : this.getComponents()) {
StructureBoundingBox bb = comp.getBoundingBox();
int cX = bb.getCenter().getX() / 16;
int cZ = bb.getCenter().getZ() / 16;
int xIn = bb.minX + (bb.maxX - bb.minX + 1) / 2;
int yIn = bb.minY + (bb.maxY - bb.minY + 1) / 2;
int zIn = bb.minZ + (bb.maxZ - bb.minZ + 1) / 2;
BlockPos center = new BlockPos(xIn, yIn, zIn);
int cX = center.getX() / 16;
int cZ = center.getZ() / 16;
long key = (long)cX << 32 | (long)cZ & 4294967295L;
builder = debuggingGeometryMap.get(key);

Expand Down Expand Up @@ -881,7 +890,7 @@ protected void writeStructureToNBT(NBTTagCompound tagCompound) {
}

@Override
protected void readStructureFromNBT(NBTTagCompound tagCompound) {
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
// TODO Auto-generated method stub

}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/CustomOreGen/Server/MapGenVeins.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import CustomOreGen.Util.Transform;
import CustomOreGen.Util.VolumeHelper;
import CustomOreGen.Util.WireframeShapes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.StructureBoundingBox;
Expand Down Expand Up @@ -784,4 +785,9 @@ public double getAverageOreCount() {
return this.orDensity.mean * totalVolume;
}

//@Override
public BlockPos getClosestStrongholdPos(World worldIn, BlockPos pos, boolean p_180706_3_) {
return null;
}

}
21 changes: 17 additions & 4 deletions src/main/java/CustomOreGen/Util/BiomeDescriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@

import java.util.Collections;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import CustomOreGen.Server.DistributionSettingMap.Copyable;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeDictionary.Type;

public class BiomeDescriptor implements Copyable<BiomeDescriptor>
{
Expand Down Expand Up @@ -131,10 +134,19 @@ protected float matchingWeight(Biome biome)
continue;

if (desc.describesType) {
BiomeDictionary.Type type = BiomeDictionary.Type.valueOf(desc.description.toUpperCase());
// instead of this, because we do not want to add a new type if it does not exist:
//BiomeDictionary.Type type = BiomeDictionary.Type.getType(desc.description);
if (BiomeDictionary.isBiomeOfType(biome, type))
//BiomeDictionary.Type type = BiomeDictionary.Type.valueOf(desc.description.toUpperCase());
// The above no longer works, because Type is no longer an enum, and so we are stuck
// with the following:
BiomeDictionary.Type type = null;
Set<Type> types = BiomeDictionary.getTypes(biome);
Iterator<Type> it = types.iterator();
while (it.hasNext()) {
BiomeDictionary.Type nextType = it.next();
if (nextType.getName() == desc.description.toUpperCase()) {
type = nextType;
}
}
if (BiomeDictionary.hasType(biome, type))
{
totalWeight += desc.weight;
}
Expand Down Expand Up @@ -364,6 +376,7 @@ public boolean isCompatible(Biome biome) {
biome.getHeightVariation() >= minHeightVariation &&
biome.getHeightVariation() <= maxHeightVariation;
}

}

}
4 changes: 2 additions & 2 deletions src/main/resources/config/modules/Vanilla.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
<Choice value=':= ?false' displayValue='No' description='Vanilla ores will be handled by Minecraft directly.'/>
</OptionChoice>
<!-- This is hidden, and is for internal configuration only. -->
<OptionChoice name='vanillaOreGen' displayName='Allow Vanilla Ore Generation?' default=':= !?enableVanilla' displayState='hidden' displayGroup='vanillaHiddenAssignments'>
<!--<OptionChoice name='vanillaOreGen' displayName='Allow Vanilla Ore Generation?' default=':= !?enableVanilla' displayState='hidden' displayGroup='vanillaHiddenAssignments'>
<Description> Should Custom Ore Generation handle Vanilla ore generation? </Description>
<Choice value=':= ?true' displayValue='Yes' description='Keep the vanilla oregen disabled.'/>
<Choice value=':= ?false' displayValue='No' description='Vanilla ores will be handled by Minecraft directly.'/>
</OptionChoice>
</OptionChoice>-->
<OptionChoice name='cleanUpVanilla' displayName='Use Vanilla Cleanup?' default='true' displayState='shown_dynamic' displayGroup='groupVanilla'>
<Description> Should Custom Ore Generation use the Substitution Pass to remove all instances of Vanilla ore from the world? If the mod's oregen can be turned off in its configuration, then it's recommended to do so, as the substitution pass can slow the game significantly. If this option is disabled without disabling the mod's own ore generation, you'll end up with two oregens working at once, flooding the world with ore. Enabled by default to ensure the ores are completely removed. </Description>
<Choice value=':= ?true' displayValue='Yes' description='Use the substitution pass to clean up Vanilla ores.'/>
Expand Down

0 comments on commit f138f6e

Please sign in to comment.