This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
209 additions
and
3 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
common/src/main/java/muramasa/gregtech/block/BlockColoredWall.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package muramasa.gregtech.block; | ||
|
||
import muramasa.antimatter.Ref; | ||
import muramasa.antimatter.block.BlockFakeTile; | ||
import muramasa.antimatter.material.Material; | ||
import muramasa.antimatter.registration.IColorHandler; | ||
import muramasa.antimatter.texture.Texture; | ||
import muramasa.gregtech.GTIRef; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.level.BlockGetter; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.SoundType; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import static muramasa.antimatter.data.AntimatterMaterials.Wood; | ||
|
||
public class BlockColoredWall extends BlockFakeTile implements IColorHandler { | ||
final Material material; | ||
public BlockColoredWall(String domain, Material material, Properties properties) { | ||
super(domain, material.getId() + "_wall", properties); | ||
this.material = material; | ||
} | ||
|
||
public BlockColoredWall(String domain, Material material){ | ||
this(domain, material, Block.Properties.of(net.minecraft.world.level.material.Material.METAL).strength(1.0f, 10.0f).sound(SoundType.METAL).requiresCorrectToolForDrops()); | ||
} | ||
|
||
public Material getMaterial() { | ||
return material; | ||
} | ||
|
||
@Override | ||
public Texture[] getTextures() { | ||
Texture side = material == Wood ? new Texture(GTIRef.ID, "block/casing/wall/wood") : new Texture(GTIRef.ID, "block/casing/wall/metal"); | ||
Texture overlay = new Texture(GTIRef.ID, "block/machine/empty"); | ||
Texture sideOverlay = material == Wood ? new Texture(GTIRef.ID, "block/casing/wall/wood_overlay_side") : overlay; | ||
return new Texture[]{side, side, side, side, side, side, overlay, overlay, sideOverlay, sideOverlay, sideOverlay, sideOverlay}; | ||
} | ||
|
||
@Override | ||
public int getBlockColor(BlockState state, @Nullable BlockGetter world, @Nullable BlockPos pos, int i) { | ||
return i == 0 ? material.getRGB() : -1; | ||
} | ||
|
||
@Override | ||
public int getItemColor(ItemStack stack, @Nullable Block block, int i) { | ||
return i == 0 ? material.getRGB() : -1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
common/src/main/java/muramasa/gregtech/machine/MultiblockTankMachine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package muramasa.gregtech.machine; | ||
|
||
import com.gtnewhorizon.structurelib.structure.StructureUtility; | ||
import io.github.gregtechintergalactical.gtutility.machine.MaterialBasicMultiMachine; | ||
import muramasa.antimatter.material.Material; | ||
import muramasa.antimatter.texture.Texture; | ||
import muramasa.gregtech.GTIRef; | ||
import muramasa.gregtech.tile.multi.TileEntityLargeTank; | ||
import net.minecraft.world.level.block.Block; | ||
|
||
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; | ||
import static muramasa.antimatter.data.AntimatterMaterials.Wood; | ||
|
||
public class MultiblockTankMachine extends MaterialBasicMultiMachine { | ||
final int capacity; | ||
public MultiblockTankMachine(String domain, Material material, boolean small, int capacity) { | ||
super(domain, (small ? "small" : "large") + "_" + material.getId() + "_tank_main_valve", material); | ||
if (small){ | ||
this.setStructure(TileEntityLargeTank.class, b -> b.part("main") | ||
.of("CCC", "CCC", "CCC").of("C~C", "C-C", "CCC").of(0).build() | ||
.atElement('C', StructureUtility.lazy(t -> ofBlock(t.getCasing()))).offset(1, 1, 0) | ||
.build()); | ||
} else { | ||
this.setStructure(TileEntityLargeTank.class, b -> b.part("main") | ||
.of("CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC").of("CC~CC", "C---C", "C---C", "C---C", "CCCCC").of(0).build() | ||
.atElement('C', StructureUtility.lazy(t -> ofBlock(t.getCasing()))).offset(1, 1, 0) | ||
.build()); | ||
} | ||
this.capacity = capacity; | ||
String prefix = material == Wood ? "wood" : "metal"; | ||
baseTexture(new Texture(GTIRef.ID, "block/casing/wall/" + prefix)); | ||
overlayTexture((type, state, tier) -> { | ||
Texture blank = new Texture(GTIRef.ID, "block/machine/empty"); | ||
return new Texture[]{blank, blank, blank, new Texture(GTIRef.ID, "block/casing/wall/" + prefix + "_tank_side_overlay"), blank, blank}; | ||
}); | ||
setAllowVerticalFacing(true); | ||
} | ||
|
||
public int getCapacity() { | ||
return capacity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
common/src/main/java/muramasa/gregtech/tile/multi/TileEntityLargeTank.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package muramasa.gregtech.tile.multi; | ||
|
||
import earth.terrarium.botarium.common.fluid.base.FluidHolder; | ||
import earth.terrarium.botarium.common.fluid.base.PlatformFluidHandler; | ||
import io.github.gregtechintergalactical.gtutility.blockentity.BlockEntityMaterialBasicMultiMachine; | ||
import io.github.gregtechintergalactical.gtutility.machine.MaterialBasicMultiMachine; | ||
import muramasa.antimatter.AntimatterAPI; | ||
import muramasa.antimatter.capability.fluid.FluidTank; | ||
import muramasa.antimatter.capability.fluid.FluidTanks; | ||
import muramasa.antimatter.capability.machine.MachineFluidHandler; | ||
import muramasa.antimatter.util.Utils; | ||
import muramasa.gregtech.GTIRef; | ||
import muramasa.gregtech.machine.MultiblockTankMachine; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import tesseract.FluidPlatformUtils; | ||
import tesseract.TesseractCapUtils; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.Optional; | ||
|
||
import static muramasa.antimatter.data.AntimatterMaterials.Wood; | ||
import static net.minecraft.core.Direction.DOWN; | ||
import static net.minecraft.core.Direction.UP; | ||
|
||
public class TileEntityLargeTank extends BlockEntityMaterialBasicMultiMachine<TileEntityLargeTank> { | ||
public TileEntityLargeTank(MultiblockTankMachine type, BlockPos pos, BlockState state) { | ||
super(type, pos, state); | ||
this.fluidHandler.set(() -> new LargeTankFluidHandler(this, type.getCapacity(), 10000, 1, 0)); | ||
} | ||
|
||
@Override | ||
public boolean allowsFakeTiles() { | ||
return true; | ||
} | ||
|
||
public Block getCasing(){ | ||
Block block = AntimatterAPI.get(Block.class, GTIRef.ID, material.getId() + "_wall"); | ||
if (block != null) return block; | ||
return Blocks.BEDROCK; | ||
} | ||
|
||
public static class LargeTankFluidHandler extends MachineFluidHandler<TileEntityLargeTank> { | ||
|
||
public LargeTankFluidHandler(TileEntityLargeTank tile, int capacity, int pressure, int inputCount, int outputCount) { | ||
super(tile, capacity, pressure, inputCount, outputCount); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public FluidTanks getOutputTanks() { | ||
return super.getInputTanks(); | ||
} | ||
|
||
@Override | ||
protected FluidTank getTank(int tank) { | ||
return getInputTanks().getTank(tank); | ||
} | ||
|
||
@Override | ||
public FluidTanks getTanks(int tank) { | ||
return getInputTanks(); | ||
} | ||
|
||
@Override | ||
public void onUpdate() { | ||
super.onUpdate(); | ||
if (tile.getLevel().getGameTime() % 20 == 0){ | ||
Direction dir = tile.getFacing(); | ||
if (getTank(0).getStoredFluid().getFluidAmount() > 0 && dir != UP){ | ||
BlockEntity adjacent = tile.getLevel().getBlockEntity(tile.getBlockPos().relative(dir)); | ||
if (adjacent != null){ | ||
Optional<PlatformFluidHandler> cap = TesseractCapUtils.getFluidHandler(tile.getLevel(), tile.getBlockPos().relative(dir), dir.getOpposite()); | ||
cap.ifPresent(other -> Utils.transferFluids(this.getOutputTanks(), other, 1000)); | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public long insertFluid(FluidHolder fluid, boolean simulate) { | ||
if (tile.getMaterial() == Wood){ | ||
|
||
} | ||
return super.insertFluid(fluid, simulate); | ||
} | ||
} | ||
} |
Binary file added
BIN
+443 Bytes
...c/main/resources/assets/gti/textures/block/casing/metal_wall/colored/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+443 Bytes
...src/main/resources/assets/gti/textures/block/casing/metal_wall/colored/side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+443 Bytes
.../src/main/resources/assets/gti/textures/block/casing/metal_wall/colored/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+443 Bytes
.../resources/assets/gti/textures/block/casing/metal_wall/colored_front/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+443 Bytes
...in/resources/assets/gti/textures/block/casing/metal_wall/colored_front/side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+443 Bytes
...ain/resources/assets/gti/textures/block/casing/metal_wall/colored_front/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+141 Bytes
...c/main/resources/assets/gti/textures/block/casing/metal_wall/overlay/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+141 Bytes
...src/main/resources/assets/gti/textures/block/casing/metal_wall/overlay/side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+141 Bytes
.../src/main/resources/assets/gti/textures/block/casing/metal_wall/overlay/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+228 Bytes
.../resources/assets/gti/textures/block/casing/metal_wall/overlay_front/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+228 Bytes
...ain/resources/assets/gti/textures/block/casing/metal_wall/overlay_front/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+443 Bytes
common/src/main/resources/assets/gti/textures/block/casing/wall/metal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+228 Bytes
...ain/resources/assets/gti/textures/block/casing/wall/metal_tank_side_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+314 Bytes
common/src/main/resources/assets/gti/textures/block/casing/wall/wood.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+267 Bytes
.../src/main/resources/assets/gti/textures/block/casing/wall/wood_overlay_side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+324 Bytes
...main/resources/assets/gti/textures/block/casing/wall/wood_tank_side_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+228 Bytes
.../main/resources/assets/gti/textures/block/casing/wall/wood_tank_top_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+314 Bytes
...rc/main/resources/assets/gti/textures/block/casing/wood_wall/colored/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+314 Bytes
.../src/main/resources/assets/gti/textures/block/casing/wood_wall/colored/side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+314 Bytes
...n/src/main/resources/assets/gti/textures/block/casing/wood_wall/colored/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+314 Bytes
...n/resources/assets/gti/textures/block/casing/wood_wall/colored_front/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+314 Bytes
...ain/resources/assets/gti/textures/block/casing/wood_wall/colored_front/side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+314 Bytes
...main/resources/assets/gti/textures/block/casing/wood_wall/colored_front/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+141 Bytes
...rc/main/resources/assets/gti/textures/block/casing/wood_wall/overlay/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+267 Bytes
.../src/main/resources/assets/gti/textures/block/casing/wood_wall/overlay/side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+141 Bytes
...n/src/main/resources/assets/gti/textures/block/casing/wood_wall/overlay/top.png
Oops, something went wrong.
Binary file added
BIN
+228 Bytes
...n/resources/assets/gti/textures/block/casing/wood_wall/overlay_front/bottom.png
Oops, something went wrong.
Binary file added
BIN
+324 Bytes
...ain/resources/assets/gti/textures/block/casing/wood_wall/overlay_front/side.png
Oops, something went wrong.
Binary file added
BIN
+228 Bytes
...main/resources/assets/gti/textures/block/casing/wood_wall/overlay_front/top.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters