Skip to content

Commit

Permalink
19th commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackJar72 committed Feb 7, 2015
1 parent 08b7a72 commit e9cb448
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
4 changes: 2 additions & 2 deletions java/jaredbgreat/dldungeons/builder/DBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ public static boolean isProtectedBlock(World world, int x, int y, int z) {
@Override
public boolean equals(Object other) {
if(!(other instanceof DBlock)) return false;
return ((id == ((DBlock)other).id) && (meta == ((DBlock)other).meta));
return ((id.hashCode() == ((DBlock)other).id.hashCode()));
}


@Override
public int hashCode() {
// Not sure this would work much less what really would!
return (block.hashCode() << 4) + meta;
return id.hashCode();
}
}
41 changes: 23 additions & 18 deletions java/jaredbgreat/dldungeons/themes/BiomeLists.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,59 +272,59 @@ public static void removeTheme(Theme theme) {
}
if(theme.notIn.contains(Type.HOT)) {
nhot.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to hot.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from hot.");
}
if(theme.notIn.contains(Type.COLD)) {
ncold.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to cold.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from cold.");
}
if(theme.notIn.contains(Type.SPARSE)) {
nsparse.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to sparce.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from sparce.");
}
if(theme.notIn.contains(Type.DENSE)) {
ndense.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to dense.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from dense.");
}
if(theme.notIn.contains(Type.WET)) {
nwet.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to wet.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from wet.");
}
if(theme.notIn.contains(Type.DRY)) {
ndry.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to dry.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from dry.");
}
if(theme.notIn.contains(Type.SAVANNA)) {
nsavanna.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to savanna.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from savanna.");
}
if(theme.notIn.contains(Type.CONIFEROUS)) {
nconiferous.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to coniferous.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from coniferous.");
}
if(theme.notIn.contains(Type.SPOOKY)) {
nspooky.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to spooky.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from spooky.");
}
if(theme.notIn.contains(Type.DEAD)) {
ndead.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to dead.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from dead.");
}
if(theme.notIn.contains(Type.LUSH)) {
nlush.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to lush.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from lush.");
}
if(theme.notIn.contains(Type.CONIFEROUS)) {
nconiferous.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to coniferous.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from coniferous.");
}
if(theme.notIn.contains(Type.MESA)) {
nmesa.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to mesa.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from mesa.");
}
if(theme.notIn.contains(Type.SANDY)) {
nsandy.add(theme);
//System.out.println("[DLDUNGEONS] Assigning theme " + theme + " to sandy.");
//System.out.println("[DLDUNGEONS] Removing theme " + theme + " from sandy.");
}
}

Expand Down Expand Up @@ -524,11 +524,16 @@ public static Theme getTheme(BiomeGenBase biome, Random random) {

if(set.isEmpty()) {
return null;
} else {
use.addAll(set);
System.out.println("[DLDUNGEONS] The following themes are avalable for " + biome.biomeName + ":");
for(Theme theme : use) {
System.out.println("[DLDUNGEONS] " + theme.name);
}
Theme theme = use.get((random.nextInt(use.size())));
System.out.println("[DLDUNGEONS] Selected and returning " + theme +".");
return theme;
}
use.addAll(set);
Theme theme = use.get((random.nextInt(use.size())));
System.out.println("[DLDUNGEONS] Selected and returning " + theme +".");
return theme;
}


Expand Down
16 changes: 9 additions & 7 deletions java/jaredbgreat/dldungeons/themes/ThemeReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,7 @@ public static void parseTheme(BufferedReader instream, String name)
}
//System.out.println("[DLDUNGEONS] Delimeters are " + delimeters);
continue;
} if(token.equals("minigame")) {
if(booleanParser(true, tokens)) BiomeLists.registerWithMinigame(theme);
}
}
}
theme.fixMobs();
theme.biomeRegister();
Expand Down Expand Up @@ -449,17 +447,21 @@ private static int[] blockParser(int[] el,
String nums;
while(tokens.hasMoreTokens()) {
nums = tokens.nextToken();
//System.out.println("Read MC block " + nums);
System.out.println("Read MC block " + nums);
if(version > 1.6) {
values.add(String.valueOf(DBlock.add(nums, version)));
} else {
values.add(String.valueOf(DBlock.add(nums)));
}
}
int[] out = new int[values.size() + el.length];
for(int i = el.length; i < values.size(); i++) {
//System.out.println("Adding DBlock " + values.get(i));
out[i] = Integer.parseInt(values.get(i + el.length));
for(int i = 0; i < el.length; i++) {
System.out.println("Adding DBlock " + el[i]);
out[i] = el[i];
}
for(int i = 0; i < values.size(); i++) {
System.out.println("Adding DBlock " + values.get(i));
out[i + el.length] = Integer.parseInt(values.get(i));
}
//DoomlikeDungeons.profiler.startTask("Parsing blocks");
return out;
Expand Down
2 changes: 1 addition & 1 deletion resources/jaredbgreat/dldungeons/res/themes/mesa.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pillarBlock = minecraft:stained_hardened_clay(15), minecraft:planks, minecraft:
#
# Mob fields
#
# These are lists of mobs, and most be in their officialm, in code names
# These are lists of mobs, and most be in their official, in code names
#
# Weak, basic mobs; by default
commonMobs = Zombie, Skeleton, Spider
Expand Down

0 comments on commit e9cb448

Please sign in to comment.