mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-03 22:34:42 +01:00
Merge remote-tracking branch 'origin/mc1.20.1/dev' into mc1.20.1/dev
This commit is contained in:
commit
7946a0b591
14 changed files with 120 additions and 24 deletions
|
@ -247,6 +247,7 @@ dependencies {
|
|||
// modRuntimeOnly("curse.maven:blueprint-382216:4749000")
|
||||
// modRuntimeOnly("curse.maven:windsweptmod-636321:4817132")
|
||||
// modRuntimeOnly("curse.maven:good-ending-690161:4363719")
|
||||
// modRuntimeOnly("curse.maven:inventory-sorter-240633:5979609")
|
||||
|
||||
// https://discord.com/channels/313125603924639766/725850371834118214/910619168821354497
|
||||
// Prevent Mixin annotation processor from getting into IntelliJ's annotation processor settings
|
||||
|
|
13
changelog.md
13
changelog.md
|
@ -4,12 +4,23 @@ Create 6.0.1
|
|||
|
||||
#### Bug Fixes
|
||||
|
||||
- Fixed crash when using factory gauges
|
||||
- Fixed Shopping lists not updating when adding purchases (1.21) #7449 #7393
|
||||
- Fixed Frogport ponder scene not animating correctly (1.21)
|
||||
- Fixed broken address filter in second stock ticker ponder scene (1.21)
|
||||
- Added a tooltip for the stock keeper address input
|
||||
- Fixed crash when re-packaging a duplicated package fragment #7456
|
||||
- Fixed crash when ctrl-click copying a gauge #7431
|
||||
- Safety check for unexpected string modifications in address edit boxes #7409
|
||||
- Fixed crash with fluid propagator
|
||||
- Fixed a crash when using factory gauges
|
||||
- Fixed debug info command not translating the graphics mode text
|
||||
- Fixed cardboard sword not being able to damage arthropod mobs other than the spider
|
||||
- Fixed a crash that occurred when placing a stock link on a re-packager
|
||||
- Fixed an issue where wearing diving boots and sprinting would force you into the swim position and then out of it
|
||||
right away
|
||||
- Fixed item group attribute filters crashing
|
||||
- Fixed mixin conflict with immersive portals
|
||||
- Fixed processing output not supporting itemstack components
|
||||
|
||||
------------------------------------------------------
|
||||
Create 6.0.0
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.simibubi.create;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import com.simibubi.create.compat.inventorySorter.InventorySorterCompat;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
@ -156,6 +158,7 @@ public class Create {
|
|||
|
||||
// FIXME: this is not thread-safe
|
||||
Mods.CURIOS.executeIfInstalled(() -> () -> Curios.init(modEventBus, forgeEventBus));
|
||||
Mods.INVENTORYSORTER.executeIfInstalled(() -> () -> InventorySorterCompat.init(modEventBus));
|
||||
}
|
||||
|
||||
public static void init(final FMLCommonSetupEvent event) {
|
||||
|
|
|
@ -34,7 +34,8 @@ public enum Mods {
|
|||
MODERNUI,
|
||||
FTBCHUNKS,
|
||||
JOURNEYMAP,
|
||||
FTBLIBRARY;
|
||||
FTBLIBRARY,
|
||||
INVENTORYSORTER;
|
||||
|
||||
private final String id;
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.simibubi.create.compat.inventorySorter;
|
||||
|
||||
import com.simibubi.create.compat.Mods;
|
||||
|
||||
import com.simibubi.create.content.logistics.redstoneRequester.RedstoneRequesterMenu.SorterProofSlot;
|
||||
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.InterModComms;
|
||||
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
|
||||
|
||||
/**
|
||||
* Compatibility with cpw's InventorySorter.
|
||||
* We need to stop it from interfering with scrolling in the Redstone Requester's screen.
|
||||
*/
|
||||
public class InventorySorterCompat {
|
||||
public static final String SLOT_BLACKLIST = "slotblacklist";
|
||||
|
||||
public static void init(IEventBus bus) {
|
||||
bus.addListener(InventorySorterCompat::sendImc);
|
||||
}
|
||||
|
||||
private static void sendImc(InterModEnqueueEvent event) {
|
||||
InterModComms.sendTo(Mods.INVENTORYSORTER.id(), SLOT_BLACKLIST, SorterProofSlot.class::getName);
|
||||
}
|
||||
}
|
|
@ -122,16 +122,16 @@ public class FactoryPanelBlock extends FaceAttachedHorizontalDirectionalBlock
|
|||
if (blockState.is(this) && location != null && fpbe != null) {
|
||||
if (!level.isClientSide()) {
|
||||
PanelSlot targetedSlot = getTargetedSlot(pos, blockState, location);
|
||||
UUID networkFromStack = LogisticallyLinkedBlockItem.networkFromStack(pContext.getItemInHand());
|
||||
ItemStack panelItem = FactoryPanelBlockItem.fixCtrlCopiedStack(pContext.getItemInHand());
|
||||
UUID networkFromStack = LogisticallyLinkedBlockItem.networkFromStack(panelItem);
|
||||
Player pPlayer = pContext.getPlayer();
|
||||
|
||||
if (fpbe.addPanel(targetedSlot, networkFromStack) && pPlayer != null) {
|
||||
pPlayer.displayClientMessage(CreateLang.translateDirect("logistically_linked.connected"), true);
|
||||
|
||||
if (!pPlayer.isCreative()) {
|
||||
ItemStack item = pContext.getItemInHand();
|
||||
item.shrink(1);
|
||||
if (item.isEmpty())
|
||||
panelItem.shrink(1);
|
||||
if (panelItem.isEmpty())
|
||||
pPlayer.setItemInHand(pContext.getHand(), ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ public class FactoryPanelBlock extends FaceAttachedHorizontalDirectionalBlock
|
|||
|
||||
PanelSlot newSlot = getTargetedSlot(pPos, pState, location);
|
||||
withBlockEntityDo(pLevel, pPos, fpbe -> {
|
||||
if (!fpbe.addPanel(newSlot, LogisticallyLinkedBlockItem.networkFromStack(item)))
|
||||
if (!fpbe.addPanel(newSlot, LogisticallyLinkedBlockItem.networkFromStack(FactoryPanelBlockItem.fixCtrlCopiedStack(item))))
|
||||
return;
|
||||
pPlayer.displayClientMessage(CreateLang.translateDirect("logistically_linked.connected"), true);
|
||||
pLevel.playSound(null, pPos, soundType.getPlaceSound(), SoundSource.BLOCKS);
|
||||
|
|
|
@ -133,7 +133,8 @@ public class FactoryPanelBlockEntity extends SmartBlockEntity {
|
|||
FactoryPanelBehaviour behaviour = panels.get(slot);
|
||||
if (behaviour != null && !behaviour.isActive()) {
|
||||
behaviour.enable();
|
||||
behaviour.setNetwork(frequency);
|
||||
if (frequency != null)
|
||||
behaviour.setNetwork(frequency);
|
||||
redraw = true;
|
||||
lastShape = null;
|
||||
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
package com.simibubi.create.content.logistics.factoryBoard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.simibubi.create.AllSoundEvents;
|
||||
import com.simibubi.create.content.logistics.factoryBoard.FactoryPanelBlock.PanelSlot;
|
||||
import com.simibubi.create.content.logistics.packagerLink.LogisticallyLinkedBlockItem;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class FactoryPanelBlockItem extends LogisticallyLinkedBlockItem {
|
||||
|
||||
|
@ -29,5 +37,31 @@ public class FactoryPanelBlockItem extends LogisticallyLinkedBlockItem {
|
|||
|
||||
return super.place(pContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean updateCustomBlockEntityTag(BlockPos pos, Level level, Player player, ItemStack stack,
|
||||
BlockState state) {
|
||||
return super.updateCustomBlockEntityTag(pos, level, player, fixCtrlCopiedStack(stack), state);
|
||||
}
|
||||
|
||||
public static ItemStack fixCtrlCopiedStack(ItemStack stack) {
|
||||
// Salvage frequency data from one of the panel slots
|
||||
if (isTuned(stack) && networkFromStack(stack) == null) {
|
||||
CompoundTag bet = stack.getTagElement(BLOCK_ENTITY_TAG);
|
||||
UUID frequency = UUID.randomUUID();
|
||||
|
||||
for (PanelSlot slot : PanelSlot.values()) {
|
||||
CompoundTag panelTag = bet.getCompound(CreateLang.asId(slot.name()));
|
||||
if (panelTag.hasUUID("Freq"))
|
||||
frequency = panelTag.getUUID("Freq");
|
||||
}
|
||||
|
||||
bet = new CompoundTag();
|
||||
bet.putUUID("Freq", frequency);
|
||||
stack.getTag().put(BLOCK_ENTITY_TAG, bet);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -113,7 +113,8 @@ public class PackageDefragmenter {
|
|||
|
||||
ItemStack output = ItemHandlerHelper.copyStackWithSize(entry.stack, removedAmount);
|
||||
targetAmount -= removedAmount;
|
||||
targetedEntry.count = targetAmount;
|
||||
if (targetedEntry != null)
|
||||
targetedEntry.count = targetAmount;
|
||||
entry.count -= removedAmount;
|
||||
outputSlots.add(output);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.entity.player.Inventory;
|
|||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
|
||||
|
@ -64,7 +65,7 @@ public class RedstoneRequesterMenu extends GhostItemMenu<RedstoneRequesterBlockE
|
|||
|
||||
addPlayerSlots(playerX, playerY);
|
||||
for (int i = 0; i < 9; i++)
|
||||
addSlot(new SlotItemHandler(ghostInventory, i, slotX + 20 * i, slotY));
|
||||
addSlot(new SorterProofSlot(ghostInventory, i, slotX + 20 * i, slotY));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,4 +80,11 @@ public class RedstoneRequesterMenu extends GhostItemMenu<RedstoneRequesterBlockE
|
|||
contentHolder.sendData();
|
||||
}
|
||||
|
||||
// this is used to prevent InventorySorter from interfering with scrolling on the slots.
|
||||
// we just need a class to use as a marker, see InventorySorterCompat
|
||||
public static class SorterProofSlot extends SlotItemHandler {
|
||||
public SorterProofSlot(IItemHandler itemHandler, int index, int xPosition, int yPosition) {
|
||||
super(itemHandler, index, xPosition, yPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ public class RedstoneRequesterScreen extends AbstractSimiContainerScreen<Redston
|
|||
|
||||
if (addressBox.mouseScrolled(mouseX, mouseY, pDelta))
|
||||
return true;
|
||||
|
||||
|
||||
for (int i = 0; i < amounts.size(); i++) {
|
||||
int inputX = x + 27 + i * 20;
|
||||
int inputY = y + 28;
|
||||
|
@ -197,15 +197,6 @@ public class RedstoneRequesterScreen extends AbstractSimiContainerScreen<Redston
|
|||
return super.mouseScrolled(mouseX, mouseY, pDelta);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fixes InventorySorter nabbing the scroll event. This screen needs it for
|
||||
* amount control
|
||||
*/
|
||||
@Override
|
||||
public @Nullable Slot getSlotUnderMouse() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Component> getTooltipFromContainerItem(ItemStack pStack) {
|
||||
List<Component> tooltip = super.getTooltipFromContainerItem(pStack);
|
||||
|
|
|
@ -38,6 +38,7 @@ import com.simibubi.create.content.trains.station.NoShadowFontWrapper;
|
|||
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||
import com.simibubi.create.foundation.gui.ScreenWithStencils;
|
||||
import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen;
|
||||
import com.simibubi.create.foundation.gui.widget.ScrollInput;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
|
||||
|
@ -489,9 +490,12 @@ public class StockKeeperRequestScreen extends AbstractSimiContainerScreen<StockK
|
|||
|
||||
// Render text input hints
|
||||
if (addressBox.getValue()
|
||||
.isBlank())
|
||||
graphics.drawString(font, addressBox.getMessage(), addressBox.getX(), addressBox.getY(), 0x88dddddd);
|
||||
|
||||
.isBlank() && !addressBox.isFocused()) {
|
||||
graphics.drawString(Minecraft.getInstance().font, CreateLang.translate("gui.stock_keeper.package_adress")
|
||||
.style(ChatFormatting.ITALIC)
|
||||
.component(), addressBox.getX(), addressBox.getY(), 0xff_CDBCA8, false);
|
||||
}
|
||||
|
||||
// Render keeper
|
||||
int entitySizeOffset = 0;
|
||||
LivingEntity keeper = stockKeeper.get();
|
||||
|
@ -807,6 +811,19 @@ public class StockKeeperRequestScreen extends AbstractSimiContainerScreen<StockK
|
|||
.component()),
|
||||
mouseX, mouseY);
|
||||
}
|
||||
|
||||
// Render tooltip of address input
|
||||
if (addressBox.getValue()
|
||||
.isBlank() && !addressBox.isFocused() && addressBox.isHovered()) {
|
||||
graphics.renderComponentTooltip(font, List.of(CreateLang.translate("gui.factory_panel.restocker_address")
|
||||
.color(ScrollInput.HEADER_RGB)
|
||||
.component(),
|
||||
CreateLang.translate("gui.schedule.lmb_edit")
|
||||
.style(ChatFormatting.DARK_GRAY)
|
||||
.style(ChatFormatting.ITALIC)
|
||||
.component()),
|
||||
mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
private void renderItemEntry(GuiGraphics graphics, float scale, BigItemStack entry, boolean isStackHovered,
|
||||
|
|
|
@ -47,6 +47,9 @@ public class DestinationSuggestions extends CommandSuggestions {
|
|||
|
||||
@Override
|
||||
public void updateCommandInfo() {
|
||||
if (textBox.getValue().length() < textBox.getCursorPosition())
|
||||
return;
|
||||
|
||||
String trimmed = textBox.getValue()
|
||||
.substring(0, textBox.getCursorPosition());
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class AllCommands {
|
|||
.then(CameraDistanceCommand.register())
|
||||
.then(CameraAngleCommand.register())
|
||||
//.then(DebugValueCommand.register())
|
||||
.then(KillTPSCommand.register())
|
||||
//.then(KillTPSCommand.register())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue