Skip to content

Commit

Permalink
fixed crash related to Forge BiomeDictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
Greymerk committed Dec 4, 2016
1 parent 2e8db78 commit 5e81bd4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
apply plugin: 'net.minecraftforge.gradle.forge'

version = "1.11-1.6.0"
version = "1.11-1.6.1"
group= "ca.rivas.roguelike" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "RoguelikeDungeons"

Expand All @@ -22,7 +22,7 @@ compileJava {
}

minecraft {
version = "1.11-13.19.0.2160"
version = "1.11-13.19.0.2180"
runDir = "run"
mappings = "snapshot_20161111"
makeObfSourceJar = false
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/greymerk/roguelike/Roguelike.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Roguelike {
@Instance("roguelike")
public static Roguelike instance;
// TODO: change version number
public static final String version = "1.6.0";
public static final String version = "1.6.1";

// Says where the client and server 'proxy' code is loaded.
@SidedProxy(clientSide="greymerk.roguelike.ClientProxy", serverSide="greymerk.roguelike.CommonProxy")
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/greymerk/roguelike/dungeon/Dungeon.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void generate(ISettings settings, int inX, int inZ){
+ "TNT: " + editor.getStat(Blocks.TNT) + "\n"
+ "\n-Greymerk");
book.addPage("Roguelike Dungeons v" + Roguelike.version + "\n"
+ "November 25th <current_year>\n\n"
+ "December 3rd 2016\n\n"
+ "Credits\n\n"
+ "Author: Greymerk\n\n"
+ "Bits: Drainedsoul\n\n"
Expand Down Expand Up @@ -168,7 +168,7 @@ public boolean validLocation(Random rand, int x, int z){
};

for(Type type : invalidBiomes){
if(BiomeDictionary.isBiomeOfType(biome, type)) return false;
if(BiomeDictionary.hasType(biome, type)) return false;
}

int upperLimit = RogueConfig.getInt(RogueConfig.UPPERLIMIT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public SpawnCriteria(JsonObject data){
this.biomeTypes = new ArrayList<BiomeDictionary.Type>();
for(JsonElement e : biomeTypeList){
String type = e.getAsString();
this.biomeTypes.add(BiomeDictionary.Type.valueOf(type));
// TODO: Find better way to interact with BiomeType Dictionary.
BiomeDictionary.Type t = BiomeDictionary.Type.getType(type, new BiomeDictionary.Type[0]);
if(BiomeDictionary.getBiomes(t).size() > 0) this.biomeTypes.add(t);
}
}
}
Expand Down Expand Up @@ -71,7 +73,7 @@ public boolean isValid(IWorldEditor editor, Coord pos){

if(this.biomeTypes != null){
for(BiomeDictionary.Type type : this.biomeTypes){
if(BiomeDictionary.isBiomeOfType(biome, type)) biomeFound = true;
if(BiomeDictionary.hasType(biome, type)) biomeFound = true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import java.util.List;
import java.util.Random;
import java.util.Set;

import greymerk.roguelike.citadel.Citadel;
import greymerk.roguelike.config.RogueConfig;
Expand All @@ -26,7 +27,6 @@
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeDictionary.Type;

public class CommandSpawnDungeon extends CommandBase
{
Expand Down Expand Up @@ -69,10 +69,10 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args

Biome biome = editor.getBiome(pos);
sender.addChatMessage(new TextComponentString(TextFormat.apply(biome.getBiomeName(), TextFormat.GOLD)));
Type[] biomeTypes = BiomeDictionary.getTypesForBiome(biome);
Set<BiomeDictionary.Type> biomeTypes = BiomeDictionary.getTypes(biome);
String types = "";
for(BiomeDictionary.Type type : biomeTypes){
types += type.name() + " ";
types += type.getName() + " ";
}
sender.addChatMessage(new TextComponentString(TextFormat.apply(types, TextFormat.GOLD)));
return;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"modid" : "roguelike",
"name" : "Roguelike Dungeons",
"description" : "Adds randomized dungeons to the world",
"version" : "1.6.0",
"version" : "1.6.1",
"url" : "github.com/Greymerk/minecraft-roguelike",
"authorList" : ["Greymerk"],
"mcversion" : "1.11"
Expand Down

0 comments on commit 5e81bd4

Please sign in to comment.