Skip to content

Commit

Permalink
Merge pull request #352 from SymmetricDevs/bru-stones-fix
Browse files Browse the repository at this point in the history
Fix SUSY stone speeds
  • Loading branch information
bruberu authored Dec 13, 2024
2 parents 91c851e + e2b1a03 commit 0d24dd4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
12 changes: 9 additions & 3 deletions src/main/java/supersymmetry/common/blocks/SuSyBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import java.util.Map;
import java.util.stream.Collectors;

import static gregtech.common.blocks.MetaBlocks.ASPHALT;

public class SuSyBlocks {

public static BlockCoolingCoil COOLING_COIL;
Expand Down Expand Up @@ -162,9 +164,13 @@ private static void registerItemModel(@NotNull Block block) {

public static void registerWalkingSpeedBonus() {
for (SusyStoneVariantBlock block : SUSY_STONE_BLOCKS.values()) {
for (IBlockState state : block.getBlockState().getValidStates()) {
BlockUtility.setWalkingSpeedBonus(state, BlockUtility.ASPHALT_WALKING_SPEED_BONUS);
}
if (block.getWalkingSpeed() == 0)
continue;
for (IBlockState state : block.getBlockState().getValidStates())
BlockUtility.setWalkingSpeedBonus(state, block.getWalkingSpeed());
}
for (IBlockState state : ASPHALT.getBlockState().getValidStates()) {
BlockUtility.setWalkingSpeedBonus(state, 1); // Buff from 0.6F
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ public Item getItemDropped(@NotNull IBlockState state, @NotNull Random rand, int
SuSyBlocks.SUSY_STONE_BLOCKS.get(StoneVariant.COBBLE) : this);
}

public double getWalkingSpeed() {
return this.stoneVariant.walkingSpeed;
}

public enum StoneVariant {
SMOOTH("susy_stone_smooth"),
COBBLE("susy_stone_cobble", 2.0F, 10.0F),
BRICKS("susy_stone_bricks");
BRICKS("susy_stone_bricks", 0.25);
// TODO
// COBBLE_MOSSY("stone_cobble_mossy", 2.0F, 10.0F),
// POLISHED("stone_polished"),
Expand All @@ -77,24 +81,31 @@ public enum StoneVariant {
public final String translationKey;
public final float hardness;
public final float resistance;
public final double walkingSpeed;

StoneVariant(@Nonnull String id) {
this(id, id);
}

StoneVariant(@Nonnull String id, double walkingSpeed) {
this(id, id, 1.5F, 10.0F, walkingSpeed);
}


StoneVariant(@Nonnull String id, @Nonnull String translationKey) {
this(id, translationKey, 1.5F, 10.0F);
this(id, translationKey, 1.5F, 10.0F, 0);
}

StoneVariant(@Nonnull String id, float hardness, float resistance) {
this(id, id, hardness, resistance);
this(id, id, hardness, resistance, 0);
}

StoneVariant(@Nonnull String id, @Nonnull String translationKey, float hardness, float resistance) {
StoneVariant(@Nonnull String id, @Nonnull String translationKey, float hardness, float resistance, double walkingSpeed) {
this.id = id;
this.translationKey = translationKey;
this.hardness = hardness;
this.resistance = resistance;
this.walkingSpeed = walkingSpeed;
}
}

Expand Down

0 comments on commit 0d24dd4

Please sign in to comment.