Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
fixed mining pipe texture and lang, updated antimatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Aug 7, 2023
1 parent 7b4a080 commit f3c8039
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 3 deletions.
25 changes: 23 additions & 2 deletions common/src/main/java/muramasa/gregtech/block/BlockMiningPipe.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
package muramasa.gregtech.block;

import muramasa.antimatter.Ref;
import muramasa.antimatter.block.BlockBasic;
import muramasa.antimatter.datagen.providers.AntimatterBlockStateProvider;
import muramasa.antimatter.registration.IColorHandler;
import muramasa.antimatter.registration.IItemBlockProvider;
import muramasa.antimatter.texture.Texture;
import muramasa.gregtech.GTIRef;
import muramasa.gregtech.data.Materials;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
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.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;

public class BlockMiningPipe extends BlockBasic implements IItemBlockProvider {
public class BlockMiningPipe extends BlockBasic implements IItemBlockProvider, IColorHandler {
VoxelShape shape = null;
public BlockMiningPipe(String domain, String id, Properties properties) {
super(domain, id, properties);
Expand All @@ -30,10 +36,15 @@ public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, Co
return super.getShape(state, level, pos, context);
}

@Override
public Texture[] getTextures() {
return new Texture[]{new Texture(GTIRef.ID, "block/pipe/mining_pipe")};
}

@Override
public void onBlockModelBuild(Block block, AntimatterBlockStateProvider prov) {
if (getId().equals("mining_pipe_thin")){
prov.state(block, prov.getBuilder(block).parent(new ResourceLocation("block/fence_post")).texture("texture", new ResourceLocation(GTIRef.ID, "block/casing/brick")));
prov.state(block, () -> prov.existing(GTIRef.ID,"block/mining_pipe_thin"));
return;
}
super.onBlockModelBuild(block, prov);
Expand All @@ -43,4 +54,14 @@ public void onBlockModelBuild(Block block, AntimatterBlockStateProvider prov) {
public boolean generateItemBlock() {
return !getId().equals("mining_pipe");
}

@Override
public int getBlockColor(BlockState state, @Nullable BlockGetter world, @Nullable BlockPos pos, int i) {
return Materials.Steel.getRGB();
}

@Override
public int getItemColor(ItemStack stack, @Nullable Block block, int i) {
return Materials.Steel.getRGB();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public ICoverMode getCoverMode() {

@Override
public void onPlace() {
super.onPlace();
if (handler.getTile() instanceof TileEntityPipe<?> pipe){
pipe.setConnection(this.side);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ protected void english(String domain, String locale) {
add(i, lowerUnderscoreToUpperSpaced(i.getId()));
});

add(GregTechData.MINING_PIPE, "Mining Pipe");
add(GregTechData.MINING_PIPE_THIN, "Mining Pipe");
add(GregTechData.BRITTLE_CHARCOAL, "Brittle Charcoal");
AntimatterAPI.all(BlockFakeCasing.class, domain).forEach(i -> add(i, lowerUnderscoreToUpperSpaced(i.getId())));
AntimatterAPI.all(BlockCoil.class, domain).forEach(i -> add(i, lowerUnderscoreToUpperSpaced(i.getId())));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"all": "antimatter:material/metallic/pipe/pipe_side",
"particle": "#all"
},
"elements": [
{
"from": [6, 0, 6],
"to": [10, 16, 10],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [6, 0, 10, 16], "rotation": 180, "texture": "#all", "tintindex": 0},
"east": {"uv": [0, 6, 16, 10], "rotation": 90, "texture": "#all", "tintindex": 0},
"south": {"uv": [6, 0, 10, 16], "texture": "#all", "tintindex": 0},
"west": {"uv": [0, 6, 16, 10], "rotation": 270, "texture": "#all", "tintindex": 0},
"up": {"uv": [6, 6, 10, 10], "texture": "#all", "tintindex": 1},
"down": {"uv": [6, 6, 10, 10], "rotation": 180, "texture": "#all", "tintindex": 1}
}
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f3c8039

Please sign in to comment.