Fixes for 1.12.2.

This commit is contained in:
asofold 2018-08-24 19:42:50 +02:00
parent d7aa96880e
commit cd142dd822
6 changed files with 33 additions and 24 deletions

View File

@ -106,8 +106,9 @@ public class BlockInit {
* Set like air, plus instantly breakable.
* @param newId
*/
public static void setInstantAir(String newId) {
BlockFlags.setFlagsAs(newId, Material.AIR); // TODO: Problematic, should be F_IGN_PASSABLE
public static void setInstantPassable(String newId) {
BlockProperties.setBlockFlags(newId, BlockProperties.F_IGN_PASSABLE);
BlockProperties.setBlockProps(newId, BlockProperties.instantType);
}
@ -115,8 +116,8 @@ public class BlockInit {
* Set like air, plus instantly breakable.
* @param newId
*/
public static void setInstantAir(Material newId) {
BlockFlags.setFlagsAs(newId, Material.AIR);
public static void setInstantPassable(Material newId) {
BlockProperties.setBlockFlags(newId, BlockProperties.F_IGN_PASSABLE);
BlockProperties.setBlockProps(newId, BlockProperties.instantType);
}

View File

@ -50,7 +50,7 @@ public class BlocksMC1_10 implements BlockPropertiesSetup {
// 216 BONE_BLOCK
BlockInit.setAs("BONE_BLOCK", Material.COBBLESTONE);
// 217 STRUCTURE_VOID
BlockInit.setInstantAir("STRUCTURE_VOID");
BlockInit.setInstantPassable("STRUCTURE_VOID");
// Not sure when: structure block is solid.
BlockFlags.setFullySolidFlags("STRUCTURE_BLOCK");

View File

@ -70,7 +70,7 @@ public class BlocksMC1_13 implements BlockPropertiesSetup {
// Further melon/pumpkin stems.
// Wall torch
BlockInit.setInstantAir("WALL_TORCH");
BlockInit.setInstantPassable("WALL_TORCH");
// Shulker boxes.
for (Material mat : MaterialUtil.SHULKER_BOXES) {

View File

@ -95,7 +95,7 @@ public class BlocksMC1_9 implements BlockPropertiesSetup {
BlockInit.setAs("FROSTED_ICE", Material.ICE);
// 255(STRUCTURE_BLOCK / SOLID+GROUND)
BlockInit.setInstantAir("STRUCTURE_BLOCK");
BlockInit.setInstantPassable("STRUCTURE_BLOCK");
// Special case activation.
// TODO: Is this the right place?

View File

@ -1196,16 +1196,10 @@ public class BlockProperties {
// Set block break properties.
// Instantly breakable.
for (final Material mat : new Material[]{
Material.TRIPWIRE_HOOK, Material.TRIPWIRE,
Material.TORCH,
Material.TNT,
Material.REDSTONE_WIRE,
BridgeMaterial.get("REDSTONE_TORCH_ON"),
BridgeMaterial.get("REDSTONE_TORCH_OFF"),
BridgeMaterial.get("DIODE_BLOCK_ON"), BridgeMaterial.get("DIODE_BLOCK_OFF"),
BridgeMaterial.get("repeater"),
BridgeMaterial.LILY_PAD,
Material.FIRE,
BridgeMaterial.COMMAND_BLOCK,
BridgeMaterial.get("sea_pickle"),
}) {
@ -1215,14 +1209,23 @@ public class BlockProperties {
}
for (final Material mat : MaterialUtil.INSTANT_PLANTS) {
setBlock(mat, instantType);
}
}
// Instant break and fully passable.
for (Material mat : new Material[] {
Material.REDSTONE_WIRE,
BridgeMaterial.get("REDSTONE_TORCH_ON"),
BridgeMaterial.get("REDSTONE_TORCH_OFF"),
BridgeMaterial.get("redstone_torch"),
BridgeMaterial.get("redstone_wall_torch"),
Material.TRIPWIRE,
Material.TRIPWIRE_HOOK,
Material.TORCH,
Material.FIRE,
}) {
setBlock(mat, instantType);
BlockFlags.addFlags(mat, F_IGN_PASSABLE);
if (mat != null) {
setBlock(mat, instantType);
BlockFlags.addFlags(mat, F_IGN_PASSABLE);
}
}
// Leaf type
@ -1491,7 +1494,7 @@ public class BlockProperties {
// Wall banners.
for (Material mat : MaterialUtil.WALL_BANNERS) {
BlockInit.setInstantAir(mat);
BlockInit.setInstantPassable(mat);
}
// Shulker boxes
@ -1630,7 +1633,7 @@ public class BlockProperties {
}
if (!missing.isEmpty()) {
missing.add(0, "--- Missing entries -------------------------------");
missing.add(0, "The block breaking data is incomplete, default to allow instant breaking:");
missing.add(0, "The block data is incomplete:");
logManager.warning(Streams.INIT, StringUtil.join(missing, "\n"));
}
}

View File

@ -450,17 +450,18 @@ public class MaterialUtil {
Arrays.asList("coral_fan", "coral_wall_fan", "coral"),
AlmostBoolean.YES, "dead", "legacy"),
BridgeMaterial.getAllBlocks("attached_melon_stem", "attached_pumpkin_stem",
"allium", "dandelion", "dandelion_yellow", "fern", "kelp", "kelp_plant",
"large_fern", "lilac", "melon_stem", "nether_wart", "nether_warts",
"oxeye_daisy", "peony", "poppy", "red_rose", "rose_red", "seagrass",
"sunflower", "tall_seagrass"
"allium", "dandelion", "dandelion_yellow", "double_plant", "fern",
"kelp", "kelp_plant", "large_fern", "lilac", "melon_stem",
"nether_wart", "nether_warts", "oxeye_daisy", "peony", "poppy",
"red_rose", "rose_red", "seagrass", "sunflower", "tall_seagrass",
"yellow_flower"
// TODO: Ground or not: "beetroots", "beetroot_block"
),
new HashSet<Material>(Arrays.asList(BridgeMaterial.TALL_GRASS,
BridgeMaterial.WHEAT_CROPS, BridgeMaterial.CARROTS,
BridgeMaterial.POTATOES, BridgeMaterial.GRASS,
Material.PUMPKIN_STEM, Material.MELON_STEM,
Material.SUGAR_CANE))
BridgeMaterial.SUGAR_CANE))
));
/**
@ -498,7 +499,11 @@ public class MaterialUtil {
RAILS,
WALL_BANNERS,
INSTANT_PLANTS,
BridgeMaterial.getAllBlocks("lever")
BridgeMaterial.getAllBlocks("structure_void", "end_gateway"),
new HashSet<Material>(Arrays.asList(
Material.LEVER,
BridgeMaterial.END_PORTAL,
BridgeMaterial.NETHER_PORTAL))
));
////////////////////