From 01a95326785a64f18e0f4be966142954671dcc11 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:46:17 +0100 Subject: [PATCH 1/4] Water whe doing - Fixed factory gauge sending incomplete orders when activating in the same tick as a competing gauge - Water wheels now maintain their texture material when pasted in a schematic --- .../kinetics/waterwheel/WaterWheelBlockEntity.java | 6 ++++++ .../factoryBoard/FactoryPanelBehaviour.java | 2 ++ .../logistics/packager/PackagerBlockEntity.java | 13 +++++++++---- .../packagerLink/LogisticallyLinkedBehaviour.java | 13 +++++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/kinetics/waterwheel/WaterWheelBlockEntity.java b/src/main/java/com/simibubi/create/content/kinetics/waterwheel/WaterWheelBlockEntity.java index 36a60adeda..8eba206796 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/waterwheel/WaterWheelBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/kinetics/waterwheel/WaterWheelBlockEntity.java @@ -199,6 +199,12 @@ public class WaterWheelBlockEntity extends GeneratingKineticBlockEntity { redraw(); } + @Override + public void writeSafe(CompoundTag tag) { + super.writeSafe(tag); + tag.put("Material", NbtUtils.writeBlockState(material)); + } + @Override public void write(CompoundTag compound, boolean clientPacket) { super.write(compound, clientPacket); diff --git a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java index 88a6d32bbe..8d7a87e65b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java +++ b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java @@ -778,6 +778,7 @@ public class FactoryPanelBehaviour extends FilteringBehaviour implements MenuPro CompoundTag panelTag = new CompoundTag(); super.write(panelTag, clientPacket); + panelTag.putInt("Timer", timer); panelTag.putInt("LastLevel", lastReportedLevelInStorage); panelTag.putInt("LastPromised", lastReportedPromises); panelTag.putInt("LastUnloadedLinks", lastReportedUnloadedLinks); @@ -813,6 +814,7 @@ public class FactoryPanelBehaviour extends FilteringBehaviour implements MenuPro filter = FilterItemStack.of(panelTag.getCompound("Filter")); count = panelTag.getInt("FilterAmount"); upTo = panelTag.getBoolean("UpTo"); + timer = panelTag.getInt("Timer"); lastReportedLevelInStorage = panelTag.getInt("LastLevel"); lastReportedPromises = panelTag.getInt("LastPromised"); lastReportedUnloadedLinks = panelTag.getInt("LastUnloadedLinks"); diff --git a/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlockEntity.java b/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlockEntity.java index 0765e89607..6d77e6be26 100644 --- a/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlockEntity.java @@ -260,7 +260,7 @@ public class PackagerBlockEntity extends SmartBlockEntity { BlockState blockState = getBlockState(); if (!blockState.hasProperty(PackagerBlock.LINKED)) return; - boolean shouldBeLinked = shouldBeLinked(); + boolean shouldBeLinked = getLinkPos() != null; boolean isLinked = blockState.getValue(PackagerBlock.LINKED); if (shouldBeLinked == isLinked) return; @@ -272,16 +272,16 @@ public class PackagerBlockEntity extends SmartBlockEntity { .orElse(false); } - private boolean shouldBeLinked() { + private BlockPos getLinkPos() { for (Direction d : Iterate.directions) { BlockState adjacentState = level.getBlockState(worldPosition.relative(d)); if (!AllBlocks.STOCK_LINK.has(adjacentState)) continue; if (PackagerLinkBlock.getConnectedDirection(adjacentState) != d) continue; - return true; + return worldPosition.relative(d); } - return false; + return null; } public void flashLink() { @@ -545,6 +545,11 @@ public class PackagerBlockEntity extends SmartBlockEntity { if (!requestQueue && !signBasedAddress.isBlank()) PackageItem.addAddress(createdBox, signBasedAddress); + BlockPos linkPos = getLinkPos(); + if (extractedPackageItem.isEmpty() && linkPos != null + && level.getBlockEntity(linkPos) instanceof PackagerLinkBlockEntity plbe) + plbe.behaviour.deductFromAccurateSummary(extractedItems); + if (!heldBox.isEmpty() || animationTicks != 0) { queuedExitingPackages.add(createdBox); return; diff --git a/src/main/java/com/simibubi/create/content/logistics/packagerLink/LogisticallyLinkedBehaviour.java b/src/main/java/com/simibubi/create/content/logistics/packagerLink/LogisticallyLinkedBehaviour.java index 942f1921e0..a4d3152417 100644 --- a/src/main/java/com/simibubi/create/content/logistics/packagerLink/LogisticallyLinkedBehaviour.java +++ b/src/main/java/com/simibubi/create/content/logistics/packagerLink/LogisticallyLinkedBehaviour.java @@ -32,6 +32,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemStackHandler; public class LogisticallyLinkedBehaviour extends BlockEntityBehaviour { @@ -185,6 +186,18 @@ public class LogisticallyLinkedBehaviour extends BlockEntityBehaviour { return plbe.fetchSummaryFromPackager(ignoredHandler); return InventorySummary.EMPTY; } + + public void deductFromAccurateSummary(ItemStackHandler packageContents) { + InventorySummary summary = LogisticsManager.ACCURATE_SUMMARIES.getIfPresent(freqId); + if (summary == null) + return; + for (int i = 0; i < packageContents.getSlots(); i++) { + ItemStack orderedStack = packageContents.getStackInSlot(i); + if (orderedStack.isEmpty()) + continue; + summary.add(orderedStack, -Math.min(summary.getCountOf(orderedStack), orderedStack.getCount())); + } + } // From adb3de04618473ad2a48055e3dbf2acce465aae2 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 14 Feb 2025 17:11:52 +0100 Subject: [PATCH 2/4] Update Contraption.java - Fixed vault rendering on contraptions --- .../com/simibubi/create/content/contraptions/Contraption.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/simibubi/create/content/contraptions/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/Contraption.java index 0572798966..3a2a497861 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/Contraption.java @@ -684,6 +684,9 @@ public abstract class Contraption { toLocalPos(NbtUtils.readBlockPos(nbt.getCompound("Controller"))) : localPos; nbt.put("Controller", NbtUtils.writeBlockPos(controllerPos)); + + if (updateTags.containsKey(localPos)) + updateTags.get(localPos).put("Controller", NbtUtils.writeBlockPos(controllerPos)); if (multiBlockBE.isController() && multiBlockBE.getHeight() <= 1 && multiBlockBE.getWidth() <= 1) { nbt.put("LastKnownPos", NbtUtils.writeBlockPos(BlockPos.ZERO.below(Integer.MAX_VALUE - 1))); From 3d47f58daaa78e430c7de39aee0cad0799c0036d Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 14 Feb 2025 17:42:55 +0100 Subject: [PATCH 3/4] Autocompletely - Restocker gauge UI now suggests the address of the frog port on top of its packager --- .../create/content/logistics/AddressEditBox.java | 8 ++++++-- .../content/logistics/AddressEditBoxHelper.java | 7 ++++++- .../logistics/factoryBoard/FactoryPanelBehaviour.java | 11 +++++++++++ .../logistics/factoryBoard/FactoryPanelScreen.java | 4 ++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/logistics/AddressEditBox.java b/src/main/java/com/simibubi/create/content/logistics/AddressEditBox.java index 1f096fbd71..d978c8917c 100644 --- a/src/main/java/com/simibubi/create/content/logistics/AddressEditBox.java +++ b/src/main/java/com/simibubi/create/content/logistics/AddressEditBox.java @@ -25,10 +25,14 @@ public class AddressEditBox extends EditBox { private DestinationSuggestions destinationSuggestions; private Consumer mainResponder; private String prevValue = "=)"; - + public AddressEditBox(Screen screen, Font pFont, int pX, int pY, int pWidth, int pHeight, boolean anchorToBottom) { + this(screen, pFont, pX, pY, pWidth, pHeight, anchorToBottom, null); + } + + public AddressEditBox(Screen screen, Font pFont, int pX, int pY, int pWidth, int pHeight, boolean anchorToBottom, String localAddress) { super(pFont, pX, pY, pWidth, pHeight, Component.empty()); - destinationSuggestions = AddressEditBoxHelper.createSuggestions(screen, this, anchorToBottom); + destinationSuggestions = AddressEditBoxHelper.createSuggestions(screen, this, anchorToBottom, localAddress); destinationSuggestions.setAllowSuggestions(true); destinationSuggestions.updateCommandInfo(); mainResponder = t -> { diff --git a/src/main/java/com/simibubi/create/content/logistics/AddressEditBoxHelper.java b/src/main/java/com/simibubi/create/content/logistics/AddressEditBoxHelper.java index 8cf84038fe..47f159f980 100644 --- a/src/main/java/com/simibubi/create/content/logistics/AddressEditBoxHelper.java +++ b/src/main/java/com/simibubi/create/content/logistics/AddressEditBoxHelper.java @@ -38,7 +38,7 @@ public class AddressEditBoxHelper { NEARBY_CLIPBOARDS.put(blockPos, new WeakReference<>(blockEntity)); } - public static DestinationSuggestions createSuggestions(Screen screen, EditBox pInput, boolean anchorToBottom) { + public static DestinationSuggestions createSuggestions(Screen screen, EditBox pInput, boolean anchorToBottom, String localAddress) { Minecraft mc = Minecraft.getInstance(); Player player = mc.player; List> options = new ArrayList<>(); @@ -49,6 +49,11 @@ public class AddressEditBoxHelper { if (player == null) return destinationSuggestions; + + if (localAddress != null) { + options.add(IntAttached.with(-1, localAddress)); + alreadyAdded.add(localAddress); + } for (int i = 0; i < Inventory.INVENTORY_SIZE; i++) appendAddresses(options, alreadyAdded, player.getInventory() diff --git a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java index 8d7a87e65b..ce280b1c74 100644 --- a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java +++ b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelBehaviour.java @@ -26,6 +26,7 @@ import com.simibubi.create.content.logistics.BigItemStack; import com.simibubi.create.content.logistics.factoryBoard.FactoryPanelBlock.PanelSlot; import com.simibubi.create.content.logistics.filter.FilterItem; import com.simibubi.create.content.logistics.filter.FilterItemStack; +import com.simibubi.create.content.logistics.packagePort.frogport.FrogportBlockEntity; import com.simibubi.create.content.logistics.packager.InventorySummary; import com.simibubi.create.content.logistics.packager.PackagerBlockEntity; import com.simibubi.create.content.logistics.packager.PackagingRequest; @@ -1057,4 +1058,14 @@ public class FactoryPanelBehaviour extends FilteringBehaviour implements MenuPro .getName(); } + public String getFrogAddress() { + PackagerBlockEntity packager = panelBE().getRestockedPackager(); + if (packager == null) + return null; + if (packager.getLevel().getBlockEntity(packager.getBlockPos().above()) instanceof FrogportBlockEntity fpbe) + if (fpbe.addressFilter != null && !fpbe.addressFilter.isBlank()) + return fpbe.addressFilter + ""; + return null; + } + } diff --git a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java index ae323c23ee..eb39a2148c 100644 --- a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java @@ -154,8 +154,8 @@ public class FactoryPanelScreen extends AbstractSimiScreen { int y = guiTop; if (addressBox == null) { - addressBox = - new AddressEditBox(this, new NoShadowFontWrapper(font), x + 36, y + windowHeight - 51, 108, 10, false); + String frogAddress = behaviour.getFrogAddress(); + addressBox = new AddressEditBox(this, new NoShadowFontWrapper(font), x + 36, y + windowHeight - 51, 108, 10, false, frogAddress); addressBox.setValue(behaviour.recipeAddress); addressBox.setTextColor(0x555555); } From 150ef3e4979520cdeb2061779d5894ae0bb27827 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Sat, 15 Feb 2025 11:53:23 -0500 Subject: [PATCH 4/4] Non-Plural registries --- .../com/simibubi/create/AllRegistries.java | 33 ++++++++++--------- .../belt/transport/TransportedItemStack.java | 16 ++++----- .../fan/processing/AllFanProcessingTypes.java | 2 +- .../fan/processing/FanProcessing.java | 2 +- .../fan/processing/FanProcessingType.java | 2 +- .../processing/FanProcessingTypeRegistry.java | 6 ++-- .../AllArmInteractionPointTypes.java | 2 +- .../mechanicalArm/ArmInteractionPoint.java | 10 +++--- .../ArmInteractionPointType.java | 6 ++-- .../filter/AttributeFilterScreen.java | 2 +- .../attribute/AllItemAttributeTypes.java | 7 ++-- .../item/filter/attribute/ItemAttribute.java | 6 ++-- 12 files changed, 48 insertions(+), 46 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllRegistries.java b/src/main/java/com/simibubi/create/AllRegistries.java index 4b7d62b443..8683ac7d7e 100644 --- a/src/main/java/com/simibubi/create/AllRegistries.java +++ b/src/main/java/com/simibubi/create/AllRegistries.java @@ -1,29 +1,30 @@ package com.simibubi.create; +import java.util.function.Supplier; + import com.simibubi.create.content.kinetics.fan.processing.FanProcessingType; import com.simibubi.create.content.kinetics.mechanicalArm.ArmInteractionPointType; import com.simibubi.create.content.logistics.item.filter.attribute.ItemAttributeType; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; + import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.IForgeRegistry; import net.minecraftforge.registries.NewRegistryEvent; import net.minecraftforge.registries.RegistryBuilder; -import java.util.function.Supplier; - @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class AllRegistries { - public static Supplier> ARM_INTERACTION_POINT_TYPES; - public static Supplier> FAN_PROCESSING_TYPES; - public static Supplier> ITEM_ATTRIBUTE_TYPES; + public static Supplier> ARM_INTERACTION_POINT_TYPE; + public static Supplier> FAN_PROCESSING_TYPE; + public static Supplier> ITEM_ATTRIBUTE_TYPE; public static final class Keys { - public static final ResourceKey> ARM_INTERACTION_POINT_TYPES = key("arm_interaction_point_types"); - public static final ResourceKey> FAN_PROCESSING_TYPES = key("fan_processing_types"); - public static final ResourceKey> ITEM_ATTRIBUTE_TYPES = key("item_attribute_types"); + public static final ResourceKey> ARM_INTERACTION_POINT_TYPE = key("arm_interaction_point_type"); + public static final ResourceKey> FAN_PROCESSING_TYPE = key("fan_processing_type"); + public static final ResourceKey> ITEM_ATTRIBUTE_TYPE = key("item_attribute_type"); private static ResourceKey> key(String name) { return ResourceKey.createRegistryKey(Create.asResource(name)); @@ -32,16 +33,16 @@ public class AllRegistries { @SubscribeEvent public static void registerRegistries(NewRegistryEvent event) { - ARM_INTERACTION_POINT_TYPES = event.create(new RegistryBuilder() - .setName(Keys.ARM_INTERACTION_POINT_TYPES.location()) - .disableSaving()); - - FAN_PROCESSING_TYPES = event.create(new RegistryBuilder() - .setName(Keys.FAN_PROCESSING_TYPES.location()) + ARM_INTERACTION_POINT_TYPE = event.create(new RegistryBuilder() + .setName(Keys.ARM_INTERACTION_POINT_TYPE.location()) .disableSaving()); - ITEM_ATTRIBUTE_TYPES = event.create(new RegistryBuilder() - .setName(Keys.ITEM_ATTRIBUTE_TYPES.location()) + FAN_PROCESSING_TYPE = event.create(new RegistryBuilder() + .setName(Keys.FAN_PROCESSING_TYPE.location()) + .disableSaving()); + + ITEM_ATTRIBUTE_TYPE = event.create(new RegistryBuilder() + .setName(Keys.ITEM_ATTRIBUTE_TYPE.location()) .disableSaving()); } } diff --git a/src/main/java/com/simibubi/create/content/kinetics/belt/transport/TransportedItemStack.java b/src/main/java/com/simibubi/create/content/kinetics/belt/transport/TransportedItemStack.java index e982345123..b9ea5a275b 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/belt/transport/TransportedItemStack.java +++ b/src/main/java/com/simibubi/create/content/kinetics/belt/transport/TransportedItemStack.java @@ -80,16 +80,16 @@ public class TransportedItemStack implements Comparable { nbt.putInt("InSegment", insertedAt); nbt.putInt("Angle", angle); nbt.putInt("InDirection", insertedFrom.get3DDataValue()); - + if (processedBy != null && processedBy != AllFanProcessingTypes.NONE) { - ResourceLocation key = AllRegistries.FAN_PROCESSING_TYPES.get().getKey(processedBy); + ResourceLocation key = AllRegistries.FAN_PROCESSING_TYPE.get().getKey(processedBy); if (key == null) throw new IllegalArgumentException("Could not get id for FanProcessingType " + processedBy + "!"); - + nbt.putString("FanProcessingType", key.toString()); nbt.putInt("FanProcessingTime", processingTime); } - + if (locked) nbt.putBoolean("Locked", locked); if (lockedExternally) @@ -108,18 +108,18 @@ public class TransportedItemStack implements Comparable { stack.insertedFrom = Direction.from3DDataValue(nbt.getInt("InDirection")); stack.locked = nbt.getBoolean("Locked"); stack.lockedExternally = nbt.getBoolean("LockedExternally"); - + if (nbt.contains("FanProcessingType")) { stack.processedBy = AllFanProcessingTypes.parseLegacy(nbt.getString("FanProcessingType")); stack.processingTime = nbt.getInt("FanProcessingTime"); } - + return stack; } - + public void clearFanProcessingData() { processedBy = null; processingTime = 0; } -} \ No newline at end of file +} diff --git a/src/main/java/com/simibubi/create/content/kinetics/fan/processing/AllFanProcessingTypes.java b/src/main/java/com/simibubi/create/content/kinetics/fan/processing/AllFanProcessingTypes.java index 767a93959e..9b7c53d734 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/fan/processing/AllFanProcessingTypes.java +++ b/src/main/java/com/simibubi/create/content/kinetics/fan/processing/AllFanProcessingTypes.java @@ -60,7 +60,7 @@ import net.minecraftforge.items.wrapper.RecipeWrapper; import net.minecraftforge.registries.DeferredRegister; public class AllFanProcessingTypes { - private static final DeferredRegister REGISTER = DeferredRegister.create(AllRegistries.Keys.FAN_PROCESSING_TYPES, Create.ID); + private static final DeferredRegister REGISTER = DeferredRegister.create(AllRegistries.Keys.FAN_PROCESSING_TYPE, Create.ID); public static final NoneType NONE = register("none", new NoneType()); public static final BlastingType BLASTING = register("blasting", new BlastingType()); diff --git a/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessing.java b/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessing.java index 3933e004d0..3d027f0360 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessing.java +++ b/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessing.java @@ -95,7 +95,7 @@ public class FanProcessing { CompoundTag processing = createData.getCompound("Processing"); if (!processing.contains("Type") || AllFanProcessingTypes.parseLegacy(processing.getString("Type")) != type) { - ResourceLocation key = AllRegistries.FAN_PROCESSING_TYPES.get().getKey(type); + ResourceLocation key = AllRegistries.FAN_PROCESSING_TYPE.get().getKey(type); if (key == null) throw new IllegalArgumentException("Could not get id for FanProcessingType " + type + "!"); diff --git a/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessingType.java b/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessingType.java index d30e56d67c..da3bf3b5de 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessingType.java +++ b/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessingType.java @@ -36,7 +36,7 @@ public interface FanProcessingType { if (id == null) { return AllFanProcessingTypes.NONE; } - FanProcessingType type = AllRegistries.FAN_PROCESSING_TYPES.get().getValue(id); + FanProcessingType type = AllRegistries.FAN_PROCESSING_TYPE.get().getValue(id); if (type == null) { return AllFanProcessingTypes.NONE; } diff --git a/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessingTypeRegistry.java b/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessingTypeRegistry.java index 5bdeb86fc1..da2f4b6d38 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessingTypeRegistry.java +++ b/src/main/java/com/simibubi/create/content/kinetics/fan/processing/FanProcessingTypeRegistry.java @@ -3,12 +3,12 @@ package com.simibubi.create.content.kinetics.fan.processing; import java.util.Collections; import java.util.List; +import org.jetbrains.annotations.UnmodifiableView; + import com.simibubi.create.AllRegistries; import it.unimi.dsi.fastutil.objects.ReferenceArrayList; -import org.jetbrains.annotations.UnmodifiableView; - public class FanProcessingTypeRegistry { private static List sortedTypes = null; @UnmodifiableView @@ -19,7 +19,7 @@ public class FanProcessingTypeRegistry { if (sortedTypes == null) { sortedTypes = new ReferenceArrayList<>(); - sortedTypes.addAll(AllRegistries.FAN_PROCESSING_TYPES.get().getValues()); + sortedTypes.addAll(AllRegistries.FAN_PROCESSING_TYPE.get().getValues()); sortedTypes.sort((t1, t2) -> t2.getPriority() - t1.getPriority()); sortedTypesView = Collections.unmodifiableList(sortedTypes); diff --git a/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/AllArmInteractionPointTypes.java b/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/AllArmInteractionPointTypes.java index 2f6c8fb9a6..122df9608b 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/AllArmInteractionPointTypes.java +++ b/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/AllArmInteractionPointTypes.java @@ -64,7 +64,7 @@ import net.minecraftforge.items.wrapper.SidedInvWrapper; import net.minecraftforge.registries.DeferredRegister; public class AllArmInteractionPointTypes { - private static final DeferredRegister REGISTER = DeferredRegister.create(AllRegistries.Keys.ARM_INTERACTION_POINT_TYPES, Create.ID); + private static final DeferredRegister REGISTER = DeferredRegister.create(AllRegistries.Keys.ARM_INTERACTION_POINT_TYPE, Create.ID); static { register("basin", new BasinType()); diff --git a/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/ArmInteractionPoint.java b/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/ArmInteractionPoint.java index 89a0e85a47..5a79b476d2 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/ArmInteractionPoint.java +++ b/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/ArmInteractionPoint.java @@ -5,8 +5,8 @@ import javax.annotation.Nullable; import com.simibubi.create.AllRegistries; import com.simibubi.create.content.contraptions.StructureTransform; -import net.createmod.catnip.nbt.NBTHelper; import net.createmod.catnip.math.VecHelper; +import net.createmod.catnip.nbt.NBTHelper; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; @@ -17,6 +17,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; + import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.IItemHandler; @@ -89,7 +90,8 @@ public class ArmInteractionPoint { return type.canCreatePoint(level, pos, cachedState); } - public void keepAlive() {} + public void keepAlive() { + } @Nullable protected IItemHandler getHandler() { @@ -136,7 +138,7 @@ public class ArmInteractionPoint { } public final CompoundTag serialize(BlockPos anchor) { - ResourceLocation key = AllRegistries.ARM_INTERACTION_POINT_TYPES.get().getKey(type); + ResourceLocation key = AllRegistries.ARM_INTERACTION_POINT_TYPE.get().getKey(type); if (key == null) throw new IllegalArgumentException("Could not get id for ArmInteractionPointType " + type + "!"); @@ -152,7 +154,7 @@ public class ArmInteractionPoint { ResourceLocation id = ResourceLocation.tryParse(nbt.getString("Type")); if (id == null) return null; - ArmInteractionPointType type = AllRegistries.ARM_INTERACTION_POINT_TYPES.get().getValue(id); + ArmInteractionPointType type = AllRegistries.ARM_INTERACTION_POINT_TYPE.get().getValue(id); if (type == null) return null; BlockPos pos = NbtUtils.readBlockPos(nbt.getCompound("Pos")).offset(anchor); diff --git a/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/ArmInteractionPointType.java b/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/ArmInteractionPointType.java index 677cef13ad..a60485b3ab 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/ArmInteractionPointType.java +++ b/src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/ArmInteractionPointType.java @@ -6,6 +6,8 @@ import java.util.function.Consumer; import javax.annotation.Nullable; +import org.jetbrains.annotations.UnmodifiableView; + import com.simibubi.create.AllRegistries; import it.unimi.dsi.fastutil.objects.ReferenceArrayList; @@ -13,8 +15,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.UnmodifiableView; - public abstract class ArmInteractionPointType { private static List sortedTypes = null; @UnmodifiableView @@ -29,7 +29,7 @@ public abstract class ArmInteractionPointType { if (sortedTypes == null) { sortedTypes = new ReferenceArrayList<>(); - sortedTypes.addAll(AllRegistries.ARM_INTERACTION_POINT_TYPES.get().getValues()); + sortedTypes.addAll(AllRegistries.ARM_INTERACTION_POINT_TYPE.get().getValues()); sortedTypes.sort((t1, t2) -> t2.getPriority() - t1.getPriority()); sortedTypesView = Collections.unmodifiableList(sortedTypes); diff --git a/src/main/java/com/simibubi/create/content/logistics/filter/AttributeFilterScreen.java b/src/main/java/com/simibubi/create/content/logistics/filter/AttributeFilterScreen.java index 07aa445acd..6ee0975e35 100644 --- a/src/main/java/com/simibubi/create/content/logistics/filter/AttributeFilterScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/filter/AttributeFilterScreen.java @@ -146,7 +146,7 @@ public class AttributeFilterScreen extends AbstractFilterScreen options = attributesOfItem.stream() .map(a -> a.format(false)) diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/AllItemAttributeTypes.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/AllItemAttributeTypes.java index 174111dd01..76218fbc0b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/AllItemAttributeTypes.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/AllItemAttributeTypes.java @@ -2,7 +2,6 @@ package com.simibubi.create.content.logistics.item.filter.attribute; import java.util.function.BiPredicate; import java.util.function.Predicate; -import java.util.function.Supplier; import org.jetbrains.annotations.ApiStatus; @@ -46,7 +45,7 @@ import net.minecraftforge.registries.DeferredRegister; // TODO - Documentation public class AllItemAttributeTypes { - private static final DeferredRegister REGISTER = DeferredRegister.create(AllRegistries.Keys.ITEM_ATTRIBUTE_TYPES, Create.ID); + private static final DeferredRegister REGISTER = DeferredRegister.create(AllRegistries.Keys.ITEM_ATTRIBUTE_TYPE, Create.ID); private static final RecipeWrapper RECIPE_WRAPPER = new RecipeWrapper(new ItemStackHandler(1)); public static final ItemAttributeType @@ -72,7 +71,7 @@ public class AllItemAttributeTypes { BLASTABLE = singleton("blastable", (s, w) -> testRecipe(s, w, RecipeType.BLASTING)), COMPOSTABLE = singleton("compostable", s -> ComposterBlock.COMPOSTABLES.containsKey(s.getItem())), - IN_TAG = register("in_tag", new InTagAttribute.Type()), + IN_TAG = register("in_tag", new InTagAttribute.Type()), IN_ITEM_GROUP = register("in_item_group", new InItemGroupAttribute.Type()), ADDED_BY = register("added_by", new AddedByAttribute.Type()), HAS_ENCHANT = register("has_enchant", new EnchantAttribute.Type()), @@ -83,7 +82,7 @@ public class AllItemAttributeTypes { BOOK_AUTHOR = register("book_author", new BookAuthorAttribute.Type()), BOOK_COPY = register("book_copy", new BookCopyAttribute.Type()), - ASTRAL_AMULET = register("astral_amulet", new AstralSorceryAmuletAttribute.Type()), + ASTRAL_AMULET = register("astral_amulet", new AstralSorceryAmuletAttribute.Type()), ASTRAL_ATTUNMENT = register("astral_attunment", new AstralSorceryAttunementAttribute.Type()), ASTRAL_CRYSTAL = register("astral_crystal", new AstralSorceryCrystalAttribute.Type()), ASTRAL_PERK_GEM = register("astral_perk_gem", new AstralSorceryPerkGemAttribute.Type()); diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ItemAttribute.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ItemAttribute.java index b17d142dab..a683d9fbca 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ItemAttribute.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ItemAttribute.java @@ -20,7 +20,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; public interface ItemAttribute { static CompoundTag saveStatic(ItemAttribute attribute) { CompoundTag nbt = new CompoundTag(); - ResourceLocation id = AllRegistries.ITEM_ATTRIBUTE_TYPES.get().getKey(attribute.getType()); + ResourceLocation id = AllRegistries.ITEM_ATTRIBUTE_TYPE.get().getKey(attribute.getType()); if (id == null) throw new IllegalArgumentException("Cannot get " + attribute.getType() + "as it does not exist in AllRegistries.ITEM_ATTRIBUTE_TYPES"); @@ -42,7 +42,7 @@ public interface ItemAttribute { if (id == null) return null; - ItemAttributeType type = AllRegistries.ITEM_ATTRIBUTE_TYPES.get().getValue(id); + ItemAttributeType type = AllRegistries.ITEM_ATTRIBUTE_TYPE.get().getValue(id); if (type == null) return null; @@ -53,7 +53,7 @@ public interface ItemAttribute { static List getAllAttributes(ItemStack stack, Level level) { List attributes = new ArrayList<>(); - for (ItemAttributeType type : AllRegistries.ITEM_ATTRIBUTE_TYPES.get()) { + for (ItemAttributeType type : AllRegistries.ITEM_ATTRIBUTE_TYPE.get()) { attributes.addAll(type.getAllAttributes(stack, level)); } return attributes;