Commit 22c77c52 authored by primetoxinz's avatar primetoxinz

Possibly fix HCStrata desyncing and not allowing blocks to break.

Fix some flammability properties not being inherited for miniblocks.
parent 209c9ffb
......@@ -25,9 +25,9 @@ if (System.getenv().BUILD_NUMBER != null) {//adds the build number to the end of
}
minecraft {
version = "1.12.2-14.23.5.2770"
version = "${minecraft_version}-${forge_version}"
runDir = "run"
mappings = "stable_39"
mappings = mcp_mappings
replace "%VERSION%": "${project.version}"
useDepAts = true
}
......@@ -59,7 +59,7 @@ dependencies {
compile 'org.easytesting:fest-assert:1.4'
compile 'org.easytesting:fest-util:1.1.6'
compile files('libraries/Thaumcraft-1.12.2-6.1.BETA16-deobf.jar')
// compile files('libraries/Thaumcraft-1.12.2-6.1.BETA16-deobf.jar')
}
sourceSets {
......
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
minecraft_version=1.12.2
mcp_mappings=stable_39
forge_version=14.23.5.2768
......@@ -176,6 +176,11 @@ public abstract class BlockMini extends BlockRotate implements IRenderRotationPl
return getTile(world, pos).map(t -> t.getPickBlock(player, target, state)).orElse(new ItemStack(this));
}
@Override
public boolean isFlammable(IBlockAccess world, BlockPos pos, EnumFacing face) {
return getTile(world, pos).map(t -> t.getState().getBlock().isFlammable(world, pos, face)).orElse(false);
}
@Override
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) {
return getTile(world, pos).map(t -> t.getState().getBlock().getFireSpreadSpeed(world, pos, face)).orElse(5);
......@@ -183,6 +188,19 @@ public abstract class BlockMini extends BlockRotate implements IRenderRotationPl
@Override
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) {
return getTile(world, pos).map(t -> t.getState().getBlock().getFlammability(world, pos, face)).orElse(10);
return getTile(world, pos).map(t -> {
try {
return t.getState().getBlock().getFlammability(world, pos, face);
} catch (Exception e) {
return null;
}
}).orElse(10);
}
@Override
public boolean isTopSolid(IBlockState state) {
return true;
}
}
......@@ -161,19 +161,13 @@ public class HCStrata extends Feature {
BlockPos pos = event.getPos();
if (shouldStratify(world, pos)) {
ItemStack stack = BrokenToolRegistry.findItem(event.getEntityPlayer(), event.getState());
float scale = 1;
int strata = getStratification(world, pos, world.provider.getDimension()).ordinal();
if (STATES.getOrDefault(event.getState(), BlockType.STONE) == BlockType.STONE) {
int level = Math.max(1, stack.getItem().getHarvestLevel(stack, "pickaxe", event.getEntityPlayer(), event.getState()));
if (level <= strata) {
scale = INCORRECT_STRATA_SCALE;
event.setNewSpeed(INCORRECT_STRATA_SCALE * event.getOriginalSpeed());
}
}
float speed = scale * STRATA_SPEEDS[strata] * event.getOriginalSpeed();
event.setNewSpeed(speed);
if(debugging)
BWMod.logger.info("BreakSpeedEvent pos: {}, state: {}, held: {}, strata: {}, speed: {}", event.getPos(), event.getState(), stack, strata, speed);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment