Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SUSY stone speeds #352

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading