diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index f5be1ff95..e738b7b55 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.20.4 2024-03-11T22:16:44.4386235 Recipes +// 1.20.4 2024-03-11T17:51:04.4103588 Recipes 4d3128b37a7153882a9324cda49b5069207561c5 data/actuallyadditions/recipes/atomic_reconstructor.json b0367f5012651764931e8b8fd0c5bcca4e8614c0 data/actuallyadditions/recipes/battery_box.json 7e05cd54092b998dfdbd2221235dd52576ec79eb data/actuallyadditions/recipes/black_quartz_block.json @@ -51,6 +51,11 @@ ff81da8a0f6632779414c0512100696a11771814 data/actuallyadditions/recipes/hopping_ 76f9eb2b859198eec4c50d992c3715633d5109a8 data/actuallyadditions/recipes/lava_factory_controller.json 1e3936f80be1540cd3d6ed570c1ed6381227db7d data/actuallyadditions/recipes/leaf_generator.json 73696fd4e851f440a9850485fc9ad03fc63442a9 data/actuallyadditions/recipes/oil_generator.json +afbee3f7074b7aa88d4bc8941d820d02b827da4b data/actuallyadditions/recipes/phantom_booster.json +f0a9c8a0de8fb884cd207c34c4a10e7a4a021153 data/actuallyadditions/recipes/phantom_energyface.json +472521d8bb5db8f9165ac642c3309d2d2b48f8e6 data/actuallyadditions/recipes/phantom_itemface.json +6d3aa070e0fccbb126c80323423c9482259dd6de data/actuallyadditions/recipes/phantom_liquiface.json +253e31ad471e2a8e20bfbe077826a8fac35fcc84 data/actuallyadditions/recipes/phantom_redstoneface.json 8c78ebb9351b98ffe368391a391b90385c0b8b7f data/actuallyadditions/recipes/placer.json 184acfb5fd3799b3fbe35150c67b6530581f8bf1 data/actuallyadditions/recipes/powered_furnace.json b81a706a5f635d8a63ffd3034c80838dc10699c9 data/actuallyadditions/recipes/ranged_collector.json diff --git a/src/generated/resources/data/actuallyadditions/recipes/phantom_booster.json b/src/generated/resources/data/actuallyadditions/recipes/phantom_booster.json new file mode 100644 index 000000000..364247105 --- /dev/null +++ b/src/generated/resources/data/actuallyadditions/recipes/phantom_booster.json @@ -0,0 +1,23 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "actuallyadditions:ender_casing" + }, + "D": { + "item": "actuallyadditions:diamatine_crystal" + }, + "R": { + "item": "actuallyadditions:restonia_crystal" + } + }, + "pattern": [ + "RDR", + "DCD", + "RDR" + ], + "result": { + "item": "actuallyadditions:phantom_booster" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/actuallyadditions/recipes/phantom_energyface.json b/src/generated/resources/data/actuallyadditions/recipes/phantom_energyface.json new file mode 100644 index 000000000..1abd13906 --- /dev/null +++ b/src/generated/resources/data/actuallyadditions/recipes/phantom_energyface.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "I": { + "item": "actuallyadditions:phantom_itemface" + }, + "R": { + "item": "actuallyadditions:empowered_restonia_crystal" + } + }, + "pattern": [ + " R ", + "RIR", + " R " + ], + "result": { + "item": "actuallyadditions:phantom_energyface" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/actuallyadditions/recipes/phantom_itemface.json b/src/generated/resources/data/actuallyadditions/recipes/phantom_itemface.json new file mode 100644 index 000000000..f03f66462 --- /dev/null +++ b/src/generated/resources/data/actuallyadditions/recipes/phantom_itemface.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "A": { + "item": "actuallyadditions:advanced_coil" + }, + "C": { + "tag": "forge:chests/wooden" + }, + "D": { + "item": "actuallyadditions:empowered_diamatine_crystal" + }, + "E": { + "item": "actuallyadditions:ender_casing" + } + }, + "pattern": [ + " C ", + "DED", + " A " + ], + "result": { + "item": "actuallyadditions:phantom_itemface" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/actuallyadditions/recipes/phantom_liquiface.json b/src/generated/resources/data/actuallyadditions/recipes/phantom_liquiface.json new file mode 100644 index 000000000..ac513a3f0 --- /dev/null +++ b/src/generated/resources/data/actuallyadditions/recipes/phantom_liquiface.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "item": "minecraft:bucket" + }, + "I": { + "item": "actuallyadditions:phantom_itemface" + } + }, + "pattern": [ + "BIB" + ], + "result": { + "item": "actuallyadditions:phantom_liquiface" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/actuallyadditions/recipes/phantom_redstoneface.json b/src/generated/resources/data/actuallyadditions/recipes/phantom_redstoneface.json new file mode 100644 index 000000000..baacb9438 --- /dev/null +++ b/src/generated/resources/data/actuallyadditions/recipes/phantom_redstoneface.json @@ -0,0 +1,23 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:dusts/redstone" + }, + "I": { + "item": "actuallyadditions:phantom_itemface" + }, + "R": { + "item": "actuallyadditions:empowered_restonia_crystal" + } + }, + "pattern": [ + "DRD", + "RIR", + "DRD" + ], + "result": { + "item": "actuallyadditions:phantom_redstoneface" + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java index e0545d488..da21d7960 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java @@ -409,6 +409,45 @@ public class BlockRecipeGenerator extends RecipeProvider { .define('L', ItemTags.LEAVES) .define('A', ActuallyItems.ADVANCED_COIL.get()) .save(recipeOutput); + + // Phantom Itemface + Recipe.shaped(ActuallyBlocks.PHANTOM_ITEMFACE.getItem()) + .pattern(" C ", "DED", " A ") + .define('C', Tags.Items.CHESTS_WOODEN) + .define('D', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL) + .define('E', ActuallyBlocks.ENDER_CASING.get()) + .define('A', ActuallyItems.ADVANCED_COIL.get()) + .save(recipeOutput); + + // Phantom Liquiface + Recipe.shaped(ActuallyBlocks.PHANTOM_LIQUIFACE.getItem()) + .pattern("BIB") + .define('B', Items.BUCKET) + .define('I', ActuallyBlocks.PHANTOM_ITEMFACE.get()) + .save(recipeOutput); + + // Phantom Energyface + Recipe.shaped(ActuallyBlocks.PHANTOM_ENERGYFACE.getItem()) + .pattern(" R ", "RIR", " R ") + .define('R', ActuallyItems.EMPOWERED_RESTONIA_CRYSTAL) + .define('I', ActuallyBlocks.PHANTOM_ITEMFACE.get()) + .save(recipeOutput); + + // Phantom Redstoneface + Recipe.shaped(ActuallyBlocks.PHANTOM_REDSTONEFACE.getItem()) + .pattern("DRD", "RIR", "DRD") + .define('D', Tags.Items.DUSTS_REDSTONE) + .define('R', ActuallyItems.EMPOWERED_RESTONIA_CRYSTAL) + .define('I', ActuallyBlocks.PHANTOM_ITEMFACE.get()) + .save(recipeOutput); + + // Phantom Booster + Recipe.shaped(ActuallyBlocks.PHANTOM_BOOSTER.getItem()) + .pattern("RDR", "DCD", "RDR") + .define('D', ActuallyItems.DIAMATINE_CRYSTAL) + .define('R', ActuallyItems.RESTONIA_CRYSTAL) + .define('C', ActuallyBlocks.ENDER_CASING.getItem()) + .save(recipeOutput); } public static class Recipe { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java index 71222c525..f5b3434dc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java @@ -48,7 +48,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityLavaFactoryController; import de.ellpeck.actuallyadditions.mod.tile.TileEntityLeafGenerator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBooster; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBreaker; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomEnergyface; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomItemface; @@ -231,8 +230,8 @@ public final class ActuallyBlocks { (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomRedstoneface::new); public static final AABlockReg PHANTOM_BREAKER = new AABlockReg<>("phantom_breaker", () -> new BlockPhantom(BlockPhantom.Type.BREAKER), (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBreaker::new); - public static final AABlockReg PHANTOM_BOOSTER = new AABlockReg<>("phantom_booster", BlockPhantomBooster::new, - (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBooster::new); + public static final AABlockReg PHANTOM_BOOSTER = new AABlockReg<>("phantom_booster", BlockPhantomBooster::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties)); // Misc Tiles public static final AABlockReg BATTERY_BOX = new AABlockReg<>("battery_box", BlockBatteryBox::new, @@ -376,7 +375,6 @@ public final class ActuallyBlocks { PHANTOM_ENERGYFACE.getTileEntityType(), PHANTOM_REDSTONEFACE.getTileEntityType(), PHANTOM_BREAKER.getTileEntityType(), - PHANTOM_BOOSTER.getTileEntityType(), BATTERY_BOX.getTileEntityType(), FIREWORK_BOX.getTileEntityType(), SHOCK_SUPPRESSOR.getTileEntityType(), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java index 27a981791..ede38df75 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java @@ -14,19 +14,17 @@ import com.mojang.blaze3d.platform.Window; import de.ellpeck.actuallyadditions.api.tile.IPhantomTile; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBreaker; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomEnergyface; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomItemface; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomLiquiface; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomRedstoneface; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import de.ellpeck.actuallyadditions.mod.tile.*; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.resources.language.I18n; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.FormattedText; +import net.minecraft.util.FormattedCharSequence; import net.minecraft.util.Mth; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -156,27 +154,37 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay { BlockEntity tile = minecraft.level.getBlockEntity(pos); if (tile != null) { if (tile instanceof IPhantomTile phantom) { - guiGraphics.drawString(minecraft.font, ChatFormatting.GOLD + I18n.get("tooltip." + ActuallyAdditions.MODID + ".blockPhantomRange.desc") + ": " + phantom.getRange(), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 40, ChatFormatting.WHITE.getColor()); + guiGraphics.drawString(minecraft.font, ChatFormatting.GOLD + I18n.get("tooltip." + ActuallyAdditions.MODID + ".blockPhantomRange.desc") + ": " + phantom.getRange(), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 40, ChatFormatting.WHITE.getColor()); if (phantom.hasBoundPosition()) { int distance = Mth.ceil(new Vec3(pos.getX(), pos.getY(), pos.getZ()).distanceTo(new Vec3(phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ()))); BlockState state = minecraft.level.getBlockState(phantom.getBoundPosition()); Block block = state.getBlock(); Item item = Item.byBlock(block); String name = item.getName(new ItemStack(block)).getString(); - StringUtil.drawSplitString(minecraft.font, StringUtil.localizeFormatted("tooltip." + ActuallyAdditions.MODID + ".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 30, 200, 0xFFFFFF, true); + drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 30, 200, 0xFFFFFF, true); if (phantom.isBoundThingInRange()) { - StringUtil.drawSplitString(minecraft.font, ChatFormatting.DARK_GREEN + I18n.get("tooltip." + ActuallyAdditions.MODID + ".phantom.connectedRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true); + //StringUtil.drawSplitString(minecraft.font, ChatFormatting.DARK_GREEN + I18n.get("tooltip.actuallyadditions.phantom.connectedRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true); + drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.connectedRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true); } else { - StringUtil.drawSplitString(minecraft.font, ChatFormatting.DARK_RED + I18n.get("tooltip." + ActuallyAdditions.MODID + ".phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true); + //StringUtil.drawSplitString(minecraft.font, ChatFormatting.DARK_RED + I18n.get("tooltip.actuallyadditions.phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true); + drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true); } } else { - guiGraphics.drawString(minecraft.font, ChatFormatting.RED + I18n.get("tooltip." + ActuallyAdditions.MODID + ".phantom.notConnected.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, ChatFormatting.WHITE.getColor()); + guiGraphics.drawString(minecraft.font, ChatFormatting.RED + I18n.get("tooltip.actuallyadditions.phantom.notConnected.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, ChatFormatting.WHITE.getColor()); } } } } + @OnlyIn(Dist.CLIENT) + public static void drawWordWrap(GuiGraphics gg, Font font, FormattedText text, int x, int y, int width, int color, boolean shadow) { + for (FormattedCharSequence line : font.split(text, width)) { + gg.drawString(font, line, x, y, color, shadow); + y += font.lineHeight; + } + } + public enum Type { ITEMFACE, PLACER, diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java index 0e6f1e6b1..c2d330e94 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java @@ -10,33 +10,21 @@ package de.ellpeck.actuallyadditions.mod.blocks; -import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBooster; -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityTicker; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.shapes.CollisionContext; -import net.minecraft.world.phys.shapes.VoxelShape; +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; -import javax.annotation.Nullable; - -public class BlockPhantomBooster extends BlockContainerBase { +public class BlockPhantomBooster extends BlockBase { public BlockPhantomBooster() { super(ActuallyBlocks.defaultPickProps()); } - @Nullable +/* @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { return new TileEntityPhantomBooster(pos, state); - } + }*/ - @Nullable +/* @Nullable @Override public BlockEntityTicker getTicker(Level level, BlockState blockState, BlockEntityType entityType) { return level.isClientSide? TileEntityPhantomBooster::clientTick : TileEntityPhantomBooster::serverTick; @@ -45,5 +33,5 @@ public class BlockPhantomBooster extends BlockContainerBase { @Override public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) { return VoxelShapes.BOOSTER_SHAPE; - } + }*/ } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBooster.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBooster.java index 6f1f2deb1..758cf2891 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBooster.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBooster.java @@ -6,7 +6,8 @@ * View the source code at https://github.com/Ellpeck/ActuallyAdditions * * © 2015-2017 Ellpeck - */ + *//* + package de.ellpeck.actuallyadditions.mod.tile; @@ -34,3 +35,4 @@ public class TileEntityPhantomBooster extends TileEntityBase { } } } +*/ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java index 88eebcb9d..53969cdfc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java @@ -16,12 +16,14 @@ import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; +import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.capabilities.ICapabilityInvalidationListener; public abstract class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile { public static final int RANGE = 16; @@ -32,6 +34,7 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl private BlockPos boundPosBefore; private Block boundBlockBefore; private int lastStrength; + private CapListener capListener = new CapListener(this); public TileEntityPhantomface(BlockEntityType type, BlockPos pos, BlockState state) { super(type, pos, state, 0); @@ -48,6 +51,7 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl break; } } + return newRange; } @@ -90,6 +94,13 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl if (this.doesNeedUpdateSend()) { this.onUpdateSent(); + + if (level instanceof ServerLevel serverLevel) { + capListener.disable(); + capListener = new CapListener(this); + if (hasBoundPosition()) + serverLevel.registerCapabilityListener(boundPosition, capListener); + } } int strength = this.getComparatorStrength(); @@ -122,7 +133,6 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl if (this.boundPosition != null) { this.level.updateNeighborsAt(this.worldPosition, this.level.getBlockState(this.boundPosition).getBlock()); } - this.sendUpdate(); this.setChanged(); } @@ -191,4 +201,25 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl } return 0; } + + public class CapListener implements ICapabilityInvalidationListener { + private boolean valid = true; + private final TileEntityPhantomface tile; + + public CapListener(TileEntityPhantomface tile) { + this.tile = tile; + } + + public void disable() { + valid = false; + } + @Override + public boolean onInvalidate() { + if (valid && !tile.isRemoved()) { + tile.invalidateCapabilities(); + return true; + } + return false; + } + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java index ced2ec537..433721f35 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java @@ -29,6 +29,7 @@ public final class StringUtil { } // TODO: Move to official + @Deprecated @OnlyIn(Dist.CLIENT) public static void drawSplitString(Font renderer, String strg, int x, int y, int width, int color, boolean shadow) { // ResourcePackList <- holds the correct way diff --git a/src/main/resources/assets/actuallyadditions/lang/en_us.json b/src/main/resources/assets/actuallyadditions/lang/en_us.json index 76fdcb64b..515ac0437 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_us.json +++ b/src/main/resources/assets/actuallyadditions/lang/en_us.json @@ -135,18 +135,18 @@ "block.actuallyadditions.lamp_pink": "Pink Lamp", "block.actuallyadditions.lamp_cyan": "Cyan Lamp", "block.actuallyadditions.lamp_purple": "Purple Lamp", - "block.actuallyadditions.phantom_itemface": "Phantom Itemface (wip)", + "block.actuallyadditions.phantom_itemface": "Phantom Itemface", "block.actuallyadditions.player_interface": "Player Interface (wip)", - "block.actuallyadditions.phantom_energyface": "Phantom Energyface (wip)", - "block.actuallyadditions.phantom_redstoneface": "Phantom Redstoneface (wip)", - "block.actuallyadditions.phantom_liquiface": "Phantom Liquiface (wip)", + "block.actuallyadditions.phantom_energyface": "Phantom Energyface", + "block.actuallyadditions.phantom_redstoneface": "Phantom Redstoneface", + "block.actuallyadditions.phantom_liquiface": "Phantom Liquiface", "block.actuallyadditions.phantom_placer": "Phantom Placer (wip)", "block.actuallyadditions.phantom_breaker": "Phantom Breaker (wip)", "block.actuallyadditions.lava_factory_controller": "Lava Factory Controller", "block.actuallyadditions.lava_factory_casing": "Lava Casing", "block.actuallyadditions.fluid_placer": "Fluid Placer", "block.actuallyadditions.fluid_collector": "Fluid Collector", - "block.actuallyadditions.phantom_booster": "Phantom Booster (wip)", + "block.actuallyadditions.phantom_booster": "Phantom Booster", "block.actuallyadditions.coffee": "Coffee Plant", "block.actuallyadditions.ethetic_green_block": "Ethetic Green Quartz", "block.actuallyadditions.ethetic_white_block": "Ethetic Quartz", @@ -299,7 +299,7 @@ "item.actuallyadditions.gold_aiot": "Golden AIOT (wip)", "item.actuallyadditions.diamond_aiot": "Diamond AIOT (wip)", "item.actuallyadditions.netherite_aiot": "Netherite AIOT (wip)", - "item.actuallyadditions.phantom_connector": "Phantom Connector (wip)", + "item.actuallyadditions.phantom_connector": "Phantom Connector", "item.actuallyadditions.empty_cup": "Empty Cup", "item.actuallyadditions.coffee_cup": "Cup with Coffee", "item.actuallyadditions.coffee_seeds": "Coffee Seeds",