Skip to content

Commit

Permalink
fixed rendering of battery buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed May 1, 2024
1 parent a6e5fae commit 45f6a3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 3 additions & 4 deletions common/src/main/java/trinsdar/gt4r/block/BlockBatBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ public void onBlockModelBuild(Block block, AntimatterBlockStateProvider prov) {
Tier original = this.tier;
for (BatBoxTiers tier : BatBoxTiers.values()) {
this.tier = fromBatBoxTier(tier);
AntimatterBlockModelBuilder builder = prov.models().getBuilder(getId() + "_" + tier.getSerializedName());
AntimatterBlockModelBuilder builder = prov.models().getBuilder(getId().replace("_lv", "") + "_" + tier.getSerializedName());
buildModelsForState(builder, MachineState.IDLE);
buildModelsForState(builder, MachineState.ACTIVE);
builder.loader(AntimatterModelManager.LOADER_MACHINE);
builder.property("particle", getType().getBaseTexture(this.tier, MachineState.IDLE)[0].toString());
}
this.tier = original;
prov.getVariantBuilder(block).forAllStatesExcept(b ->
new VariantBlockStateBuilder.VariantBuilder().modelFile(prov.models().getBuilder(getId() + "_" + b.getValue(TIER).getSerializedName())),
BlockStateProperties.HORIZONTAL_FACING);
prov.getVariantBuilder(block).forAllStates(b ->
new VariantBlockStateBuilder.VariantBuilder().modelFile(prov.models().getBuilder(getId().replace("_lv", "") + "_" + b.getValue(TIER).getSerializedName())));
}

@Override
Expand Down
7 changes: 4 additions & 3 deletions common/src/main/java/trinsdar/gt4r/data/Machines.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import muramasa.antimatter.blockentity.single.BlockEntityDigitalTransformer;
import net.minecraft.sounds.SoundEvents;
import trinsdar.gt4r.GT4RRef;
import trinsdar.gt4r.block.BlockBatBox;
import trinsdar.gt4r.block.BlockRedstoneMachine;
import trinsdar.gt4r.machine.*;
import trinsdar.gt4r.blockentity.multi.*;
Expand Down Expand Up @@ -162,9 +163,9 @@ public class Machines {
public static GeneratorMachine WATERMILL = new GeneratorMachine(GT4RRef.ID, "watermill").baseTexture(Textures.BASE_HANDLER).setTiers(ULV).covers(emptyFactory,emptyFactory,emptyFactory,emptyFactory,emptyFactory, COVER_DYNAMO_OLD).allowFrontIO().setVerticalFacingAllowed(false).setOutputCover(COVER_DYNAMO_OLD).setTile(BlockEntityCoveredGenerator::new).custom();

public static TankMachine INFINITE_STEAM = new TankMachine(GT4RRef.ID, "infinite_steam").addFlags(FLUID, CELL, GUI).setTiers(LV).setTile(BlockEntityInfiniteFluid::new);
public static BasicMachine BATTERY_BUFFER_ONE = new BasicMachine(GT4RRef.ID, "1x_battery_buffer").noCovers().addFlags(GUI, EU, ITEM).setTile(BlockEntityBatteryBuffer::new).overlayTexture(Textures.TIER_SPECIFIC_OVERLAY_HANDLER).allowFrontIO().setVerticalFacingAllowed(true);
public static BasicMachine BATTERY_BUFFER_FOUR = new BasicMachine(GT4RRef.ID, "4x_battery_buffer").noCovers().addFlags(GUI, EU, ITEM).setTile(BlockEntityBatteryBuffer::new).overlayTexture(Textures.TIER_SPECIFIC_OVERLAY_HANDLER).allowFrontIO().setVerticalFacingAllowed(true);
public static BasicMachine BATTERY_BUFFER_EIGHT = new BasicMachine(GT4RRef.ID, "8x_battery_buffer").noCovers().addFlags(GUI, EU, ITEM).setTile(BlockEntityBatteryBuffer::new).overlayTexture(Textures.TIER_SPECIFIC_OVERLAY_HANDLER).allowFrontIO().setVerticalFacingAllowed(true);
public static BasicMachine BATTERY_BUFFER_ONE = new UpgradeableMachine(GT4RRef.ID, "1x_battery_buffer").setTiers(LV).noCovers().addFlags(GUI, EU, ITEM).setTile(BlockEntityBatteryBuffer::new).setBlock(BlockBatBox::new).setItemBlockClass(() -> BlockBatBox.class).overlayTexture(Textures.TIER_SPECIFIC_OVERLAY_HANDLER).allowFrontIO().setVerticalFacingAllowed(true);
public static BasicMachine BATTERY_BUFFER_FOUR = new UpgradeableMachine(GT4RRef.ID, "4x_battery_buffer").setTiers(LV).noCovers().addFlags(GUI, EU, ITEM).setTile(BlockEntityBatteryBuffer::new).setBlock(BlockBatBox::new).setItemBlockClass(() -> BlockBatBox.class).overlayTexture(Textures.TIER_SPECIFIC_OVERLAY_HANDLER).allowFrontIO().setVerticalFacingAllowed(true);
public static BasicMachine BATTERY_BUFFER_EIGHT = new UpgradeableMachine(GT4RRef.ID, "8x_battery_buffer").setTiers(LV).noCovers().addFlags(GUI, EU, ITEM).setTile(BlockEntityBatteryBuffer::new).setBlock(BlockBatBox::new).setItemBlockClass(() -> BlockBatBox.class).overlayTexture(Textures.TIER_SPECIFIC_OVERLAY_HANDLER).allowFrontIO().setVerticalFacingAllowed(true);
public static BasicMachine TRANSFORMER = new BasicMachine(GT4RRef.ID, "transformer").addFlags(EU).overlayTexture(Textures.TIER_SPECIFIC_OVERLAY_HANDLER).setTile((m, p, s) -> new BlockEntityTransformer<>(m, p, s, 1)).noCovers().setVerticalFacingAllowed(true).allowFrontIO();
public static BasicMachine SUPERCONDENSATOR = new BasicMachine(GT4RRef.ID, "supercondensator").addFlags(EU).setTile((m, p, s) -> new BlockEntitySupercondensator(m, p, s, 1)).setTiers(LUV).noCovers().setVerticalFacingAllowed(true).allowFrontIO();
public static BasicMachine TRANSFORMER_DIGITAL = new BasicMachine(GT4RRef.ID, "transformer_digital").addFlags(GUI, EU).setTiers(EV, IV).setTile(BlockEntityDigitalTransformer::new).noCovers().allowFrontIO();
Expand Down
2 changes: 2 additions & 0 deletions common/src/main/java/trinsdar/gt4r/proxy/ClientHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.world.level.Level;
import org.apache.commons.io.FileUtils;
import trinsdar.gt4r.GT4Reimagined;
import trinsdar.gt4r.block.BlockBatBox;
import trinsdar.gt4r.block.BlockCasing;
import trinsdar.gt4r.block.BlockRedstoneMachine;
import trinsdar.gt4r.data.Machines;
Expand All @@ -36,6 +37,7 @@ public static void setup() {
ModelUtils.setRenderLayer(((BlockItem)Machines.DUSTBIN.getItem(LV)).getBlock(), RenderType.cutout());
AntimatterAPI.all(BlockCasing.class, t -> ModelUtils.setRenderLayer(t, RenderType.cutout()));
AntimatterAPI.all(BlockRedstoneMachine.class, b -> ModelUtils.setRenderLayer(b, RenderType.cutout()));
AntimatterAPI.all(BlockBatBox.class, b -> ModelUtils.setRenderLayer(b, RenderType.cutout()));
});
copyProgrammerArtIfMissing();
}
Expand Down

0 comments on commit 45f6a3b

Please sign in to comment.