BlockType adjustments

- Flagged heads as "cannot be passed through".
- Adjusted shouldPlaceLast (Added anvils, removed heads).
- Fixed portal frame height and added a few new blocks to centralTopLimit
- Made cobblestone wall 1.5 high.
This commit is contained in:
TomyLobo 2013-06-23 19:26:33 +02:00
parent 2a4e6ac93a
commit 28047894c4

View File

@ -348,7 +348,7 @@ public enum BlockType {
shouldPlaceLast.add(BlockID.CARROTS);
shouldPlaceLast.add(BlockID.POTATOES);
shouldPlaceLast.add(BlockID.WOODEN_BUTTON);
shouldPlaceLast.add(BlockID.HEAD);
shouldPlaceLast.add(BlockID.ANVIL); // becomes relevant with asynchronous placement
shouldPlaceLast.add(BlockID.PRESSURE_PLATE_LIGHT);
shouldPlaceLast.add(BlockID.PRESSURE_PLATE_HEAVY);
shouldPlaceLast.add(BlockID.COMPARATOR_OFF);
@ -452,7 +452,6 @@ public enum BlockType {
canPassThrough.add(BlockID.CARROTS);
canPassThrough.add(BlockID.POTATOES);
canPassThrough.add(BlockID.WOODEN_BUTTON);
canPassThrough.add(BlockID.HEAD);
canPassThrough.add(BlockID.PRESSURE_PLATE_LIGHT);
canPassThrough.add(BlockID.PRESSURE_PLATE_HEAVY);
canPassThrough.add(BlockID.COMPARATOR_OFF);
@ -493,20 +492,36 @@ public enum BlockType {
centralTopLimit.put(BlockID.ENCHANTMENT_TABLE, 0.75);
for (int data = 0; data < 16; ++data) {
if ((data & 4) != 0) {
centralTopLimit.put(BlockID.END_PORTAL_FRAME, 0.8125);
centralTopLimit.put(-16*BlockID.END_PORTAL_FRAME-data, 1.0);
}
else {
centralTopLimit.put(-16*BlockID.END_PORTAL_FRAME-data, 0.8125);
}
centralTopLimit.put(-16*BlockID.HEAD-data, 0.75);
}
// Default value to be used if no data value is given
centralTopLimit.put(BlockID.HEAD, 0.75);
// Heads on the floor are lower
centralTopLimit.put(-16*BlockID.HEAD-1, 0.5);
centralTopLimit.put(-16*BlockID.HEAD-9, 0.5);
centralTopLimit.put(BlockID.FENCE, 1.5);
centralTopLimit.put(BlockID.FENCE_GATE, 1.5);
for (int data = 0; data < 8; ++data) {
centralTopLimit.put(-16*BlockID.STEP-data, 0.5);
centralTopLimit.put(-16*BlockID.WOODEN_STEP-data, 0.5);
centralTopLimit.put(-16*BlockID.SNOW-data, 0.125*data);
centralTopLimit.put(-16*BlockID.SNOW-(data+8), 0.125*data);
}
centralTopLimit.put(BlockID.LILY_PAD, 0.015625);
centralTopLimit.put(BlockID.REDSTONE_REPEATER_ON, .125);
centralTopLimit.put(BlockID.REDSTONE_REPEATER_OFF, .125);
centralTopLimit.put(BlockID.TRAP_DOOR, 0.1875);
centralTopLimit.put(BlockID.SLOW_SAND, 0.875);
centralTopLimit.put(BlockID.COBBLESTONE_WALL, 1.5);
centralTopLimit.put(BlockID.FLOWER_POT, 0.375);
centralTopLimit.put(BlockID.COMPARATOR_OFF, .125);
centralTopLimit.put(BlockID.COMPARATOR_ON, .125);
centralTopLimit.put(BlockID.DAYLIGHT_SENSOR, 0.375);
}
/**
@ -517,12 +532,12 @@ public enum BlockType {
* @return
*/
public static double centralTopLimit(int id, int data) {
if (centralTopLimit.containsKey(id))
return centralTopLimit.get(id);
if (centralTopLimit.containsKey(-16*id-data))
return centralTopLimit.get(-16*id-data);
if (centralTopLimit.containsKey(id))
return centralTopLimit.get(id);
return canPassThrough(id) ? 0 : 1;
}