Replaced size boolean with direct use of size enum

This commit is contained in:
Rabbitminers 2023-04-01 18:39:03 +01:00
parent 50ff081704
commit 71f839ee51
2 changed files with 8 additions and 16 deletions

View file

@ -207,6 +207,7 @@ import com.simibubi.create.content.logistics.block.vault.ItemVaultBlock;
import com.simibubi.create.content.logistics.block.vault.ItemVaultCTBehaviour;
import com.simibubi.create.content.logistics.block.vault.ItemVaultItem;
import com.simibubi.create.content.logistics.item.LecternControllerBlock;
import com.simibubi.create.content.logistics.trains.BogeyRenderer;
import com.simibubi.create.content.logistics.trains.management.display.FlapDisplayBlock;
import com.simibubi.create.content.logistics.trains.management.edgePoint.EdgePointType;
import com.simibubi.create.content.logistics.trains.management.edgePoint.TrackTargetingBlockItem;
@ -1578,13 +1579,13 @@ public class AllBlocks {
.register();
public static final BlockEntry<StandardBogeyBlock> SMALL_BOGEY =
REGISTRATE.block("small_bogey", p -> new StandardBogeyBlock(p, false))
REGISTRATE.block("small_bogey", p -> new StandardBogeyBlock(p, BogeyRenderer.BogeySize.SMALL))
.properties(p -> p.color(MaterialColor.PODZOL))
.transform(BuilderTransformers.bogey())
.register();
public static final BlockEntry<StandardBogeyBlock> LARGE_BOGEY =
REGISTRATE.block("large_bogey", p -> new StandardBogeyBlock(p, true))
REGISTRATE.block("large_bogey", p -> new StandardBogeyBlock(p, BogeyRenderer.BogeySize.SMALL))
.properties(p -> p.color(MaterialColor.PODZOL))
.transform(BuilderTransformers.bogey())
.register();

View file

@ -1,13 +1,9 @@
package com.simibubi.create.content.logistics.trains.track;
import java.util.EnumSet;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllBogeyStyles;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.logistics.trains.BogeyRenderer;
import com.simibubi.create.content.logistics.trains.AbstractBogeyBlock;
import com.simibubi.create.content.logistics.trains.entity.BogeyStyle;
import com.simibubi.create.content.schematics.ISpecialBlockItemRequirement;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.block.ProperWaterloggedBlock;
@ -22,11 +18,11 @@ import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
public class StandardBogeyBlock extends AbstractBogeyBlock implements ITE<StandardBogeyTileEntity>, ProperWaterloggedBlock, ISpecialBlockItemRequirement {
private final boolean large;
private final BogeyRenderer.BogeySize size;
public StandardBogeyBlock(Properties p_i48440_1_, boolean large) {
public StandardBogeyBlock(Properties p_i48440_1_, BogeyRenderer.BogeySize large) {
super(p_i48440_1_);
this.large = large;
this.size = large;
registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false));
}
@ -37,7 +33,7 @@ public class StandardBogeyBlock extends AbstractBogeyBlock implements ITE<Standa
@Override
public double getWheelRadius() {
return (large ? 12.5 : 6.5) / 16d;
return (size == BogeyRenderer.BogeySize.LARGE ? 12.5 : 6.5) / 16d;
}
@Override
@ -45,14 +41,9 @@ public class StandardBogeyBlock extends AbstractBogeyBlock implements ITE<Standa
return new Vec3(0, 7 / 32f, 1);
}
@Override
public BogeyStyle getStyle() {
return AllBogeyStyles.STANDARD.get();
}
@Override
public BogeyRenderer.BogeySize getSize() {
return large ? BogeyRenderer.BogeySize.LARGE : BogeyRenderer.BogeySize.SMALL;
return size;
}
@Override