Skip to content

Commit

Permalink
Don't bother saving the last color to items when breaking a QIO compo…
Browse files Browse the repository at this point in the history
…nents as it is just used for seeing if the BE should sync to client
  • Loading branch information
pupnewfster committed Mar 1, 2024
1 parent 0ef8269 commit a6edd88
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.4 2024-02-28T16:59:29.0634054 Loot Tables
// 1.20.4 2024-02-29T19:28:33.5488725 Loot Tables
b4a05e7ba50da33988cfbf7827826c6dc5a141d9 data/mekanism/loot_tables/blocks/advanced_bin.json
cd266e7b4a5bde833aa11e1caf17d86631197626 data/mekanism/loot_tables/blocks/advanced_chemical_tank.json
6829ad29ae722d1ef741fc103dfd5704c1874a66 data/mekanism/loot_tables/blocks/advanced_combining_factory.json
Expand Down Expand Up @@ -133,11 +133,11 @@ c93f6d48138eea1ef6219fbe4a261e1219ca0b0c data/mekanism/loot_tables/blocks/nutrit
28aa6ead6f5f68b2b036a3c6f6f1d1361f611883 data/mekanism/loot_tables/blocks/pressure_disperser.json
0fc3d3a1c2311db010484950f8ca47044f5748dc data/mekanism/loot_tables/blocks/pressurized_reaction_chamber.json
8264c1d2b3ac806201a2e22573779d0954d6ae84 data/mekanism/loot_tables/blocks/purification_chamber.json
30b6eef51790c57fad9fd8f73ac3acc9e6e266b7 data/mekanism/loot_tables/blocks/qio_dashboard.json
e173588162075874da89da6450bf3111572a13c8 data/mekanism/loot_tables/blocks/qio_drive_array.json
7a50e1708345efae43254f594657e12a2af4c8db data/mekanism/loot_tables/blocks/qio_exporter.json
2950b52bf92ea19b0dd81c1fa3ba457a9a04cb4e data/mekanism/loot_tables/blocks/qio_importer.json
9bf9bc1bedb91bd0cc25a93b1d99d72bb5646f9a data/mekanism/loot_tables/blocks/qio_redstone_adapter.json
353c31ce8f86e5787310821aa82a4bc50662c7c8 data/mekanism/loot_tables/blocks/qio_dashboard.json
d03909e03fcdcbfeb73e47ade1d18da374efc628 data/mekanism/loot_tables/blocks/qio_drive_array.json
3753c4dc0ede114e1e828e2fe6984bd77055b7ac data/mekanism/loot_tables/blocks/qio_exporter.json
d26c883389d1ac6139397f6c6ad5dc231bd8b2d3 data/mekanism/loot_tables/blocks/qio_importer.json
e683f63154bde2c9cc77e26e2714fe6d51223c37 data/mekanism/loot_tables/blocks/qio_redstone_adapter.json
5f09276294e2367e32102c287f0e2a61facee062 data/mekanism/loot_tables/blocks/quantum_entangloporter.json
a83942e741e98eec7bb60a34fc43be78b599a64e data/mekanism/loot_tables/blocks/radioactive_waste_barrel.json
3c2da914833207168dafcef0869a603f10e54c95 data/mekanism/loot_tables/blocks/resistive_heater.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@
{
"type": "mekanism:inventory_slots",
"function": "mekanism:copy_containers"
},
{
"function": "mekanism:copy_to_attachments",
"ops": [
{
"source": "color",
"target": "mekanism:color"
}
],
"source": "block_entity"
}
],
"name": "mekanism:qio_dashboard"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@
{
"type": "mekanism:inventory_slots",
"function": "mekanism:copy_containers"
},
{
"function": "mekanism:copy_to_attachments",
"ops": [
{
"source": "color",
"target": "mekanism:color"
}
],
"source": "block_entity"
}
],
"name": "mekanism:qio_drive_array"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
"source": "auto",
"target": "mekanism:auto"
},
{
"source": "color",
"target": "mekanism:color"
},
{
"source": "controlType",
"target": "mekanism:redstone_control"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
"source": "auto",
"target": "mekanism:auto"
},
{
"source": "color",
"target": "mekanism:color"
},
{
"source": "controlType",
"target": "mekanism:redstone_control"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
"source": "amount",
"target": "mekanism:long_amount"
},
{
"source": "color",
"target": "mekanism:color"
},
{
"source": "fuzzyMode",
"target": "mekanism:fuzzy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ private MekanismAttachmentTypes() {
public static final MekanismDeferredHolder<AttachmentType<?>, AttachmentType<RedstoneControl>> REDSTONE_CONTROL = ATTACHMENT_TYPES.register("redstone_control", RedstoneControl.class);
public static final MekanismDeferredHolder<AttachmentType<?>, AttachmentType<RedstoneOutput>> REDSTONE_OUTPUT = ATTACHMENT_TYPES.register("redstone_output", RedstoneOutput.class);

public static final MekanismDeferredHolder<AttachmentType<?>, AttachmentType<Optional<EnumColor>>> COLOR = ATTACHMENT_TYPES.registerOptional("color", EnumColor.class);
public static final MekanismDeferredHolder<AttachmentType<?>, AttachmentType<Optional<EnumColor>>> TRANSPORTER_COLOR = ATTACHMENT_TYPES.register("transporter_color",
() -> AttachmentType.<Optional<EnumColor>>builder(Optional::empty)
.serialize(new IAttachmentSerializer<IntTag, Optional<EnumColor>>() {
Expand Down Expand Up @@ -161,7 +160,7 @@ public Optional<EnumColor> read(IAttachmentHolder holder, IntTag tag) {
public static final MekanismDeferredHolder<AttachmentType<?>, AttachmentType<Boolean>> SILK_TOUCH = ATTACHMENT_TYPES.registerBoolean("silk_touch", false);
public static final MekanismDeferredHolder<AttachmentType<?>, AttachmentType<Boolean>> INVERSE = ATTACHMENT_TYPES.registerBoolean("inverse", false);
public static final MekanismDeferredHolder<AttachmentType<?>, AttachmentType<Boolean>> INVERSE_REQUIRES_REPLACE = ATTACHMENT_TYPES.registerBoolean("inverse_replace", false);
//TODO: Re-evaluate the from_recipe data
//TODO: Re-evaluate the from_recipe data. For one thing maybe it can get away with being an attachment that is not serializable/able to be copied?
public static final MekanismDeferredHolder<AttachmentType<?>, AttachmentType<Boolean>> FROM_RECIPE = ATTACHMENT_TYPES.registerBoolean("from_recipe", false);

public static final MekanismDeferredHolder<AttachmentType<?>, AttachmentType<Integer>> RADIUS = ATTACHMENT_TYPES.registerNonNegativeInt("radius", TileEntityDigitalMiner.DEFAULT_RADIUS);
Expand Down
25 changes: 0 additions & 25 deletions src/main/java/mekanism/common/tile/qio/TileEntityQIOComponent.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package mekanism.common.tile.qio;

import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import mekanism.api.NBTConstants;
import mekanism.api.providers.IBlockProvider;
import mekanism.api.security.SecurityMode;
Expand All @@ -13,18 +11,14 @@
import mekanism.common.integration.computer.annotation.ComputerMethod;
import mekanism.common.lib.frequency.Frequency.FrequencyIdentity;
import mekanism.common.lib.frequency.FrequencyType;
import mekanism.common.registries.MekanismAttachmentTypes;
import mekanism.common.tile.base.TileEntityMekanism;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.NBTUtils;
import mekanism.common.util.WorldUtils;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.state.BlockState;
import net.neoforged.neoforge.attachment.AttachmentType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -74,25 +68,6 @@ public void readSustainedData(CompoundTag dataMap) {
}
}

@Override
public Map<String, Holder<AttachmentType<?>>> getTileDataAttachmentRemap() {
Map<String, Holder<AttachmentType<?>>> remap = super.getTileDataAttachmentRemap();
remap.put(NBTConstants.COLOR, MekanismAttachmentTypes.COLOR);
return remap;
}

@Override
public void writeToStack(ItemStack stack) {
super.writeToStack(stack);
stack.setData(MekanismAttachmentTypes.COLOR, Optional.ofNullable(lastColor));
}

@Override
public void readFromStack(ItemStack stack) {
super.readFromStack(stack);
lastColor = stack.getData(MekanismAttachmentTypes.COLOR).orElse(null);
}

@NotNull
@Override
public CompoundTag getReducedUpdateTag() {
Expand Down

0 comments on commit a6edd88

Please sign in to comment.