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

Commit

Permalink
added spray cans, still wip
Browse files Browse the repository at this point in the history
also updated antimatter
  • Loading branch information
Trinsdar committed Aug 24, 2024
1 parent 3c0ad32 commit 287f4ac
Show file tree
Hide file tree
Showing 21 changed files with 51 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public ReactorModel readModel(JsonDeserializationContext context, JsonObject jso
ResourceLocation modelLocation = new ResourceLocation(GTIRef.ID, "block/machine/overlay/nuclear_reactor_core/"+ array[i] + "-rod");
try {
rods[i] = ModelUtils.getModel(modelLocation);
} catch (IllegalStateException e){
rods[i] = ModelUtils.getModel(modelLocation);
} catch (Exception ignored){
//rods[i] = ModelUtils.getModel(modelLocation);
}

}
Expand Down
17 changes: 17 additions & 0 deletions common/src/main/java/muramasa/gregtech/data/GregTechItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import muramasa.gregtech.GTIRef;
import muramasa.gregtech.GregTech;
import muramasa.gregtech.items.*;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Item;

import static muramasa.gregtech.data.Materials.*;
Expand Down Expand Up @@ -47,6 +48,22 @@ public class GregTechItems {
public static ItemBasic<?> SensorHV = new ItemBasic<>(GTIRef.ID, "sensor_hv");
public static ItemBasic<?> SensorEV = new ItemBasic<>(GTIRef.ID, "sensor_ev");
public static ItemBasic<?> SensorIV = new ItemBasic<>(GTIRef.ID, "sensor_iv");
public static ItemBasic<?> WhiteSprayCan = new ItemSprayCan(DyeColor.WHITE);
public static ItemBasic<?> OrangeSprayCan = new ItemSprayCan(DyeColor.ORANGE);
public static ItemBasic<?> MagentaSprayCan = new ItemSprayCan(DyeColor.MAGENTA);
public static ItemBasic<?> LightBlueSprayCan = new ItemSprayCan(DyeColor.LIGHT_BLUE);
public static ItemBasic<?> YellowSprayCan = new ItemSprayCan(DyeColor.YELLOW);
public static ItemBasic<?> LimeSprayCan = new ItemSprayCan(DyeColor.LIME);
public static ItemBasic<?> PinkSprayCan = new ItemSprayCan(DyeColor.PINK);
public static ItemBasic<?> GraySprayCan = new ItemSprayCan(DyeColor.GRAY);
public static ItemBasic<?> LightGraySprayCan = new ItemSprayCan(DyeColor.LIGHT_GRAY);
public static ItemBasic<?> CyanSprayCan = new ItemSprayCan(DyeColor.CYAN);
public static ItemBasic<?> PurpleSprayCan = new ItemSprayCan(DyeColor.PURPLE);
public static ItemBasic<?> BlueSprayCan = new ItemSprayCan(DyeColor.BLUE);
public static ItemBasic<?> BrownSprayCan = new ItemSprayCan(DyeColor.BROWN);
public static ItemBasic<?> GreenSprayCan = new ItemSprayCan(DyeColor.GREEN);
public static ItemBasic<?> RedSprayCan = new ItemSprayCan(DyeColor.RED);
public static ItemBasic<?> BlackSprayCan = new ItemSprayCan(DyeColor.BLACK);
/** CIRCUIT ITEMS **/

public static ItemBasic<?> MicroProcessor = new ItemBasic<>(GTIRef.ID, "microprocessor", "circuits/").tip("A Basic Circuit");
Expand Down
31 changes: 31 additions & 0 deletions common/src/main/java/muramasa/gregtech/items/ItemSprayCan.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package muramasa.gregtech.items;

import muramasa.antimatter.blockentity.pipe.BlockEntityPipe;
import muramasa.antimatter.item.ItemBasic;
import muramasa.antimatter.pipe.types.FluidPipe;
import muramasa.antimatter.pipe.types.ItemPipe;
import muramasa.gregtech.GTIRef;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.block.entity.BlockEntity;

public class ItemSprayCan extends ItemBasic<ItemSprayCan> {
private final DyeColor color;

public ItemSprayCan(DyeColor color) {
super(GTIRef.ID, color.getName() + "_spray_can", "spray_cans/");
this.color = color;
}

@Override
public InteractionResult useOn(UseOnContext context) {
BlockEntity be = context.getLevel().getBlockEntity(context.getClickedPos());
if (!context.getLevel().isClientSide() && be instanceof BlockEntityPipe<?> pipe && (pipe.getPipeType() instanceof FluidPipe || pipe.getPipeType() instanceof ItemPipe)){
pipe.setPipeColor(color.getTextColor());
pipe.sidedSync(true);
return InteractionResult.SUCCESS;
}
return super.useOn(context);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 287f4ac

Please sign in to comment.