diff --git a/build.gradle b/build.gradle index 8bdea6ce..aed7493f 100644 --- a/build.gradle +++ b/build.gradle @@ -42,6 +42,7 @@ minecraft { runs { client { workingDirectory project.file('run') + jvmArg "-XX:+AllowEnhancedClassRedefinition" // Recommended logging data for a userdev environment // The markers can be changed as needed. diff --git a/src/main/java/dev/murad/shipping/ShippingConfig.java b/src/main/java/dev/murad/shipping/ShippingConfig.java index 9a1f9d62..11880e1b 100644 --- a/src/main/java/dev/murad/shipping/ShippingConfig.java +++ b/src/main/java/dev/murad/shipping/ShippingConfig.java @@ -57,7 +57,7 @@ public static class Server { public static final ForgeConfigSpec.ConfigValue TUG_BASE_SPEED; - public static final ForgeConfigSpec.ConfigValue STEAM_TUG_FUEL_MULTIPLIER; + public static final ForgeConfigSpec.ConfigValue STEAM_TUG_FUEL_MULTIPLIER; public static final ForgeConfigSpec.ConfigValue TUG_PATHFINDING_MULTIPLIER; public static final ForgeConfigSpec.ConfigValue ENERGY_TUG_BASE_CAPACITY; @@ -67,7 +67,7 @@ public static class Server { public static final ForgeConfigSpec.ConfigValue TRAIN_MAX_SPEED; public static final ForgeConfigSpec.ConfigValue LOCO_BASE_SPEED; - public static final ForgeConfigSpec.ConfigValue STEAM_LOCO_FUEL_MULTIPLIER; + public static final ForgeConfigSpec.ConfigValue STEAM_LOCO_FUEL_MULTIPLIER; public static final ForgeConfigSpec.ConfigValue ENERGY_LOCO_BASE_CAPACITY; public static final ForgeConfigSpec.ConfigValue ENERGY_LOCO_BASE_ENERGY_USAGE; public static final ForgeConfigSpec.ConfigValue ENERGY_LOCO_BASE_MAX_CHARGE_RATE; @@ -137,8 +137,8 @@ public static class Server { .defineInRange("tugPathfindMult", 1, 1, 10); STEAM_TUG_FUEL_MULTIPLIER = - BUILDER.comment("Increases the burn duration of Steam tug fuel by N times when compared to furnace, must be an integer >= 1. Default 4.") - .defineInRange("steamTugFuelMultiplier", 4, 1, Integer.MAX_VALUE); + BUILDER.comment("Increases the burn duration of Steam tug fuel by N times when compared to furnace, must be >= 0.01. Default 4.0.") + .defineInRange("steamTugFuelMultiplier", 4.0, 0.01, Double.MAX_VALUE); ENERGY_TUG_BASE_CAPACITY = BUILDER.comment("Base maximum capacity of the Energy tug in FE, must be an integer >= 1. Default 10000.") @@ -185,8 +185,8 @@ public static class Server { .defineInRange("locoBaseSpeed", 0.5, 0.01, 0.9); STEAM_LOCO_FUEL_MULTIPLIER = - BUILDER.comment("Increases the burn duration of Steam locomotive fuel by N times when compared to furnace, must be an integer >= 1. Default 4.") - .defineInRange("steamLocoFuelMultiplier", 4, 1, Integer.MAX_VALUE); + BUILDER.comment("Increases the burn duration of Steam locomotive fuel by N times when compared to furnace, must be >= 0.01. Default 4.0.") + .defineInRange("steamLocoFuelMultiplier", 4.0, 0.01, Double.MAX_VALUE); ENERGY_LOCO_BASE_CAPACITY = BUILDER.comment("Base maximum capacity of the Energy locomotive in FE, must be an integer >= 1. Default 10000.") diff --git a/src/main/java/dev/murad/shipping/entity/container/FishingBargeContainer.java b/src/main/java/dev/murad/shipping/entity/container/FishingBargeContainer.java index 0b57d92a..aebf84ed 100644 --- a/src/main/java/dev/murad/shipping/entity/container/FishingBargeContainer.java +++ b/src/main/java/dev/murad/shipping/entity/container/FishingBargeContainer.java @@ -9,6 +9,7 @@ import net.minecraftforge.items.SlotItemHandler; import org.jetbrains.annotations.NotNull; +// Unused public class FishingBargeContainer extends AbstractItemHandlerContainer { private final FishingBargeEntity fishingBargeEntity; @@ -36,6 +37,7 @@ protected int getSlotNum() { @Override public boolean stillValid(@NotNull Player player) { - return fishingBargeEntity.stillValid(player); + return true; +// return fishingBargeEntity.stillValid(player); } } diff --git a/src/main/java/dev/murad/shipping/entity/custom/TrainInventoryProvider.java b/src/main/java/dev/murad/shipping/entity/custom/TrainInventoryProvider.java new file mode 100644 index 00000000..244762b3 --- /dev/null +++ b/src/main/java/dev/murad/shipping/entity/custom/TrainInventoryProvider.java @@ -0,0 +1,20 @@ +package dev.murad.shipping.entity.custom; + +import net.minecraftforge.items.ItemStackHandler; + +import java.util.Optional; + +/** + * A train inventory provider is a barge or a car that provides inventories + * to other barges or cars ahead of it. + */ +public interface TrainInventoryProvider { + + // TODO: fluid provider + + // TODO: energy provider + + default Optional getTrainInventoryHandler() { + return Optional.empty(); + } +} diff --git a/src/main/java/dev/murad/shipping/entity/custom/train/AbstractTrainCarEntity.java b/src/main/java/dev/murad/shipping/entity/custom/train/AbstractTrainCarEntity.java index fb96c15d..8cd293d5 100644 --- a/src/main/java/dev/murad/shipping/entity/custom/train/AbstractTrainCarEntity.java +++ b/src/main/java/dev/murad/shipping/entity/custom/train/AbstractTrainCarEntity.java @@ -225,7 +225,7 @@ public void push(Entity pEntity) { } if (!pEntity.noPhysics && !this.noPhysics) { // fix carts with passengers falling behind - if (!this.hasPassenger(pEntity) || this.getDominant().isPresent()) { + if (!this.hasPassenger(pEntity) || this.getLeader().isPresent()) { double d0 = pEntity.getX() - this.getX(); double d1 = pEntity.getZ() - this.getZ(); double d2 = d0 * d0 + d1 * d1; @@ -530,12 +530,12 @@ public Type getMinecartType() { } @Override - public Optional getDominated() { + public Optional getFollower() { return linkingHandler.follower; } @Override - public Optional getDominant() { + public Optional getLeader() { return linkingHandler.leader; } @@ -599,8 +599,8 @@ private Optional> findClose } - return curr.filter(pair -> (!(pair.getFirst() instanceof AbstractLocomotiveEntity) || pair.getFirst().getDominated().isEmpty()) - && (!(pair.getSecond() instanceof AbstractLocomotiveEntity) || pair.getSecond().getDominated().isEmpty())); + return curr.filter(pair -> (!(pair.getFirst() instanceof AbstractLocomotiveEntity) || pair.getFirst().getFollower().isEmpty()) + && (!(pair.getSecond() instanceof AbstractLocomotiveEntity) || pair.getSecond().getFollower().isEmpty())); } diff --git a/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/AbstractLocomotiveEntity.java b/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/AbstractLocomotiveEntity.java index 8eb44af1..93aeb356 100644 --- a/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/AbstractLocomotiveEntity.java +++ b/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/AbstractLocomotiveEntity.java @@ -129,16 +129,16 @@ public InteractionResult interact(Player pPlayer, InteractionHand pHand) { if(!pHand.equals(InteractionHand.MAIN_HAND)){ return InteractionResult.PASS; } + if(!this.level().isClientSide){ NetworkHooks.openScreen((ServerPlayer) pPlayer, createContainerProvider(), getDataAccessor()::write); - } return InteractionResult.CONSUME; } private ItemStackHandler createLocoRouteItemHandler() { - return new ItemStackHandler(1) { + return new ItemStackHandler() { @Override protected int getStackLimit(int slot, @Nonnull ItemStack stack) { return 1; @@ -153,16 +153,6 @@ protected void onContentsChanged(int slot) { public boolean isItemValid(int slot, @Nonnull ItemStack stack) { return stack.getItem() instanceof LocoRouteItem; } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!isItemValid(slot, stack)) { - return stack; - } - - return super.insertItem(slot, stack, simulate); - } }; } diff --git a/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/EnergyLocomotiveEntity.java b/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/EnergyLocomotiveEntity.java index afc6ce5f..60abb740 100644 --- a/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/EnergyLocomotiveEntity.java +++ b/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/EnergyLocomotiveEntity.java @@ -32,27 +32,27 @@ import javax.annotation.Nullable; public class EnergyLocomotiveEntity extends AbstractLocomotiveEntity implements ItemHandlerVanillaContainerWrapper, WorldlyContainer { - private final ItemStackHandler itemHandler = createHandler(); - private final LazyOptional handler = LazyOptional.of(() -> itemHandler); + private final ItemStackHandler energyItemHandler = createHandler(); + private final LazyOptional energyItemHandlerOpt = LazyOptional.of(() -> energyItemHandler); private static final int MAX_ENERGY = ShippingConfig.Server.ENERGY_LOCO_BASE_CAPACITY.get(); private static final int MAX_TRANSFER = ShippingConfig.Server.ENERGY_LOCO_BASE_MAX_CHARGE_RATE.get(); private static final int ENERGY_USAGE = ShippingConfig.Server.ENERGY_LOCO_BASE_ENERGY_USAGE.get(); private final ReadWriteEnergyStorage internalBattery = new ReadWriteEnergyStorage(MAX_ENERGY, MAX_TRANSFER, Integer.MAX_VALUE); - private final LazyOptional holder = LazyOptional.of(() -> internalBattery); + private final LazyOptional internalBatteryOpt = LazyOptional.of(() -> internalBattery); - public EnergyLocomotiveEntity(EntityType type, Level p_38088_) { - super(type, p_38088_); + public EnergyLocomotiveEntity(EntityType type, Level level) { + super(type, level); internalBattery.setEnergy(0); } - public EnergyLocomotiveEntity(Level level, Double aDouble, Double aDouble1, Double aDouble2) { - super(ModEntityTypes.ENERGY_LOCOMOTIVE.get(), level, aDouble, aDouble1, aDouble2); + public EnergyLocomotiveEntity(Level level, Double x, Double y, Double z) { + super(ModEntityTypes.ENERGY_LOCOMOTIVE.get(), level, x, y, z); internalBattery.setEnergy(0); } private ItemStackHandler createHandler() { - return new ItemStackHandler(1) { + return new ItemStackHandler() { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { return stack.getCapability(ForgeCapabilities.ENERGY).isPresent(); @@ -74,9 +74,9 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { if (cap == ForgeCapabilities.ITEM_HANDLER) { - return handler.cast(); + return energyItemHandlerOpt.cast(); } else if (cap == ForgeCapabilities.ENERGY) { - return holder.cast(); + return internalBatteryOpt.cast(); } return super.getCapability(cap, side); @@ -98,7 +98,6 @@ public Component getDisplayName() { return Component.translatable("entity.littlelogistics.energy_locomotive"); } - @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { return new EnergyHeadVehicleContainer(i, level(), getDataAccessor(), playerInventory, player); @@ -124,7 +123,7 @@ public EnergyHeadVehicleDataAccessor getDataAccessor() { public void tick() { // grab energy from capacitor if (!level().isClientSide) { - IEnergyStorage capability = InventoryUtils.getEnergyCapabilityInSlot(0, itemHandler); + IEnergyStorage capability = InventoryUtils.getEnergyCapabilityInSlot(0, energyItemHandler); if (capability != null) { // simulate first int toExtract = capability.extractEnergy(MAX_TRANSFER, true); @@ -149,7 +148,7 @@ public ItemStack getPickResult() { @Override public ItemStackHandler getRawHandler() { - return itemHandler; + return energyItemHandler; } @Override @@ -169,14 +168,14 @@ public boolean canTakeItemThroughFace(int index, @NotNull ItemStack itemStack, @ @Override public void readAdditionalSaveData(@NotNull CompoundTag compound) { - itemHandler.deserializeNBT(compound.getCompound("inv")); + energyItemHandler.deserializeNBT(compound.getCompound("inv")); internalBattery.readAdditionalSaveData(compound.getCompound("energy_storage")); super.readAdditionalSaveData(compound); } @Override public void addAdditionalSaveData(@NotNull CompoundTag compound) { - compound.put("inv", itemHandler.serializeNBT()); + compound.put("inv", energyItemHandler.serializeNBT()); CompoundTag energyNBT = new CompoundTag(); internalBattery.addAdditionalSaveData(energyNBT); compound.put("energy_storage", energyNBT); diff --git a/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/SteamLocomotiveEntity.java b/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/SteamLocomotiveEntity.java index c5632300..5f5b6558 100644 --- a/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/SteamLocomotiveEntity.java +++ b/src/main/java/dev/murad/shipping/entity/custom/train/locomotive/SteamLocomotiveEntity.java @@ -7,6 +7,7 @@ import dev.murad.shipping.setup.ModEntityTypes; import dev.murad.shipping.setup.ModItems; import dev.murad.shipping.setup.ModSounds; +import dev.murad.shipping.util.FuelItemStackHandler; import dev.murad.shipping.util.ItemHandlerVanillaContainerWrapper; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -22,8 +23,7 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.FurnaceBlockEntity; -import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.LazyOptional; @@ -34,34 +34,19 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.util.Random; public class SteamLocomotiveEntity extends AbstractLocomotiveEntity implements ItemHandlerVanillaContainerWrapper, WorldlyContainer { - private final ItemStackHandler itemHandler = createHandler(); - private final LazyOptional handler = LazyOptional.of(() -> itemHandler); - private static final int FURNACE_FUEL_MULTIPLIER= ShippingConfig.Server.STEAM_LOCO_FUEL_MULTIPLIER.get(); + private final FuelItemStackHandler fuelItemHandler = new FuelItemStackHandler(); + private final LazyOptional handler = LazyOptional.of(() -> fuelItemHandler); - protected int burnTime = 0; - protected int burnCapacity = 0; - - private ItemStackHandler createHandler() { - return new ItemStackHandler(1) { - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - return FurnaceBlockEntity.isFuel(stack); - } + // This has to remain as ConfigValue as the class isn't reloaded when changing worlds + private static final ForgeConfigSpec.ConfigValue FURNACE_FUEL_MULTIPLIER = ShippingConfig.Server.STEAM_LOCO_FUEL_MULTIPLIER; - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!isItemValid(slot, stack)) { - return stack; - } + // How many ticks left on this fuel + protected int burnTime = 0; - return super.insertItem(slot, stack, simulate); - } - }; - } + // Max number of ticks for this fuel + protected int burnCapacity = 0; public boolean isLit() { return burnTime > 0; @@ -96,17 +81,11 @@ protected boolean tickFuel() { burnTime--; return true; } else { - ItemStack stack = itemHandler.getStackInSlot(0); - if (!stack.isEmpty()) { - burnCapacity = (ForgeHooks.getBurnTime(stack, null) * FURNACE_FUEL_MULTIPLIER) - 1; - burnTime = burnCapacity - 1; - stack.shrink(1); - return true; - } else { - burnCapacity = 0; - burnTime = 0; - return false; - } + int burnTime = fuelItemHandler.tryConsumeFuel(); + int adjustedBurnTime = (int) Math.ceil(burnTime * FURNACE_FUEL_MULTIPLIER.get()); + this.burnCapacity = adjustedBurnTime; + this.burnTime = adjustedBurnTime; + return adjustedBurnTime > 0; } } @@ -149,12 +128,12 @@ public LazyOptional getCapability(@Nonnull Capability cap, @Nullable D return super.getCapability(cap, side); } - public SteamLocomotiveEntity(EntityType type, Level p_38088_) { - super(type, p_38088_); + public SteamLocomotiveEntity(EntityType type, Level level) { + super(type, level); } - public SteamLocomotiveEntity(Level level, Double aDouble, Double aDouble1, Double aDouble2) { - super(ModEntityTypes.STEAM_LOCOMOTIVE.get(), level, aDouble, aDouble1, aDouble2); + public SteamLocomotiveEntity(Level level, Double x, Double y, Double z) { + super(ModEntityTypes.STEAM_LOCOMOTIVE.get(), level, x, y, z); } @@ -192,12 +171,12 @@ public boolean canPlaceItemThroughFace(int index, @NotNull ItemStack itemStack, @Override public ItemStackHandler getRawHandler() { - return itemHandler; + return fuelItemHandler; } @Override public void readAdditionalSaveData(@NotNull CompoundTag compound) { - itemHandler.deserializeNBT(compound.getCompound("inv")); + fuelItemHandler.deserializeNBT(compound.getCompound("fuelItems")); burnTime = compound.contains("burn") ? compound.getInt("burn") : 0; burnCapacity = compound.contains("burn_capacity") ? compound.getInt("burn_capacity") : 0; super.readAdditionalSaveData(compound); @@ -205,7 +184,7 @@ public void readAdditionalSaveData(@NotNull CompoundTag compound) { @Override public void addAdditionalSaveData(@NotNull CompoundTag compound) { - compound.put("inv", itemHandler.serializeNBT()); + compound.put("fuelItems", fuelItemHandler.serializeNBT()); compound.putInt("burn", burnTime); compound.putInt("burn_capacity", burnCapacity); super.addAdditionalSaveData(compound); diff --git a/src/main/java/dev/murad/shipping/entity/custom/vessel/VesselEntity.java b/src/main/java/dev/murad/shipping/entity/custom/vessel/VesselEntity.java index be569e5e..4b3b56a4 100644 --- a/src/main/java/dev/murad/shipping/entity/custom/vessel/VesselEntity.java +++ b/src/main/java/dev/murad/shipping/entity/custom/vessel/VesselEntity.java @@ -1,6 +1,8 @@ package dev.murad.shipping.entity.custom.vessel; import dev.murad.shipping.ShippingConfig; +import dev.murad.shipping.entity.custom.TrainInventoryProvider; +import dev.murad.shipping.entity.custom.vessel.barge.ChestBargeEntity; import dev.murad.shipping.setup.ModItems; import dev.murad.shipping.util.LinkableEntity; import dev.murad.shipping.util.LinkingHandler; @@ -54,7 +56,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.Optional; import java.util.stream.Stream; @@ -184,13 +188,12 @@ protected void handleAirSupply(int p_209207_1_) { public abstract Item getDropItem(); @Override - public Optional getDominated() { + public Optional getFollower() { return this.linkingHandler.follower; } - @Override - public Optional getDominant() { + public Optional getLeader() { return this.linkingHandler.leader; } @@ -666,4 +669,38 @@ public void travel(Vec3 p_213352_1_) { protected double swimSpeed() { return this.getAttribute(ForgeMod.SWIM_SPEED.get()).getValue(); } + + /** + * Grabs a list of connected vessels that provides inventory to this vessel + * For Example: + * Tug F F F C C C -- All F barges are linked to all C barges + * Tug F C F C F C -- Each F barge is linked to 1 C barge + */ + public List getConnectedInventories() { + List result = new ArrayList<>(); + + var vessel = getFollower(); + while (vessel.isPresent()) { + // TODO generalize this to all inventory providers + if (vessel.get() instanceof TrainInventoryProvider) { + break; + } + + vessel = vessel.get().getFollower(); + } + + // vessel is either empty or is a chest barge + while (vessel.isPresent()) { + if (vessel.get() instanceof TrainInventoryProvider e) { + result.add(e); + } else { + break; + } + + vessel = vessel.get().getFollower(); + } + + return result; + } + } diff --git a/src/main/java/dev/murad/shipping/entity/custom/vessel/barge/ChestBargeEntity.java b/src/main/java/dev/murad/shipping/entity/custom/vessel/barge/ChestBargeEntity.java index 4b2c6ff2..1e20514f 100644 --- a/src/main/java/dev/murad/shipping/entity/custom/vessel/barge/ChestBargeEntity.java +++ b/src/main/java/dev/murad/shipping/entity/custom/vessel/barge/ChestBargeEntity.java @@ -1,7 +1,9 @@ package dev.murad.shipping.entity.custom.vessel.barge; +import dev.murad.shipping.entity.custom.TrainInventoryProvider; import dev.murad.shipping.setup.ModEntityTypes; import dev.murad.shipping.setup.ModItems; +import dev.murad.shipping.util.InventoryUtils; import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; @@ -14,13 +16,15 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; +import net.minecraftforge.items.ItemStackHandler; import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.Optional; import java.util.stream.IntStream; -public class ChestBargeEntity extends AbstractBargeEntity implements Container, MenuProvider, WorldlyContainer { - protected final NonNullList itemStacks = createItemStacks(); +public class ChestBargeEntity extends AbstractBargeEntity implements Container, MenuProvider, WorldlyContainer, TrainInventoryProvider { + protected final ItemStackHandler itemHandler = createHandler(); public ChestBargeEntity(EntityType type, Level world) { super(type, world); @@ -30,8 +34,8 @@ public ChestBargeEntity(Level worldIn, double x, double y, double z) { super(ModEntityTypes.CHEST_BARGE.get(), worldIn, x, y, z); } - protected NonNullList createItemStacks(){ - return NonNullList.withSize(36, ItemStack.EMPTY); + private ItemStackHandler createHandler() { + return new ItemStackHandler(27); } @Override @@ -55,47 +59,38 @@ protected void doInteract(Player player) { @Override public int getContainerSize() { - return 27; + return this.itemHandler.getSlots(); } @Override public boolean isEmpty() { - for(ItemStack itemstack : this.itemStacks) { - if (!itemstack.isEmpty()) { - return false; - } - } - - return true; + return InventoryUtils.isEmpty(this.itemHandler); } @Override - public ItemStack getItem(int slot) { - return this.itemStacks.get(slot); + public @NotNull ItemStack getItem(int slot) { + return this.itemHandler.getStackInSlot(slot); } @Override - public ItemStack removeItem(int slot, int count) { - return ContainerHelper.removeItem(this.itemStacks, slot, count); + public @NotNull ItemStack removeItem(int slot, int count) { + return itemHandler.extractItem(slot, count, false); } @Override - public ItemStack removeItemNoUpdate(int slot) { - ItemStack itemstack = this.itemStacks.get(slot); + public @NotNull ItemStack removeItemNoUpdate(int slot) { + ItemStack itemstack = itemHandler.getStackInSlot(slot); if (itemstack.isEmpty()) { return ItemStack.EMPTY; } else { - this.itemStacks.set(slot, ItemStack.EMPTY); + this.itemHandler.setStackInSlot(slot, ItemStack.EMPTY); return itemstack; } } @Override - public void setItem(int slot, ItemStack stack) { - this.itemStacks.set(slot, stack); - if (!stack.isEmpty() && stack.getCount() > this.getMaxStackSize()) { - stack.setCount(this.getMaxStackSize()); - } + public void setItem(int slot, @NotNull ItemStack stack) { + itemHandler.setStackInSlot(slot, stack); } @Override @@ -114,7 +109,7 @@ public boolean stillValid(Player player) { @Override public void clearContent() { - this.itemStacks.clear(); + } @Nullable @@ -129,13 +124,13 @@ public AbstractContainerMenu createMenu(int pContainerId, Inventory pInventory, @Override public void addAdditionalSaveData(@NotNull CompoundTag tag) { super.addAdditionalSaveData(tag); - ContainerHelper.saveAllItems(tag, this.itemStacks); + tag.put("Items", itemHandler.serializeNBT()); } @Override public void readAdditionalSaveData(@NotNull CompoundTag tag) { super.readAdditionalSaveData(tag); - ContainerHelper.loadAllItems(tag, this.itemStacks); + itemHandler.deserializeNBT(tag.getCompound("Items")); } @Override @@ -144,12 +139,17 @@ public int[] getSlotsForFace(Direction face) { } @Override - public boolean canPlaceItemThroughFace(int p_180462_1_, ItemStack p_180462_2_, @Nullable Direction p_180462_3_) { + public boolean canPlaceItemThroughFace(int p_180462_1_, ItemStack item, @Nullable Direction p_180462_3_) { return isDockable(); } @Override - public boolean canTakeItemThroughFace(int p_180461_1_, ItemStack p_180461_2_, Direction p_180461_3_) { + public boolean canTakeItemThroughFace(int p_180461_1_, ItemStack item, Direction p_180461_3_) { return isDockable(); } + + @Override + public Optional getTrainInventoryHandler() { + return Optional.of(itemHandler); + } } diff --git a/src/main/java/dev/murad/shipping/entity/custom/vessel/barge/FishingBargeEntity.java b/src/main/java/dev/murad/shipping/entity/custom/vessel/barge/FishingBargeEntity.java index af0ba377..8492bd14 100644 --- a/src/main/java/dev/murad/shipping/entity/custom/vessel/barge/FishingBargeEntity.java +++ b/src/main/java/dev/murad/shipping/entity/custom/vessel/barge/FishingBargeEntity.java @@ -3,10 +3,12 @@ import com.mojang.datafixers.util.Pair; import dev.murad.shipping.ShippingConfig; import dev.murad.shipping.entity.container.FishingBargeContainer; +import dev.murad.shipping.entity.custom.TrainInventoryProvider; +import dev.murad.shipping.util.InventoryUtils; import dev.murad.shipping.util.LinkableEntity; import dev.murad.shipping.setup.ModEntityTypes; import dev.murad.shipping.setup.ModItems; -import dev.murad.shipping.util.InventoryUtils; +import net.minecraft.Util; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; @@ -29,7 +31,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.storage.loot.BuiltInLootTables; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; @@ -47,10 +48,7 @@ import java.util.*; import java.util.stream.IntStream; -public class FishingBargeEntity extends AbstractBargeEntity implements Container, WorldlyContainer { - protected final ItemStackHandler itemHandler = createHandler(); - protected final LazyOptional handler = LazyOptional.of(() -> itemHandler); - protected boolean contentsChanged = false; +public class FishingBargeEntity extends AbstractBargeEntity { private int ticksDeployable = 0; private int fishCooldown = 0; private final Set> overFishedCoords = new HashSet<>(); @@ -75,39 +73,22 @@ public FishingBargeEntity(Level worldIn, double x, double y, double z) { @Override + // Only called on the server side protected void doInteract(Player player) { - NetworkHooks.openScreen((ServerPlayer) player, createContainerProvider(), buffer -> buffer.writeInt(this.getId())); + var size = getConnectedInventories().size(); - } - - protected MenuProvider createContainerProvider() { - return new MenuProvider() { - @Override - public @NotNull Component getDisplayName() { - return Component.translatable("screen.littlelogistics.fishing_barge"); - } - - @Override - public AbstractContainerMenu createMenu(int i, Inventory playerInventory, Player Player) { - return new FishingBargeContainer(i, level(), getId(), playerInventory, Player); - } - }; + player.displayClientMessage( + switch (size) { + case 0 -> Component.translatable("global.littlelogistics.no_connected_inventory_barge"); + default -> Component.translatable("global.littlelogistics.connected_inventory", size); + }, false); } @Override public void remove(RemovalReason r) { - if (!this.level().isClientSide) { - Containers.dropContents(this.level(), this, this); - } super.remove(r); } - - private ItemStackHandler createHandler() { - return new ItemStackHandler(27); - } - - @Override public void tick(){ super.tick(); @@ -139,6 +120,7 @@ private double computeDepthPenalty(){ return ((double) count) / 20.0; } + // Only called on server side private void tickFish(){ double overFishPenalty = isOverFished() ? 0.05 : 1; double shallowPenalty = computeDepthPenalty(); @@ -161,14 +143,26 @@ private void tickFish(){ .getLootTable(r < treasure_chance ? BuiltInLootTables.FISHING_TREASURE : FISHING_LOOT_TABLE); List list = loottable.getRandomItems(params); + + var inventoryProviders = getConnectedInventories(); + for (ItemStack stack : list) { - int slot = InventoryUtils.findSlotFotItem(this, stack); - if (slot != -1) { - itemHandler.insertItem(slot, stack, false); - } - if(!isOverFished()) { - addOverFish(); + var leftOver = stack; + for (var provider : inventoryProviders) { + if (leftOver.isEmpty()) { + break; + } + + var itemHandler = provider.getTrainInventoryHandler(); + if (itemHandler.isPresent()) { + leftOver = InventoryUtils.moveItemStackIntoHandler(itemHandler.get(), leftOver); + } } + // void the stack if we end up not being able to put it in any connected inventory. + } + + if(!isOverFished()) { + addOverFish(); } } } @@ -186,36 +180,27 @@ private void populateOverfish(String string){ overFishedCoords.addAll(overFishedQueue); } - @Override - public void readAdditionalSaveData(@NotNull CompoundTag compound) { - //backwards compat - CompoundTag inv = compound.getCompound("inv"); - inv.remove("Size"); - - itemHandler.deserializeNBT(inv); - - - populateOverfish(compound.getString("overfish")); - super.readAdditionalSaveData(compound); - } - @Override public void addAdditionalSaveData(@NotNull CompoundTag compound) { - compound.put("inv", itemHandler.serializeNBT()); compound.putString("overfish", overFishedString()); super.addAdditionalSaveData(compound); } - - private void addOverFish(){ + private void addOverFish() { int x = (int) Math.floor(this.getX()); int z = (int) Math.floor(this.getZ()); overFishedCoords.add(new Pair<>(x, z)); overFishedQueue.add(new Pair<>(x, z)); - if(overFishedQueue.size() > 30){ + if (overFishedQueue.size() > 30) { overFishedCoords.remove(overFishedQueue.poll()); } } + @Override + public void readAdditionalSaveData(@NotNull CompoundTag compound) { + populateOverfish(compound.getString("overfish")); + super.readAdditionalSaveData(compound); + } + private boolean isOverFished(){ int x = (int) Math.floor(this.getX()); int z = (int) Math.floor(this.getZ()); @@ -227,81 +212,6 @@ public Item getDropItem() { return ModItems.FISHING_BARGE.get(); } - @Override - public int[] getSlotsForFace(Direction p_180463_1_) { - return IntStream.range(0, getContainerSize()).toArray(); - } - - @Override - public boolean canPlaceItemThroughFace(int p_180462_1_, ItemStack p_180462_2_, @Nullable Direction p_180462_3_) { - return false; - } - - @Override - public boolean canTakeItemThroughFace(int p_180461_1_, ItemStack p_180461_2_, Direction p_180461_3_) { - return isDockable(); - } - - @Override - public boolean canPlaceItem(int p_94041_1_, ItemStack p_94041_2_) { - return false; - } - - @Override - public int getContainerSize() { - return itemHandler.getSlots(); - } - - @Override - public boolean isEmpty() { - for (int i = 0; i < itemHandler.getSlots(); i++){ - if(!itemHandler.getStackInSlot(i).isEmpty() && !itemHandler.getStackInSlot(i).getItem().equals(Items.AIR)){ - return false; - } - } - return true; - } - - @Override - public ItemStack getItem(int p_70301_1_) { - return itemHandler.getStackInSlot(p_70301_1_); - } - - @Override - public ItemStack removeItem(int p_70298_1_, int p_70298_2_) { - return itemHandler.extractItem(p_70298_1_, p_70298_2_, false); - } - - @Override - public ItemStack removeItemNoUpdate(int p_70304_1_) { - ItemStack itemstack = itemHandler.getStackInSlot(p_70304_1_); - if (itemstack.isEmpty()) { - return ItemStack.EMPTY; - } else { - this.itemHandler.setStackInSlot(p_70304_1_, ItemStack.EMPTY); - return itemstack; - } - } - - @Override - public void setItem(int p_70299_1_, ItemStack p_70299_2_) { - itemHandler.setStackInSlot(p_70299_1_, p_70299_2_); - } - - @Override - public void setChanged() { - contentsChanged = true; - } - - @Override - public boolean stillValid(Player p_70300_1_) { - if (this.dead) { - return false; - } else { - return !(p_70300_1_.distanceToSqr(this) > 64.0D); - } - } - public Status getStatus(){ return hasWaterOnSides() ? getNonStashedStatus() : Status.STASHED; } @@ -319,18 +229,9 @@ private Status getNonStashedStatus(){ @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { - return handler.cast(); - } - return super.getCapability(cap, side); } - @Override - public void clearContent() { - - } - public enum Status { STASHED, DEPLOYED, diff --git a/src/main/java/dev/murad/shipping/entity/custom/vessel/tug/AbstractTugEntity.java b/src/main/java/dev/murad/shipping/entity/custom/vessel/tug/AbstractTugEntity.java index 866b84a7..5bf77394 100644 --- a/src/main/java/dev/murad/shipping/entity/custom/vessel/tug/AbstractTugEntity.java +++ b/src/main/java/dev/murad/shipping/entity/custom/vessel/tug/AbstractTugEntity.java @@ -124,7 +124,7 @@ public void dropLeash(boolean p_110160_1_, boolean p_110160_2_) { public abstract DataAccessor getDataAccessor(); private ItemStackHandler createRouteItemHandler() { - return new ItemStackHandler(1) { + return new ItemStackHandler() { @Override protected int getStackLimit(int slot, @Nonnull ItemStack stack) { return 1; @@ -139,16 +139,6 @@ protected void onContentsChanged(int slot) { public boolean isItemValid(int slot, @Nonnull ItemStack stack) { return stack.getItem() instanceof TugRouteItem; } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!isItemValid(slot, stack)) { - return stack; - } - - return super.insertItem(slot, stack, simulate); - } }; } diff --git a/src/main/java/dev/murad/shipping/entity/custom/vessel/tug/SteamTugEntity.java b/src/main/java/dev/murad/shipping/entity/custom/vessel/tug/SteamTugEntity.java index 973d63a3..10e4c57e 100644 --- a/src/main/java/dev/murad/shipping/entity/custom/vessel/tug/SteamTugEntity.java +++ b/src/main/java/dev/murad/shipping/entity/custom/vessel/tug/SteamTugEntity.java @@ -6,10 +6,10 @@ import dev.murad.shipping.setup.ModEntityTypes; import dev.murad.shipping.setup.ModItems; import dev.murad.shipping.setup.ModSounds; +import dev.murad.shipping.util.FuelItemStackHandler; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; - import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.animal.WaterAnimal; @@ -19,22 +19,20 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.FurnaceBlockEntity; -import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemStackHandler; import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; import javax.annotation.Nullable; public class SteamTugEntity extends AbstractTugEntity { - private static final int FURNACE_FUEL_MULTIPLIER= ShippingConfig.Server.STEAM_TUG_FUEL_MULTIPLIER.get(); - private final ItemStackHandler itemHandler = createHandler(); - private final LazyOptional handler = LazyOptional.of(() -> itemHandler); + private final ForgeConfigSpec.ConfigValue FURNACE_FUEL_MULTIPLIER = ShippingConfig.Server.STEAM_TUG_FUEL_MULTIPLIER; + private final FuelItemStackHandler fuelItemHandler = new FuelItemStackHandler(); + private final LazyOptional handler = LazyOptional.of(() -> fuelItemHandler); protected int burnTime = 0; protected int burnCapacity = 0; @@ -46,25 +44,6 @@ public SteamTugEntity(Level worldIn, double x, double y, double z) { super(ModEntityTypes.STEAM_TUG.get(), worldIn, x, y, z); } - private ItemStackHandler createHandler() { - return new ItemStackHandler(1) { - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - return FurnaceBlockEntity.isFuel(stack); - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!isItemValid(slot, stack)) { - return stack; - } - - return super.insertItem(slot, stack, simulate); - } - }; - } - @Override protected MenuProvider createContainerProvider() { return new MenuProvider() { @@ -124,17 +103,11 @@ protected boolean tickFuel() { burnTime--; return true; } else { - ItemStack stack = itemHandler.getStackInSlot(0); - if (!stack.isEmpty()) { - burnCapacity = (ForgeHooks.getBurnTime(stack, null) * FURNACE_FUEL_MULTIPLIER) - 1; - burnTime = burnCapacity - 1; - stack.shrink(1); - return true; - } else { - burnCapacity = 0; - burnTime = 0; - return false; - } + int burnTime = fuelItemHandler.tryConsumeFuel(); + int adjustedBurnTime = (int) Math.ceil(burnTime * FURNACE_FUEL_MULTIPLIER.get()); + this.burnCapacity = adjustedBurnTime; + this.burnTime = adjustedBurnTime; + return adjustedBurnTime > 0; } } @@ -147,13 +120,7 @@ public Item getDropItem() { public void readAdditionalSaveData(@NotNull CompoundTag compound) { burnTime = compound.contains("burn") ? compound.getInt("burn") : 0; burnCapacity = compound.contains("burn_capacity") ? compound.getInt("burn_capacity") : 0; - if(compound.contains("inv")){ - ItemStackHandler old = new ItemStackHandler(); - old.deserializeNBT(compound.getCompound("inv")); - itemHandler.setStackInSlot(0, old.getStackInSlot(1)); - }else{ - itemHandler.deserializeNBT(compound.getCompound("tugItemHandler")); - } + fuelItemHandler.deserializeNBT(compound.getCompound("fuelItems")); super.readAdditionalSaveData(compound); } @@ -161,7 +128,7 @@ public void readAdditionalSaveData(@NotNull CompoundTag compound) { public void addAdditionalSaveData(@NotNull CompoundTag compound) { compound.putInt("burn", burnTime); compound.putInt("burn_capacity", burnCapacity); - compound.put("tugItemHandler", itemHandler.serializeNBT()); + compound.put("fuelItems", fuelItemHandler.serializeNBT()); super.addAdditionalSaveData(compound); } @@ -174,22 +141,22 @@ protected void onUndock() { // Have to implement IInventory to work with hoppers @Override public boolean isEmpty() { - return itemHandler.getStackInSlot(0).isEmpty(); + return fuelItemHandler.getStackInSlot(0).isEmpty(); } @Override - public ItemStack getItem(int p_70301_1_) { - return itemHandler.getStackInSlot(p_70301_1_); + public @NotNull ItemStack getItem(int p_70301_1_) { + return fuelItemHandler.getStackInSlot(p_70301_1_); } @Override - public void setItem(int p_70299_1_, ItemStack p_70299_2_) { - if (!this.itemHandler.isItemValid(p_70299_1_, p_70299_2_)){ + public void setItem(int slot, @NotNull ItemStack stack) { + if (!this.fuelItemHandler.isItemValid(slot, stack)){ return; } - this.itemHandler.insertItem(p_70299_1_, p_70299_2_, false); - if (!p_70299_2_.isEmpty() && p_70299_2_.getCount() > this.getMaxStackSize()) { - p_70299_2_.setCount(this.getMaxStackSize()); + this.fuelItemHandler.insertItem(slot, stack, false); + if (!stack.isEmpty() && stack.getCount() > this.getMaxStackSize()) { + stack.setCount(this.getMaxStackSize()); } } diff --git a/src/main/java/dev/murad/shipping/entity/render/barge/AbstractVesselRenderer.java b/src/main/java/dev/murad/shipping/entity/render/barge/AbstractVesselRenderer.java index 232c727c..0be3158b 100644 --- a/src/main/java/dev/murad/shipping/entity/render/barge/AbstractVesselRenderer.java +++ b/src/main/java/dev/murad/shipping/entity/render/barge/AbstractVesselRenderer.java @@ -68,8 +68,8 @@ protected float getModelYrot() { } private void getAndRenderChain(T bargeEntity, PoseStack matrixStack, MultiBufferSource buffer, int p_225623_6_) { - if(bargeEntity.getDominant().isPresent()) { - double dist = bargeEntity.getDominant().get().distanceTo(bargeEntity); + if(bargeEntity.getLeader().isPresent()) { + double dist = bargeEntity.getLeader().get().distanceTo(bargeEntity); VertexConsumer ivertexbuilderChain = buffer.getBuffer(chainModel.renderType(CHAIN_TEXTURE)); int segments = (int) Math.ceil(dist * 4); matrixStack.pushPose(); @@ -97,11 +97,11 @@ private void getAndRenderLeash(T bargeEntity, float p_225623_2_, float p_225623_ @Override public boolean shouldRender(T p_225626_1_, Frustum p_225626_2_, double p_225626_3_, double p_225626_5_, double p_225626_7_) { - if(p_225626_1_.getDominant().isPresent()){ - if(p_225626_1_.getDominant().get().shouldRender(p_225626_3_, p_225626_5_, p_225626_7_)){ + if(p_225626_1_.getLeader().isPresent()){ + if(p_225626_1_.getLeader().get().shouldRender(p_225626_3_, p_225626_5_, p_225626_7_)){ return true; } - if(p_225626_1_.getDominant().get().shouldRender(p_225626_3_, p_225626_5_, p_225626_7_)){ + if(p_225626_1_.getLeader().get().shouldRender(p_225626_3_, p_225626_5_, p_225626_7_)){ return true; } } diff --git a/src/main/java/dev/murad/shipping/entity/render/train/TrainCarRenderer.java b/src/main/java/dev/murad/shipping/entity/render/train/TrainCarRenderer.java index f4a62044..bbe4c374 100644 --- a/src/main/java/dev/murad/shipping/entity/render/train/TrainCarRenderer.java +++ b/src/main/java/dev/murad/shipping/entity/render/train/TrainCarRenderer.java @@ -43,7 +43,7 @@ public TrainCarRenderer(EntityRendererProvider.Context context, Function attachmentPoints = renderCarAndGetAttachmentPoints(car, yaw, pPartialTicks, pose, buffer, pPackedLight); - while (t.getDominated().isPresent()) { - AbstractTrainCarEntity nextT = t.getDominated().get(); + while (t.getFollower().isPresent()) { + AbstractTrainCarEntity nextT = t.getFollower().get(); EntityRenderer renderer = Minecraft.getInstance().getEntityRenderDispatcher().getRenderer(nextT); if (renderer instanceof RenderWithAttachmentPoints) { @SuppressWarnings("unchecked") diff --git a/src/main/java/dev/murad/shipping/util/FuelItemStackHandler.java b/src/main/java/dev/murad/shipping/util/FuelItemStackHandler.java new file mode 100644 index 00000000..ed8f52db --- /dev/null +++ b/src/main/java/dev/murad/shipping/util/FuelItemStackHandler.java @@ -0,0 +1,63 @@ +package dev.murad.shipping.util; + +import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.level.block.AbstractFurnaceBlock; +import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity; +import net.minecraft.world.level.block.entity.FurnaceBlockEntity; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.items.ItemStackHandler; + +import javax.annotation.Nonnull; + +/** + * Implementation of ItemStackHandler that doesn't change size when loaded from NBT. + * Used in Steam and Locomotive tugs. + */ +public class FuelItemStackHandler extends ItemStackHandler { + public FuelItemStackHandler() { + super(1); + } + + /** + * Consume an item of fuel + * @return number of base ticks the fuel burns for. This will be multiplied by the fuel multiplier in config + */ + public int tryConsumeFuel() { + var stack = getStackInSlot(0); + var burnTime = ForgeHooks.getBurnTime(stack, null); + + if (burnTime > 0) { + // shrink the stack and replace with byproducts (if exists) + var byproduct = stack.getCraftingRemainingItem(); + stack.shrink(1); + + if (stack.isEmpty()) { + // replace stack with byproduct + // if somehow a stackable item has a byproduct, then we should call the police + setStackInSlot(0, byproduct); + } + } + + return burnTime; + } + + @Override + public boolean isItemValid(int slot, @Nonnull ItemStack stack) { + return FurnaceBlockEntity.isFuel(stack); + } + + @Override + public CompoundTag serializeNBT() { + var tag = super.serializeNBT(); + tag.remove("Size"); + return tag; + } + + @Override + public void deserializeNBT(CompoundTag nbt) { + nbt.remove("Size"); + super.deserializeNBT(nbt); + } +} \ No newline at end of file diff --git a/src/main/java/dev/murad/shipping/util/InventoryUtils.java b/src/main/java/dev/murad/shipping/util/InventoryUtils.java index 18320ed4..42d12ac9 100644 --- a/src/main/java/dev/murad/shipping/util/InventoryUtils.java +++ b/src/main/java/dev/murad/shipping/util/InventoryUtils.java @@ -1,5 +1,6 @@ package dev.murad.shipping.util; +import lombok.NonNull; import net.minecraft.world.Container; import net.minecraft.world.entity.Entity; import net.minecraft.world.item.Item; @@ -59,18 +60,22 @@ else if (stack.getMaxStackSize() != stack.getCount() && target.canPlaceItem(i, s return false; } - public static int findSlotFotItem(Container target, ItemStack itemStack) { - for (int i = 0; i < target.getContainerSize(); i++) { - ItemStack stack = target.getItem(i); - if(stack.isEmpty() || stack.getItem().equals(Items.AIR)){ - return i; - } - else if (canMergeItems(stack, itemStack)) { - return i; + public static boolean isEmpty(ItemStackHandler itemHandler) { + for (int i = 0; i < itemHandler.getSlots(); i++){ + if(!itemHandler.getStackInSlot(i).isEmpty() && !itemHandler.getStackInSlot(i).getItem().equals(Items.AIR)){ + return false; } } + return true; + } - return -1; + @NonNull + public static ItemStack moveItemStackIntoHandler(ItemStackHandler handler, @NonNull ItemStack stack) { + var slots = handler.getSlots(); + for (int i = 0; i < slots && !stack.isEmpty(); i++) { + stack = handler.insertItem(i, stack, false); + } + return stack; } public static boolean canMergeItems(ItemStack stack1, ItemStack stack2) { diff --git a/src/main/java/dev/murad/shipping/util/LinkableEntity.java b/src/main/java/dev/murad/shipping/util/LinkableEntity.java index a25a52a6..56002b85 100644 --- a/src/main/java/dev/murad/shipping/util/LinkableEntity.java +++ b/src/main/java/dev/murad/shipping/util/LinkableEntity.java @@ -12,8 +12,8 @@ public interface LinkableEntity> { - Optional getDominated(); - Optional getDominant(); + Optional getFollower(); + Optional getLeader(); void setDominated(V entity); void setDominant(V entity); void removeDominated(); @@ -25,16 +25,16 @@ public interface LinkableEntity> { boolean hasWaterOnSides(); default void handleLinkableKill(){ - this.getDominated().ifPresent(LinkableEntity::removeDominant); - this.getDominant().ifPresent(LinkableEntity::removeDominated); + this.getFollower().ifPresent(LinkableEntity::removeDominant); + this.getLeader().ifPresent(LinkableEntity::removeDominated); } default boolean checkNoLoopsDominated(){ - return checkNoLoopsHelper(this, (LinkableEntity::getDominated), new HashSet<>()); + return checkNoLoopsHelper(this, (LinkableEntity::getFollower), new HashSet<>()); } default boolean checkNoLoopsDominant(){ - return checkNoLoopsHelper(this, (LinkableEntity::getDominant), new HashSet<>()); + return checkNoLoopsHelper(this, (LinkableEntity::getLeader), new HashSet<>()); } default boolean checkNoLoopsHelper(LinkableEntity entity, Function, Optional> next, Set> set){ @@ -53,7 +53,7 @@ default Stream applyWithAll(Function, U> function){ default Stream applyWithDominant(Function, U> function){ Stream ofThis = Stream.of(function.apply(this)); - return checkNoLoopsDominant() ? ofThis : this.getDominant().map(dom -> + return checkNoLoopsDominant() ? ofThis : this.getLeader().map(dom -> Stream.concat(ofThis, dom.applyWithDominant(function)) ).orElse(ofThis); @@ -62,7 +62,7 @@ default Stream applyWithDominant(Function, U> function){ default Stream applyWithDominated(Function, U> function){ Stream ofThis = Stream.of(function.apply(this)); - return checkNoLoopsDominated() ? ofThis : this.getDominated().map(dom -> + return checkNoLoopsDominated() ? ofThis : this.getFollower().map(dom -> Stream.concat(ofThis, dom.applyWithDominated(function)) ).orElse(ofThis); diff --git a/src/main/java/dev/murad/shipping/util/Train.java b/src/main/java/dev/murad/shipping/util/Train.java index 13da9d55..7503d482 100644 --- a/src/main/java/dev/murad/shipping/util/Train.java +++ b/src/main/java/dev/murad/shipping/util/Train.java @@ -1,10 +1,8 @@ package dev.murad.shipping.util; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.Optional; -import java.util.stream.Stream; @SuppressWarnings("OptionalUsedAsFieldOrParameterType") public class Train > { @@ -38,7 +36,7 @@ public List asListOfTugged(){ if(this.head.checkNoLoopsDominated()) { // just in case - to avoid crashing the world. this.head.removeDominated(); - this.head.getDominated().ifPresent(LinkableEntity::removeDominant); + this.head.getFollower().ifPresent(LinkableEntity::removeDominant); return new ArrayList<>(); } return tug.map(tugEntity -> { @@ -54,7 +52,7 @@ public List asList(){ if(this.head.checkNoLoopsDominated()) { // just in case - to avoid crashing the world. this.head.removeDominated(); - this.head.getDominated().ifPresent(LinkableEntity::removeDominant); + this.head.getFollower().ifPresent(LinkableEntity::removeDominant); return new ArrayList<>(); } @@ -66,7 +64,7 @@ public List asList(){ } public Optional getNext(V entity){ - return entity.getDominated().map(t -> (V) t); + return entity.getFollower().map(t -> (V) t); } public void setHead(V head) { diff --git a/src/main/resources/assets/littlelogistics/lang/en_us.json b/src/main/resources/assets/littlelogistics/lang/en_us.json index d0f7366b..7aa127ae 100644 --- a/src/main/resources/assets/littlelogistics/lang/en_us.json +++ b/src/main/resources/assets/littlelogistics/lang/en_us.json @@ -73,9 +73,13 @@ "screen.littlelogistics.locomotive.register_info": "Registered vehicles can travel without chunkloaders", "screen.littlelogistics.locomotive.frozen": "As per server config, this vehicle is frozen as the owner is offline", - "global.littlelogistics.locomotive.register_success": "Maximim number of registered vehicles reached: %s", + "global.littlelogistics.locomotive.register_success": "Maximum number of registered vehicles reached: %s", "global.littlelogistics.locomotive.register_fail": "Successfully registered the vehicle, vehicles registered: %s/%s", + "global.littlelogistics.no_connected_inventory_barge": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Barge.", + "global.littlelogistics.no_connected_inventory_car": "This train car requires a connected inventory behind it but none was provided. Link additional train car that provide inventory behind this one, such as a Chest Car.", + "global.littlelogistics.connected_inventory": "This barge has %s connected inventories", + "item.littlelogistics.tug_route.description": "Right click to add node at the end of the route, right click at the same location to remove. Shift right click to bring up menu.", "item.littlelogistics.tug_route.num_nodes": "Route Nodes: %s", "item.littlelogistics.tug_route.added": "Added Route Node X:%s Z:%s", diff --git a/src/main/resources/assets/littlelogistics/lang/es_es.json b/src/main/resources/assets/littlelogistics/lang/es_es.json index d757196d..3162eef6 100644 --- a/src/main/resources/assets/littlelogistics/lang/es_es.json +++ b/src/main/resources/assets/littlelogistics/lang/es_es.json @@ -68,6 +68,17 @@ "screen.littlelogistics.locomotive.route": "Visitado:", "screen.littlelogistics.locomotive.on": "Encender motor", "screen.littlelogistics.locomotive.off": "Detener motor", + "screen.littlelogistics.locomotive.register": "Register", + "screen.littlelogistics.locomotive.registration": "Registration", + "screen.littlelogistics.locomotive.register_info": "Registered vehicles can travel without chunkloaders", + "screen.littlelogistics.locomotive.frozen": "As per server config, this vehicle is frozen as the owner is offline", + + "global.littlelogistics.locomotive.register_success": "Maximum number of registered vehicles reached: %s", + "global.littlelogistics.locomotive.register_fail": "Successfully registered the vehicle, vehicles registered: %s/%s", + + "global.littlelogistics.no_connected_inventory_barge": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Barge.", + "global.littlelogistics.no_connected_inventory_car": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Car.", + "global.littlelogistics.connected_inventory": "This barge has %s connected inventories", "item.littlelogistics.tug_route.description": "Haga click derecho para agregar un nodo al final de la ruta, haga clic con el botón derecho en la misma ubicación para eliminarlo. Shift + click derecho para abrir el menú.", "item.littlelogistics.tug_route.num_nodes": "Nodos en la ruta: %s", @@ -76,12 +87,14 @@ "item.littlelogistics.tug_route.node": "%s. Nodo", "item.littlelogistics.tug_route.node_named": "%s. %s", "item.littlelogistics.tug_route.node_line": "Nodo %s: %s, %s", - + + "item.littlelogistics.conductors_wrench.description": "Can be used to rotate vanilla rails and configure Little Logistics blocks.", + "item.littlelogistics.locomotive_route.description": "Haga clic con el botón derecho en un carril para agregarlo o eliminarlo de la ruta.", "item.littlelogistics.locomotive_route.num_nodes": "Nodos en la ruta: %s", "item.littlelogistics.locomotive_route.added": "Nodo de ruta agregado en X:%s Y:%s Z:%s", "item.littlelogistics.locomotive_route.removed": "Nodo de ruta eliminado en X:%s Y:%s Z:%s", - + "item.littlelogistics.spring.description": "Se utiliza para vincular vehículos.", "item.littlelogistics.spring.notToSelf": "No se pueden vincular vehículos a uno mismo", "item.littlelogistics.spring.noTwoTugs": "No se pueden vincular dos remolcadores", @@ -102,4 +115,4 @@ "subtitle.littlelogistics.steam_tug_whistle": "Silbato de vapor del remolcador", "subtitle.littlelogistics.tug_docking": "Atracador de remolcador", "subtitle.littlelogistics.tug_undocking": "Desatracador de remolcador" -} +} \ No newline at end of file diff --git a/src/main/resources/assets/littlelogistics/lang/fr_fr.json b/src/main/resources/assets/littlelogistics/lang/fr_fr.json index 843d8119..010c0a4a 100644 --- a/src/main/resources/assets/littlelogistics/lang/fr_fr.json +++ b/src/main/resources/assets/littlelogistics/lang/fr_fr.json @@ -6,9 +6,19 @@ "item.littlelogistics.fishing_barge": "Barge de Pêche", "item.littlelogistics.spring": "Chaîne de Bateau", "item.littlelogistics.tug_route": "Chemin de Halage", + "item.littlelogistics.locomotive_route": "Locomotive Route", "item.littlelogistics.energy_tug": "Remorqueur Électrique", "item.littlelogistics.fluid_barge": "Remorqueur de Transport de Liquide", + "item.littlelogistics.fluid_car": "Fluid Tank Train Car", + "item.littlelogistics.chest_car": "Chest Train Car", + "item.littlelogistics.chunk_loader_car": "Chunk Loader Train Car", + "item.littlelogistics.seater_car": "Train Car", + "item.littlelogistics.steam_locomotive": "Steam Locomotive", + "item.littlelogistics.energy_locomotive": "Energy Locomotive", + "item.littlelogistics.receiver_component": "Wireless Receiver Component", + "item.littlelogistics.transmitter_component": "Wireless Transmitter Component", + "item.littlelogistics.conductors_wrench": "Conductor's Wrench", "entity.littlelogistics.tug": "Remorqueur à Vapeur", "entity.littlelogistics.barge": "Barge de Coffre", @@ -18,6 +28,12 @@ "entity.littlelogistics.energy_tug": "Remorqueur Électrique", "entity.littlelogistics.fluid_barge": "Remorqueur de Transport de Liquide", "entity.littlelogistics.seater_barge": "Barge de Chaise", + "entity.littlelogistics.fluid_car": "Fluid Tank Train Car", + "entity.littlelogistics.chest_car": "Chest Train Car", + "entity.littlelogistics.chunk_loader_car": "Chunk Loader Train Car", + "entity.littlelogistics.seater_car": "Train Car", + "entity.littlelogistics.steam_locomotive": "Steam Locomotive", + "entity.littlelogistics.energy_locomotive": "Energy Locomotive", "block.littlelogistics.tug_dock": "Quai de Remorqueur", "block.littlelogistics.barge_dock": "Quai de Barge", @@ -25,21 +41,67 @@ "block.littlelogistics.guide_rail_corner": "Guide d'angle du remorqueur", "block.littlelogistics.vessel_charger": "Chargeur de Bateau", "block.littlelogistics.fluid_hopper": "Entonnoir Liquide", + "block.littlelogistics.rapid_hopper": "Rapid Hopper", + "block.littlelogistics.vessel_detector": "Vehicle Detector", + + "block.littlelogistics.junction_rail": "Junction Rail", + "block.littlelogistics.switch_rail": "Switch Rail", + "block.littlelogistics.automatic_switch_rail": "Automatic Switch Rail", + "block.littlelogistics.tee_junction_rail": "T-Junction Rail", + "block.littlelogistics.automatic_tee_junction_rail": "Automatic T-Junction Rail", + "block.littlelogistics.locomotive_dock_rail": "Locomotive Docking Rail", + "block.littlelogistics.car_dock_rail": "Train Car Docking Rail", "screen.littlelogistics.tug": "Remorqueur à Vapeur", "screen.littlelogistics.fishing_barge": "Barge de Pêche", "screen.littlelogistics.energy_tug": "Remorqueur Électrique", "screen.littlelogistics.energy_tug.energy": "%s/%s FE", + "screen.littlelogistics.tug_route": "Tug Route Configurator", + "screen.littlelogistics.tug_route.rename_button": "Rename node", + "screen.littlelogistics.tug_route.up_button": "Move node up", + "screen.littlelogistics.tug_route.down_button": "Move node down", + "screen.littlelogistics.tug_route.delete_button": "Remove node", + "screen.littlelogistics.tug_route.rename": "Renaming %s", + "screen.littlelogistics.tug_route.confirm": "Save", + + "screen.littlelogistics.locomotive.route": "Visited:", + "screen.littlelogistics.locomotive.on": "Start Engine", + "screen.littlelogistics.locomotive.off": "Halt Engine", + "screen.littlelogistics.locomotive.register": "Register", + "screen.littlelogistics.locomotive.registration": "Registration", + "screen.littlelogistics.locomotive.register_info": "Registered vehicles can travel without chunkloaders", + "screen.littlelogistics.locomotive.frozen": "As per server config, this vehicle is frozen as the owner is offline", + + "global.littlelogistics.locomotive.register_success": "Maximum number of registered vehicles reached: %s", + "global.littlelogistics.locomotive.register_fail": "Successfully registered the vehicle, vehicles registered: %s/%s", + + "global.littlelogistics.no_connected_inventory_barge": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Barge.", + "global.littlelogistics.no_connected_inventory_car": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Car.", + "global.littlelogistics.connected_inventory": "This barge has %s connected inventories", + "item.littlelogistics.tug_route.description": "Clic droit pour ajouter une balise, clic droit sur une balise existante pour la supprimer. Les nouvelles balises sont ajoutés à la fin du guide.", + "item.littlelogistics.tug_route.num_nodes": "Route Nodes: %s", "item.littlelogistics.tug_route.added": "Balise de guidage ajoutée á X:%s Z:%s", "item.littlelogistics.tug_route.removed": "Balise de guidage supprimée à X:%s Z:%s", "item.littlelogistics.tug_route.node": "Balise", + "item.littlelogistics.tug_route.node_named": "%s. %s", + "item.littlelogistics.tug_route.node_line": "Node %s: %s, %s", + + "item.littlelogistics.conductors_wrench.description": "Can be used to rotate vanilla rails and configure Little Logistics blocks.", + + "item.littlelogistics.locomotive_route.description": "Right click on a rail to add or remove it from the route.", + "item.littlelogistics.locomotive_route.num_nodes": "Route Nodes: %s", + "item.littlelogistics.locomotive_route.added": "Added Route Node X:%s Y:%s Z:%s", + "item.littlelogistics.locomotive_route.removed": "Removed Route Node X:%s Y:%s Z:%s", + "item.littlelogistics.spring.description": "Utilisé pour connecter des barges et des remorqueurs", "item.littlelogistics.spring.notToSelf": "Impossible de connecter un bateau à elle-même", "item.littlelogistics.spring.noTwoTugs": "Impossible de connecter deux remorqueurs", + "item.littlelogistics.spring.noTwoLoco": "Can't link two locomotives", "item.littlelogistics.spring.tooFar": "Les bateaux sont trop loin pour la connexion", "item.littlelogistics.spring.noLoops": "Impossible de connecter des bateaux en cercle", + "item.littlelogistics.spring.badTypes": "Can't link these types of vehicles together!", "item.littlelogistics.fishing_barge.description": "Pour de meilleurs résultats, utilisez-le lors de longs voyages en eau profonde et libre.", "item.littlelogistics.creative_capacitor": "Condensateur Créatif", @@ -48,5 +110,9 @@ "block.littlelogistics.fluid_hopper.capacity": "%s %s/%s mB", "block.littlelogistics.fluid_hopper.capacity_empty": "Vide 0/%s mB", "entity.littlelogistics.fluid_barge.capacity": "%s %s/%s mB", - "entity.littlelogistics.fluid_barge.capacity_empty": "Vide 0/%s mB" -} + "entity.littlelogistics.fluid_barge.capacity_empty": "Vide 0/%s mB", + + "subtitle.littlelogistics.steam_tug_whistle": "Steam tug whistles", + "subtitle.littlelogistics.tug_docking": "Tug boat docks", + "subtitle.littlelogistics.tug_undocking": "Tug boat undocks" +} \ No newline at end of file diff --git a/src/main/resources/assets/littlelogistics/lang/ja_jp.json b/src/main/resources/assets/littlelogistics/lang/ja_jp.json index dfd67b8f..e4f1027f 100644 --- a/src/main/resources/assets/littlelogistics/lang/ja_jp.json +++ b/src/main/resources/assets/littlelogistics/lang/ja_jp.json @@ -18,7 +18,6 @@ "item.littlelogistics.receiver_component": "ワイヤレス受信部品", "item.littlelogistics.transmitter_component": "ワイヤレス送信部品", - "item.littlelogistics.conductors_wrench": "コンダクターレンチ", "entity.littlelogistics.tug": "蒸気曳船", @@ -69,6 +68,17 @@ "screen.littlelogistics.locomotive.route": "目的地:", "screen.littlelogistics.locomotive.on": "動力起動", "screen.littlelogistics.locomotive.off": "動力停止", + "screen.littlelogistics.locomotive.register": "Register", + "screen.littlelogistics.locomotive.registration": "Registration", + "screen.littlelogistics.locomotive.register_info": "Registered vehicles can travel without chunkloaders", + "screen.littlelogistics.locomotive.frozen": "As per server config, this vehicle is frozen as the owner is offline", + + "global.littlelogistics.locomotive.register_success": "Maximum number of registered vehicles reached: %s", + "global.littlelogistics.locomotive.register_fail": "Successfully registered the vehicle, vehicles registered: %s/%s", + + "global.littlelogistics.no_connected_inventory_barge": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Barge.", + "global.littlelogistics.no_connected_inventory_car": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Car.", + "global.littlelogistics.connected_inventory": "This barge has %s connected inventories", "item.littlelogistics.tug_route.description": "右クリックで立っている地点にノードを追加でき、既にあるノードの地点で右クリックすることによりノードを削除できます。Shiftキーを押しながら右クリックでメニューを表示します。", "item.littlelogistics.tug_route.num_nodes": "ルートノード: %s", @@ -78,6 +88,8 @@ "item.littlelogistics.tug_route.node_named": "%s. %s", "item.littlelogistics.tug_route.node_line": "ノード %s: %s, %s", + "item.littlelogistics.conductors_wrench.description": "Can be used to rotate vanilla rails and configure Little Logistics blocks.", + "item.littlelogistics.locomotive_route.description": "線路に向かって右クリックでその地点をルートに追加でき、追加済みの地点で再び右クリックすることによりその地点をルートから削除できます", "item.littlelogistics.locomotive_route.num_nodes": "ルートノード: %s", "item.littlelogistics.locomotive_route.added": "X:%s Y:%s Z:%sにルートノードを追加", @@ -103,4 +115,4 @@ "subtitle.littlelogistics.steam_tug_whistle": "乗り物の汽笛が鳴りひびく", "subtitle.littlelogistics.tug_docking": "乗り物がドックに着く", "subtitle.littlelogistics.tug_undocking": "乗り物がドックを出発する" -} +} \ No newline at end of file diff --git a/src/main/resources/assets/littlelogistics/lang/ko_kr.json b/src/main/resources/assets/littlelogistics/lang/ko_kr.json index b5054dd6..9de8fd18 100644 --- a/src/main/resources/assets/littlelogistics/lang/ko_kr.json +++ b/src/main/resources/assets/littlelogistics/lang/ko_kr.json @@ -15,11 +15,11 @@ "item.littlelogistics.seater_car": "철도 차량", "item.littlelogistics.steam_locomotive": "증기 기관차", "item.littlelogistics.energy_locomotive": "에너지 기관차", - + "item.littlelogistics.receiver_component": "무선 수신기 부품", "item.littlelogistics.transmitter_component": "무선 송신기 부품", "item.littlelogistics.conductors_wrench": "차장의 렌치", - + "entity.littlelogistics.tug": "증기 예인선", "entity.littlelogistics.barge": "상자 바지선", "entity.littlelogistics.chunk_loader_barge": "청크 로더 바지선", @@ -34,7 +34,7 @@ "entity.littlelogistics.seater_car": "철도 차량", "entity.littlelogistics.steam_locomotive": "증기 기관차", "entity.littlelogistics.energy_locomotive": "에너지 기관차", - + "block.littlelogistics.tug_dock": "예인선 선창", "block.littlelogistics.barge_dock": "바지선 선창", "block.littlelogistics.guide_rail_tug": "예인선 가이드 레일", @@ -44,7 +44,6 @@ "block.littlelogistics.rapid_hopper": "빠른 호퍼", "block.littlelogistics.vessel_detector": "선박 감지기", - "block.littlelogistics.junction_rail": "분기점 레일", "block.littlelogistics.switch_rail": "스위치 레일", "block.littlelogistics.automatic_switch_rail": "자동 스위치 레일", @@ -52,12 +51,12 @@ "block.littlelogistics.automatic_tee_junction_rail": "자동 T형 분기점 레일", "block.littlelogistics.locomotive_dock_rail": "기관차 도킹 레일", "block.littlelogistics.car_dock_rail": "철도 차량 도킹 레일", - + "screen.littlelogistics.tug": "증기 예인선", "screen.littlelogistics.fishing_barge": "자동 낚시 바지선", "screen.littlelogistics.energy_tug": "에너지 예인선", "screen.littlelogistics.energy_tug.energy": "%s/%s FE", - + "screen.littlelogistics.tug_route": "예인선 경로 구성장치", "screen.littlelogistics.tug_route.rename_button": "노드 이름 바꾸기", "screen.littlelogistics.tug_route.up_button": "노드를 위로 이동", @@ -65,11 +64,22 @@ "screen.littlelogistics.tug_route.delete_button": "노드 삭제", "screen.littlelogistics.tug_route.rename": "%s 이름 바꾸기", "screen.littlelogistics.tug_route.confirm": "저장", - + "screen.littlelogistics.locomotive.route": "방문:", "screen.littlelogistics.locomotive.on": "엔진 시동", "screen.littlelogistics.locomotive.off": "엔진 정지", - + "screen.littlelogistics.locomotive.register": "Register", + "screen.littlelogistics.locomotive.registration": "Registration", + "screen.littlelogistics.locomotive.register_info": "Registered vehicles can travel without chunkloaders", + "screen.littlelogistics.locomotive.frozen": "As per server config, this vehicle is frozen as the owner is offline", + + "global.littlelogistics.locomotive.register_success": "Maximum number of registered vehicles reached: %s", + "global.littlelogistics.locomotive.register_fail": "Successfully registered the vehicle, vehicles registered: %s/%s", + + "global.littlelogistics.no_connected_inventory_barge": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Barge.", + "global.littlelogistics.no_connected_inventory_car": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Car.", + "global.littlelogistics.connected_inventory": "This barge has %s connected inventories", + "item.littlelogistics.tug_route.description": "경로 끝에 노드를 추가하려면 우클릭하고 제거하려면 동일한 위치를 우클릭합니다. 쉬프트 우클릭으로 메뉴를 불러옵니다.", "item.littlelogistics.tug_route.num_nodes": "경로 노드 수: %s", "item.littlelogistics.tug_route.added": "추가한 경로 노드 X:%s Z:%s", @@ -77,12 +87,14 @@ "item.littlelogistics.tug_route.node": "%s. 노드", "item.littlelogistics.tug_route.node_named": "%s. %s", "item.littlelogistics.tug_route.node_line": "노드 %s: %s, %s", - + + "item.littlelogistics.conductors_wrench.description": "Can be used to rotate vanilla rails and configure Little Logistics blocks.", + "item.littlelogistics.locomotive_route.description": "레일을 우클릭하여 경로에 추가 또는 제거합니다.", "item.littlelogistics.locomotive_route.num_nodes": "경로 노드: %s", "item.littlelogistics.locomotive_route.added": "추가한 경로 노드 X:%s Y:%s Z:%s", "item.littlelogistics.locomotive_route.removed": "제거한 경로 노드 X:%s Y:%s Z:%s", - + "item.littlelogistics.spring.description": "탈것을 연결하는 데 사용합니다.", "item.littlelogistics.spring.notToSelf": "탈것을 자신에 연결할 수는 없습니다.", "item.littlelogistics.spring.noTwoTugs": "두 예인선을 연결할 수는 없습니다.", @@ -91,16 +103,16 @@ "item.littlelogistics.spring.noLoops": "달것으로 고리를 만들 수는 없습니다.", "item.littlelogistics.spring.badTypes": "이 유형의 탈것들을 함께 연결할 수는 없습니다!", "item.littlelogistics.fishing_barge.description": "최상의 수확량을 위해 깊고 개방된 수역의 장거리 경로에서 사용하세요.", - + "item.littlelogistics.creative_capacitor": "크리에이티브 축전기", - + "block.littlelogistics.vessel_charger.capacity": "%s/%s FE", "block.littlelogistics.fluid_hopper.capacity": "%s %s/%s mB", "block.littlelogistics.fluid_hopper.capacity_empty": "비었음 0/%s mB", "entity.littlelogistics.fluid_barge.capacity": "%s %s/%s mB", "entity.littlelogistics.fluid_barge.capacity_empty": "비었음 0/%s mB", - + "subtitle.littlelogistics.steam_tug_whistle": "증기 예인선이 기적을 울림", "subtitle.littlelogistics.tug_docking": "예인선이 도킹함", "subtitle.littlelogistics.tug_undocking": "예인선이 도킹을 해제함" - } +} \ No newline at end of file diff --git a/src/main/resources/assets/littlelogistics/lang/nl_nl.json b/src/main/resources/assets/littlelogistics/lang/nl_nl.json index 01025ae4..8af6ef10 100644 --- a/src/main/resources/assets/littlelogistics/lang/nl_nl.json +++ b/src/main/resources/assets/littlelogistics/lang/nl_nl.json @@ -6,6 +6,7 @@ "item.littlelogistics.fishing_barge": "Auto-Vis Sleepaak", "item.littlelogistics.spring": "Sleepkabel", "item.littlelogistics.tug_route": "Sleepboot Route", + "item.littlelogistics.locomotive_route": "Locomotive Route", "item.littlelogistics.energy_tug": "Elektrische Sleepboot", "item.littlelogistics.fluid_barge": "Sleepaak met Vloeistof Tank", "item.littlelogistics.fluid_car": "Wagon met Vloeistof Tank", @@ -15,6 +16,10 @@ "item.littlelogistics.steam_locomotive": "Stoomlocomotief", "item.littlelogistics.energy_locomotive": "Elektrische Locomotief", + "item.littlelogistics.receiver_component": "Wireless Receiver Component", + "item.littlelogistics.transmitter_component": "Wireless Transmitter Component", + "item.littlelogistics.conductors_wrench": "Conductor's Wrench", + "entity.littlelogistics.tug": "Stoom Sleepboot", "entity.littlelogistics.barge": "Sleepaak met Kist", "entity.littlelogistics.chunk_loader_barge": "Sleepaak met Chunk Lader", @@ -38,8 +43,14 @@ "block.littlelogistics.fluid_hopper": "Vloeistof Trechter", "block.littlelogistics.rapid_hopper": "Snelle Trechter", "block.littlelogistics.vessel_detector": "Vaartuig Detector", + "block.littlelogistics.junction_rail": "Wissel", "block.littlelogistics.switch_rail": "Spoorwegknooppunt", + "block.littlelogistics.automatic_switch_rail": "Automatic Switch Rail", + "block.littlelogistics.tee_junction_rail": "T-Junction Rail", + "block.littlelogistics.automatic_tee_junction_rail": "Automatic T-Junction Rail", + "block.littlelogistics.locomotive_dock_rail": "Locomotive Docking Rail", + "block.littlelogistics.car_dock_rail": "Train Car Docking Rail", "screen.littlelogistics.tug": "Stoom Sleepboot", "screen.littlelogistics.fishing_barge": "Auto-Vis Sleepaak", @@ -51,10 +62,24 @@ "screen.littlelogistics.tug_route.up_button": "Verplaats Tussenstop omhoog", "screen.littlelogistics.tug_route.down_button": "Verplaats Tussenstop omlaag", "screen.littlelogistics.tug_route.delete_button": "Verwijder Tussenstop", - "screen.littlelogistics.tug_route.rename": "%s Hernoemen", "screen.littlelogistics.tug_route.confirm": "Opslaan", + "screen.littlelogistics.locomotive.route": "Visited:", + "screen.littlelogistics.locomotive.on": "Start Engine", + "screen.littlelogistics.locomotive.off": "Halt Engine", + "screen.littlelogistics.locomotive.register": "Register", + "screen.littlelogistics.locomotive.registration": "Registration", + "screen.littlelogistics.locomotive.register_info": "Registered vehicles can travel without chunkloaders", + "screen.littlelogistics.locomotive.frozen": "As per server config, this vehicle is frozen as the owner is offline", + + "global.littlelogistics.locomotive.register_success": "Maximum number of registered vehicles reached: %s", + "global.littlelogistics.locomotive.register_fail": "Successfully registered the vehicle, vehicles registered: %s/%s", + + "global.littlelogistics.no_connected_inventory_barge": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Barge.", + "global.littlelogistics.no_connected_inventory_car": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Car.", + "global.littlelogistics.connected_inventory": "This barge has %s connected inventories", + "item.littlelogistics.tug_route.description": "Rechter muisklik om een tussenstop toe te voegen aan het einde van de route, rechter muisklik op dezelfde plek om deze te verwijderen. Shift rechter muisklik om menu te openen.", "item.littlelogistics.tug_route.num_nodes": "Route Tussenstops: %s", "item.littlelogistics.tug_route.added": "Tussenstop Toegevoegd X:%s Z:%s", @@ -62,9 +87,18 @@ "item.littlelogistics.tug_route.node": "%s. Tussenstop ", "item.littlelogistics.tug_route.node_named": "%s. %s", "item.littlelogistics.tug_route.node_line": "Tussenstop %s: %s, %s", + + "item.littlelogistics.conductors_wrench.description": "Can be used to rotate vanilla rails and configure Little Logistics blocks.", + + "item.littlelogistics.locomotive_route.description": "Right click on a rail to add or remove it from the route.", + "item.littlelogistics.locomotive_route.num_nodes": "Route Nodes: %s", + "item.littlelogistics.locomotive_route.added": "Added Route Node X:%s Y:%s Z:%s", + "item.littlelogistics.locomotive_route.removed": "Removed Route Node X:%s Y:%s Z:%s", + "item.littlelogistics.spring.description": "Wordt gebruikt om sleepaken/sleepboten te koppelen", "item.littlelogistics.spring.notToSelf": "Kan vaartuig niet aan zichzelf koppelen", "item.littlelogistics.spring.noTwoTugs": "Kan geen twee sleepboten koppelen", + "item.littlelogistics.spring.noTwoLoco": "Can't link two locomotives", "item.littlelogistics.spring.tooFar": "Vaartuigen te ver weg om te koppelen", "item.littlelogistics.spring.noLoops": "Kan vaartuigen niet in een lus koppelen", "item.littlelogistics.spring.badTypes": "Kan deze types vaartuigen niet koppelen!", @@ -80,5 +114,5 @@ "subtitle.littlelogistics.steam_tug_whistle": "Stoom Sleeboot fluit", "subtitle.littlelogistics.tug_docking": "Sleepboot meert aan", - "subtitle.littlelogistics.tug_undocking": "Sleepboot meert af" -} + "subtitle.littlelogistics.tug_undocking": "Sleepboot meert af" +} \ No newline at end of file diff --git a/src/main/resources/assets/littlelogistics/lang/zh_cn.json b/src/main/resources/assets/littlelogistics/lang/zh_cn.json index 5327fab3..e17e39d8 100644 --- a/src/main/resources/assets/littlelogistics/lang/zh_cn.json +++ b/src/main/resources/assets/littlelogistics/lang/zh_cn.json @@ -68,6 +68,17 @@ "screen.littlelogistics.locomotive.route": "已到访:", "screen.littlelogistics.locomotive.on": "启动发动机", "screen.littlelogistics.locomotive.off": "停止发动机", + "screen.littlelogistics.locomotive.register": "Register", + "screen.littlelogistics.locomotive.registration": "Registration", + "screen.littlelogistics.locomotive.register_info": "Registered vehicles can travel without chunkloaders", + "screen.littlelogistics.locomotive.frozen": "As per server config, this vehicle is frozen as the owner is offline", + + "global.littlelogistics.locomotive.register_success": "Maximum number of registered vehicles reached: %s", + "global.littlelogistics.locomotive.register_fail": "Successfully registered the vehicle, vehicles registered: %s/%s", + + "global.littlelogistics.no_connected_inventory_barge": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Barge.", + "global.littlelogistics.no_connected_inventory_car": "This barge requires a connected inventory behind it but none was provided. Link additional barges that provide inventory behind this one, such as a Chest Car.", + "global.littlelogistics.connected_inventory": "This barge has %s connected inventories", "item.littlelogistics.tug_route.description": "右击在线路末尾添加节点,再次右击同一位置可删除。潜行右击打开菜单。", "item.littlelogistics.tug_route.num_nodes": "线路节点:%s", @@ -77,6 +88,8 @@ "item.littlelogistics.tug_route.node_named": "%s. %s", "item.littlelogistics.tug_route.node_line": "节点%s:%s, %s", + "item.littlelogistics.conductors_wrench.description": "Can be used to rotate vanilla rails and configure Little Logistics blocks.", + "item.littlelogistics.locomotive_route.description": "右击铁轨来在线路上添加或移除。", "item.littlelogistics.locomotive_route.num_nodes": "线路节点:%s", "item.littlelogistics.locomotive_route.added": "已添加线路节点 X:%s Y:%s Z:%s", @@ -102,4 +115,4 @@ "subtitle.littlelogistics.steam_tug_whistle": "蒸汽拖船鸣笛", "subtitle.littlelogistics.tug_docking": "拖船入港", "subtitle.littlelogistics.tug_undocking": "拖船出港" -} +} \ No newline at end of file diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/categories/blocks.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/categories/blocks.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/categories/blocks.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/categories/blocks.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/categories/items.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/categories/items.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/categories/items.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/categories/items.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/categories/trains.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/categories/trains.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/categories/trains.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/categories/trains.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/categories/vessels.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/categories/vessels.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/categories/vessels.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/categories/vessels.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/auto_switch_rails.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/auto_switch_rails.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/auto_switch_rails.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/auto_switch_rails.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chest_barge.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/chest_barge.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chest_barge.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/chest_barge.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chest_car.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/chest_car.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chest_car.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/chest_car.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/docking_rails.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/docking_rails.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/docking_rails.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/docking_rails.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/docks.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/docks.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/docks.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/docks.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/energy_locomotive.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/energy_locomotive.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/energy_locomotive.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/energy_locomotive.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/energy_tug.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/energy_tug.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/energy_tug.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/energy_tug.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/fishing_barge.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/fishing_barge.json similarity index 79% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/fishing_barge.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/fishing_barge.json index 9e9a2123..91bf5d58 100644 --- a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/fishing_barge.json +++ b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/fishing_barge.json @@ -13,7 +13,7 @@ { "type": "patchouli:crafting", "recipe": "littlelogistics:fishing_barge", - "text": "Needs to be in open water for nets to be deployed. Use on long routes in open oceans to avoid \"shallow water\" and \"overfishing\" penalties." + "text": "Needs to be in open water for nets to be deployed. Use on long routes in open oceans to avoid \"shallow water\" and \"overfishing\" penalties. Connect a Chest Barge behind the Auto-Fishing Barge, as the Auto-Fishing Barge does not provide an inventory of its own." } ] } \ No newline at end of file diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/fluid_barge.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/fluid_barge.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/fluid_barge.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/fluid_barge.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/fluid_car.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/fluid_car.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/fluid_car.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/fluid_car.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/fluid_hopper.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/fluid_hopper.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/fluid_hopper.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/fluid_hopper.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/loco_route.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/loco_route.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/loco_route.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/loco_route.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/rapid_hopper.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/rapid_hopper.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/rapid_hopper.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/rapid_hopper.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/seater_barge.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/seater_barge.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/seater_barge.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/seater_barge.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/spring.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/spring.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/spring.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/spring.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/steam_locomotive.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/steam_locomotive.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/steam_locomotive.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/steam_locomotive.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/steam_tug.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/steam_tug.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/steam_tug.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/steam_tug.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/switch_rails.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/switch_rails.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/switch_rails.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/switch_rails.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/train_car.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/train_car.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/train_car.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/train_car.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/tug_guide_rail.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/tug_guide_rail.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/tug_guide_rail.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/tug_guide_rail.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/tug_route.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/tug_route.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/tug_route.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/tug_route.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/vessel_charger.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/vessel_charger.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/vessel_charger.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/vessel_charger.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/vessel_corner_rail.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/vessel_corner_rail.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/vessel_corner_rail.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/vessel_corner_rail.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/vessel_detector.json b/src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/vessel_detector.json similarity index 100% rename from src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/vessel_detector.json rename to src/main/resources/assets/littlelogistics/patchouli_books/guide/en_us/entries/vessel_detector.json diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/book.json b/src/main/resources/data/littlelogistics/patchouli_books/guide/book.json index bffe99ed..23142983 100644 --- a/src/main/resources/data/littlelogistics/patchouli_books/guide/book.json +++ b/src/main/resources/data/littlelogistics/patchouli_books/guide/book.json @@ -6,5 +6,6 @@ "show_toasts ": false, "show_progress": false, "book_texture": "patchouli:textures/gui/book_red.png", - "model": "littlelogistics:book" + "model": "littlelogistics:book", + "use_resource_pack": true } \ No newline at end of file diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chunk_loader_barge.json b/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chunk_loader_barge.json deleted file mode 100644 index 3615f4ac..00000000 --- a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chunk_loader_barge.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "Chunk Loader Barge", - "icon": "littlelogistics:chunk_loader_barge", - "category": "littlelogistics:vessels", - "pages": [ - { - "type": "patchouli:entity", - "entity": "littlelogistics:chunk_loader_barge", - "scale": 0.6, - "offset": 0.5, - "text": "This barge keeps 3x3 area of chunks, centered on the entity, loaded." - }, - { - "type": "patchouli:crafting", - "recipe": "littlelogistics:chunk_loader_barge", - "text": "Recommended for long-distance routes. Vehicles will try to stop of partially loaded." - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chunk_loader_car.json b/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chunk_loader_car.json deleted file mode 100644 index bf793e2e..00000000 --- a/src/main/resources/data/littlelogistics/patchouli_books/guide/en_us/entries/chunk_loader_car.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "Chunk Loader Car", - "icon": "littlelogistics:chunk_loader_car", - "category": "littlelogistics:trains", - "pages": [ - { - "type": "patchouli:entity", - "entity": "littlelogistics:chunk_loader_car", - "scale": 0.6, - "offset": 0.5, - "text": "This train car keeps 3x3 area of chunks, centered on the entity, loaded." - }, - { - "type": "patchouli:crafting", - "recipe": "littlelogistics:chunk_loader_car", - "text": "Recommended for long-distance routes, may need multiple. Vehicles will try to stop of partially loaded." - } - ] -} \ No newline at end of file