Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -4292,6 +4292,7 @@
"item.gtceu.engraved_crystal_chip": "dıɥƆ ןɐʇsʎɹƆ pǝʌɐɹbuƎ",
"item.gtceu.engraved_crystal_chip.tooltip": "sʇınɔɹıƆ ɹoɟ pǝpǝǝNㄥ§",
"item.gtceu.engraved_lapotron_crystal_chip": "dıɥƆ ןɐʇsʎɹƆ uoɹʇodɐꞀ pǝʌɐɹbuƎ",
"item.gtceu.entity_spoilable": "ǝןqɐןıodS ʎʇıʇuƎ",
"item.gtceu.epoxy_circuit_board": "pɹɐoᗺ ʇınɔɹıƆ ʎxodƎ",
"item.gtceu.epoxy_circuit_board.tooltip": "pɹɐoᗺ pǝɔuɐʌpⱯ uⱯㄥ§",
"item.gtceu.epoxy_printed_circuit_board": "pɹɐoᗺ ʇınɔɹıƆ pǝʇuıɹԀ ʎxodƎ",
Expand Down Expand Up @@ -4535,6 +4536,7 @@
"item.gtceu.machine_memory_card": "pɹɐƆ ʎɹoɯǝW ǝuıɥɔɐW",
"item.gtceu.magenta_dye_spray_can": ")ɐʇuǝbɐW( uɐƆ ʎɐɹdS",
"item.gtceu.magenta_glass_lens": ")ɐʇuǝbɐW( suǝꞀ ssɐן⅁",
"item.gtceu.magnetized_golden_carrot": "ʇoɹɹɐƆ uǝpןo⅁ ɔıʇǝubɐW",
"item.gtceu.maintenance_detector_cover": "ɹoʇɔǝʇǝᗡ ǝɔuɐuǝʇuıɐW",
"item.gtceu.mask_filter": "ɹǝʇןıℲ ʞsɐW sɐ⅁",
"item.gtceu.matchbox": "xoqɥɔʇɐW",
Expand Down Expand Up @@ -4847,6 +4849,11 @@
"item.gtceu.solar_panel.tooltip.0": "˙noʎ ɥʇıʍ ǝq unS ǝɥʇ ʎɐWㄥ§",
"item.gtceu.solar_panel.tooltip.1": "˙ㄥ§ɹǝʌoƆɟ§ sɐ ㄥ§unSǝ§ ǝɥʇ ɯoɹɟ ㄥ§ʎbɹǝuƎɟ§ sǝɔnpoɹԀ",
"item.gtceu.solvent_spray_can": ")ʇuǝʌןoS( uɐƆ ʎɐɹdS",
"item.gtceu.spoilable_1": "Ɩ ǝןqɐןıodS",
"item.gtceu.spoilable_2": "ᄅ ǝןqɐןıodS",
"item.gtceu.spoilable_3": "Ɛ ǝןqɐןıodS",
"item.gtceu.spoilable_4": "ㄣ ǝןqɐןıodS",
"item.gtceu.spoilable_5": "ϛ ǝןqɐןıodS",
"item.gtceu.stainless_steel_fluid_cell": "ןןǝƆ ןǝǝʇS ssǝןuıɐʇS %s",
"item.gtceu.steel_fluid_cell": "ןןǝƆ ןǝǝʇS %s",
"item.gtceu.steel_minecart_wheels": "sןǝǝɥM ʇɹɐɔǝuıW ןǝǝʇS",
Expand Down
7 changes: 7 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -4292,6 +4292,7 @@
"item.gtceu.engraved_crystal_chip": "Engraved Crystal Chip",
"item.gtceu.engraved_crystal_chip.tooltip": "§7Needed for Circuits",
"item.gtceu.engraved_lapotron_crystal_chip": "Engraved Lapotron Crystal Chip",
"item.gtceu.entity_spoilable": "Entity Spoilable",
"item.gtceu.epoxy_circuit_board": "Epoxy Circuit Board",
"item.gtceu.epoxy_circuit_board.tooltip": "§7An Advanced Board",
"item.gtceu.epoxy_printed_circuit_board": "Epoxy Printed Circuit Board",
Expand Down Expand Up @@ -4535,6 +4536,7 @@
"item.gtceu.machine_memory_card": "Machine Memory Card",
"item.gtceu.magenta_dye_spray_can": "Spray Can (Magenta)",
"item.gtceu.magenta_glass_lens": "Glass Lens (Magenta)",
"item.gtceu.magnetized_golden_carrot": "Magnetic Golden Carrot",
"item.gtceu.maintenance_detector_cover": "Maintenance Detector",
"item.gtceu.mask_filter": "Gas Mask Filter",
"item.gtceu.matchbox": "Matchbox",
Expand Down Expand Up @@ -4847,6 +4849,11 @@
"item.gtceu.solar_panel.tooltip.0": "§7May the Sun be with you.",
"item.gtceu.solar_panel.tooltip.1": "Produces §fEnergy§7 from the §eSun§7 as §fCover§7.",
"item.gtceu.solvent_spray_can": "Spray Can (Solvent)",
"item.gtceu.spoilable_1": "Spoilable 1",
"item.gtceu.spoilable_2": "Spoilable 2",
"item.gtceu.spoilable_3": "Spoilable 3",
"item.gtceu.spoilable_4": "Spoilable 4",
"item.gtceu.spoilable_5": "Spoilable 5",
"item.gtceu.stainless_steel_fluid_cell": "%s Stainless Steel Cell",
"item.gtceu.steel_fluid_cell": "%s Steel Cell",
"item.gtceu.steel_minecart_wheels": "Steel Minecart Wheels",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/entity_spoilable"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/magnetized_golden_carrot"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/spoilable_1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/spoilable_2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/spoilable_3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/spoilable_4"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/spoilable_5"
}
}
31 changes: 18 additions & 13 deletions src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public CommonProxy() {
GTCommandArguments.init(eventBus);
GTMobEffects.init(eventBus);
GTParticleTypes.init(eventBus);
SpoilableBehavior.init(eventBus);

eventBus.addListener(AlloyBlastPropertyAddition::addAlloyBlastProperties);
}
Expand Down Expand Up @@ -173,6 +172,7 @@ public static void init() {
CustomBlockRotations.init();
SyncedKeyMappings.init();
MachineOwner.init();
SpoilableBehavior.init(modBus);

FusionReactorMachine.registerFusionTier(GTValues.LuV, " (MKI)");
FusionReactorMachine.registerFusionTier(GTValues.ZPM, " (MKII)");
Expand Down Expand Up @@ -235,35 +235,40 @@ public void addSpoilTransferModifier(ModifyMachineEvent event) {

@SubscribeEvent
public void registerDevSpoilables(RegisterSpoilablesEvent event) {
Comment thread
TarLaboratories marked this conversation as resolved.
Outdated
if (GTCEu.isDev()) { // for testing purposes
if (GTCEu.isDev()) {
event.getBuilder()
.ticks(10)
.result(Items.DIRT)
.result(GTItems.SPOILABLE_2)
.build()
.attachTo(Items.JIGSAW);
.attachTo(GTItems.SPOILABLE_1);
event.getBuilder()
.ticks(10)
.result(Items.STRUCTURE_BLOCK)
.ticks(40)
.result(GTItems.SPOILABLE_3)
.build()
.attachTo(Items.APPLE);
.attachTo(GTItems.SPOILABLE_2);
event.getBuilder()
.ticks(40)
.result(Items.STRUCTURE_VOID)
.ticks(10)
.result(GTItems.SPOILABLE_4)
.build()
.attachTo(Items.STRUCTURE_BLOCK);
.attachTo(GTItems.SPOILABLE_3);
event.getBuilder()
.ticks(10)
.result(Items.JIGSAW)
.result(GTItems.SPOILABLE_5)
.build()
.attachTo(Items.STRUCTURE_VOID);
.attachTo(GTItems.SPOILABLE_4);
event.getBuilder()
.ticks(10)
.result(Items.DRAGON_EGG)
.result(EntityType.PIG)
.multiplyResult(3)
.build()
.attachTo(Items.EGG);
.attachTo(GTItems.ENTITY_SPOILABLE);
}
event.getBuilder()
.ticks(20 * 60 * 30)
.result(Items.GOLDEN_CARROT)
.build()
.attachTo(GTItems.MAGNETIZED_CARROT);
}

@SubscribeEvent
Expand Down
43 changes: 43 additions & 0 deletions src/main/java/com/gregtechceu/gtceu/common/data/GTItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.food.Foods;
import net.minecraft.world.item.*;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.LayeredCauldronBlock;
Expand Down Expand Up @@ -2565,6 +2566,48 @@ public static ItemEntry<ComponentItem> createFluidCell(Material mat, int capacit
.onRegister(attach(new GuiModuleBehaviour()))
.register();

public static ItemEntry<Item> SPOILABLE_1;
public static ItemEntry<Item> SPOILABLE_2;
public static ItemEntry<Item> SPOILABLE_3;
public static ItemEntry<Item> SPOILABLE_4;
public static ItemEntry<Item> SPOILABLE_5;
public static ItemEntry<Item> ENTITY_SPOILABLE;

static {
if (GTCEu.isDev()) {
SPOILABLE_1 = REGISTRATE.item("spoilable_1", Item::new)
.lang("Spoilable 1")
.register();
SPOILABLE_2 = REGISTRATE.item("spoilable_2", Item::new)
.lang("Spoilable 2")
.register();
SPOILABLE_3 = REGISTRATE.item("spoilable_3", Item::new)
.lang("Spoilable 3")
.register();
SPOILABLE_4 = REGISTRATE.item("spoilable_4", Item::new)
.lang("Spoilable 4")
.register();
SPOILABLE_5 = REGISTRATE.item("spoilable_5", Item::new)
.lang("Spoilable 5")
.register();
ENTITY_SPOILABLE = REGISTRATE.item("entity_spoilable", Item::new)
.lang("Entity Spoilable")
.register();
}
}

public static ItemEntry<ComponentItem> MAGNETIZED_CARROT = REGISTRATE
.item("magnetized_golden_carrot", ComponentItem::create)
.lang("Magnetic Golden Carrot")
Comment thread
TarLaboratories marked this conversation as resolved.
.onRegister(attach(new FoodStats(new FoodProperties.Builder()
.nutrition(Foods.GOLDEN_CARROT.getNutrition())
.saturationMod(Foods.GOLDEN_CARROT.getSaturationModifier())
.effect(() -> new MobEffectInstance(MobEffects.DIG_SPEED, 20 * 60 * 10, 1), 1)
.fast()
.alwaysEat()
.build())))
.register();

public static void init() {
GTMaterialItems.generateMaterialItems();
GTMaterialItems.generateTools();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,7 @@ public abstract class SpoilableItemStack implements ISpoilableItem, IAddInformat
public static final String SPOIL_CONTEXT_KEY = "spoilContext";
public static final String FROZEN_TICKS_KEY = "frozenRemainingTicks";
public static final String CREATION_TICK_KEY = "creationTick";
/**
* Consider frozen and non-frozen spoilables equal. This is done to allow filtering by ticks remaining until
* spoiled.<br>
* If you want the player to have frozen stacks in their inventory, set this to {@code false} to prevent players
* from
* entirely bypassing the spoilage system.
*/
public static boolean FROZEN_EQUALITY = true;

@Getter
private final ItemStack stack;

Expand Down Expand Up @@ -263,8 +256,7 @@ public void deserializeNBT(Tag nbt) {

/**
* This method averages the spoil progress of the two stacks (or, more
* accurately, their {@link ISpoilableItem#getCreationTick()}). If {@link SpoilableItemStack#FROZEN_EQUALITY}
* is {@code true}, this method will ignore the frozen/not frozen status of stacks.
* accurately, their {@link ISpoilableItem#getCreationTick()}).
*
* @implNote This implementation may lead to spoil progress averaging in situations other
* than stack merging, though I don't think this will lead to any big user-facing bugs.
Expand All @@ -287,6 +279,7 @@ public void prepareForComparisonWith(INBTSerializable<Tag> other) {
this.setCreationTick(average);
spoilable.setCreationTick(average);
}
spoilable.setSpoilContext(this.spoilContext);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,5 +631,10 @@ public static void init(Consumer<FinishedRecipe> provider) {
new MaterialEntry(gem, Lazurite));
VanillaRecipeHelper.addShapelessRecipe(provider, "sodalite_to_dye", new ItemStack(Items.BLUE_DYE),
new MaterialEntry(gem, Sodalite));

POLARIZER_RECIPES.recipeBuilder("magnetize_golden_carrot")
.inputItems(Items.GOLDEN_CARROT)
.outputItems(MAGNETIZED_CARROT)
.duration(100).EUt(8).save(provider);
}
}
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
Loading