Compare commits

..

No commits in common. "ccfb8d162d05fd1adcdaa8eb51022dc374a3c89b" and "786d9d330261668292d4135b65f1e1219b99bb78" have entirely different histories.

20 changed files with 118 additions and 171 deletions

View file

@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
# Actually Additions # Actually Additions
mod_version=1.2.11 mod_version=1.2.10
# Forge # Forge
game_version=1.20.4 game_version=1.20.4
@ -19,5 +19,5 @@ neogradle.subsystems.parchment.mappingsVersion=2024.02.25
# Other mods # Other mods
jei_version=17.3.0.49 jei_version=17.3.0.49
patchouli_version=1.20.4-85-NEOFORGE patchouli_version=1.20.4-85-NEOFORGE-SNAPSHOT
patchouli_provider_version=1.20.4-1.0.10-Snapshot.7 patchouli_provider_version=1.20.4-1.0.10-Snapshot.6

View file

@ -1,4 +1,4 @@
// 1.20.4 2024-04-28T16:44:33.1316406 Loot Tables // 1.20.4 2024-03-11T19:15:36.5038055 Loot Tables
f6655bb234dbcf1041fe8ad95c976ddddda2b02a data/actuallyadditions/loot_tables/blocks/atomic_reconstructor.json f6655bb234dbcf1041fe8ad95c976ddddda2b02a data/actuallyadditions/loot_tables/blocks/atomic_reconstructor.json
e15c868b26b669c30365bfb93e7d9274e07df16d data/actuallyadditions/loot_tables/blocks/battery_box.json e15c868b26b669c30365bfb93e7d9274e07df16d data/actuallyadditions/loot_tables/blocks/battery_box.json
745d64af3b0203a138f9eca7de21ed4988b35c95 data/actuallyadditions/loot_tables/blocks/bio_reactor.json 745d64af3b0203a138f9eca7de21ed4988b35c95 data/actuallyadditions/loot_tables/blocks/bio_reactor.json
@ -25,7 +25,6 @@ b598ece027ef00e9ed0457a7f9542ebe8b89538c data/actuallyadditions/loot_tables/bloc
6416e24b52f6a361efa8c9955b20fdeb1c623d79 data/actuallyadditions/loot_tables/blocks/coal_generator.json 6416e24b52f6a361efa8c9955b20fdeb1c623d79 data/actuallyadditions/loot_tables/blocks/coal_generator.json
afab93747299dba6783292e5949ea7e0cd5d5b13 data/actuallyadditions/loot_tables/blocks/coffee.json afab93747299dba6783292e5949ea7e0cd5d5b13 data/actuallyadditions/loot_tables/blocks/coffee.json
ef604b6cc4ac21ee792ab7df41b77578b4d213db data/actuallyadditions/loot_tables/blocks/coffee_machine.json ef604b6cc4ac21ee792ab7df41b77578b4d213db data/actuallyadditions/loot_tables/blocks/coffee_machine.json
fa895b25a0816ca506f7031ec3861cfd4de04f28 data/actuallyadditions/loot_tables/blocks/crate_small.json
7767779372fd1929d1d818e00d8a3d869f2d4a87 data/actuallyadditions/loot_tables/blocks/crusher.json 7767779372fd1929d1d818e00d8a3d869f2d4a87 data/actuallyadditions/loot_tables/blocks/crusher.json
9f549621d659a42dcb71516dd1d97cb347611094 data/actuallyadditions/loot_tables/blocks/crusher_double.json 9f549621d659a42dcb71516dd1d97cb347611094 data/actuallyadditions/loot_tables/blocks/crusher_double.json
25b7a44418e2858552dd5150d67bffe1f30269a8 data/actuallyadditions/loot_tables/blocks/diamatine_crystal_block.json 25b7a44418e2858552dd5150d67bffe1f30269a8 data/actuallyadditions/loot_tables/blocks/diamatine_crystal_block.json

View file

@ -1,4 +1,4 @@
// 1.20.4 2024-04-28T16:44:33.1452594 Recipes // 1.20.4 2024-03-13T18:06:15.6143021 Recipes
4d3128b37a7153882a9324cda49b5069207561c5 data/actuallyadditions/recipes/atomic_reconstructor.json 4d3128b37a7153882a9324cda49b5069207561c5 data/actuallyadditions/recipes/atomic_reconstructor.json
b0367f5012651764931e8b8fd0c5bcca4e8614c0 data/actuallyadditions/recipes/battery_box.json b0367f5012651764931e8b8fd0c5bcca4e8614c0 data/actuallyadditions/recipes/battery_box.json
dba5d4a1a79489d5766fad32f912ab1a64618854 data/actuallyadditions/recipes/bio_reactor.json dba5d4a1a79489d5766fad32f912ab1a64618854 data/actuallyadditions/recipes/bio_reactor.json
@ -56,11 +56,9 @@ ff81da8a0f6632779414c0512100696a11771814 data/actuallyadditions/recipes/hopping_
11a57ce2eea04fed226a817a3995acd406bb2efb data/actuallyadditions/recipes/long_range_breaker.json 11a57ce2eea04fed226a817a3995acd406bb2efb data/actuallyadditions/recipes/long_range_breaker.json
73696fd4e851f440a9850485fc9ad03fc63442a9 data/actuallyadditions/recipes/oil_generator.json 73696fd4e851f440a9850485fc9ad03fc63442a9 data/actuallyadditions/recipes/oil_generator.json
afbee3f7074b7aa88d4bc8941d820d02b827da4b data/actuallyadditions/recipes/phantom_booster.json afbee3f7074b7aa88d4bc8941d820d02b827da4b data/actuallyadditions/recipes/phantom_booster.json
8dd44158b3b1780fa4479879262239294c45c37f data/actuallyadditions/recipes/phantom_breaker.json
f0a9c8a0de8fb884cd207c34c4a10e7a4a021153 data/actuallyadditions/recipes/phantom_energyface.json f0a9c8a0de8fb884cd207c34c4a10e7a4a021153 data/actuallyadditions/recipes/phantom_energyface.json
c7b65084e855bd7f083819ed9339320577510c6f data/actuallyadditions/recipes/phantom_itemface.json c7b65084e855bd7f083819ed9339320577510c6f data/actuallyadditions/recipes/phantom_itemface.json
6d3aa070e0fccbb126c80323423c9482259dd6de data/actuallyadditions/recipes/phantom_liquiface.json 6d3aa070e0fccbb126c80323423c9482259dd6de data/actuallyadditions/recipes/phantom_liquiface.json
bb11bd865cfdf6756e104ecc0d755772183b047f data/actuallyadditions/recipes/phantom_placer.json
253e31ad471e2a8e20bfbe077826a8fac35fcc84 data/actuallyadditions/recipes/phantom_redstoneface.json 253e31ad471e2a8e20bfbe077826a8fac35fcc84 data/actuallyadditions/recipes/phantom_redstoneface.json
8c78ebb9351b98ffe368391a391b90385c0b8b7f data/actuallyadditions/recipes/placer.json 8c78ebb9351b98ffe368391a391b90385c0b8b7f data/actuallyadditions/recipes/placer.json
981e7e91216504b421d069f72920499df052e64f data/actuallyadditions/recipes/player_interface.json 981e7e91216504b421d069f72920499df052e64f data/actuallyadditions/recipes/player_interface.json

View file

@ -1,4 +1,4 @@
// 1.20.4 2024-04-28T16:44:33.1387413 Item Models: actuallyadditions // 1.20.4 2024-04-09T17:25:30.7116661 Item Models: actuallyadditions
34463d3d2ae3fafaaea338e7ffc03cd139d3cfeb assets/actuallyadditions/models/item/advanced_coil.json 34463d3d2ae3fafaaea338e7ffc03cd139d3cfeb assets/actuallyadditions/models/item/advanced_coil.json
24594fc68e66011dc2d7b79b92c94b387e710318 assets/actuallyadditions/models/item/advanced_leaf_blower.json 24594fc68e66011dc2d7b79b92c94b387e710318 assets/actuallyadditions/models/item/advanced_leaf_blower.json
ba2d814e269cdef72e1045f200b3c20ed6961517 assets/actuallyadditions/models/item/atomic_reconstructor.json ba2d814e269cdef72e1045f200b3c20ed6961517 assets/actuallyadditions/models/item/atomic_reconstructor.json
@ -37,7 +37,6 @@ c73981382d646e4a0186b26fcfad817d39252055 assets/actuallyadditions/models/item/ch
a67f1795e1ad1d6ed19f2a35f176f39e00dbb9c3 assets/actuallyadditions/models/item/coffee_machine.json a67f1795e1ad1d6ed19f2a35f176f39e00dbb9c3 assets/actuallyadditions/models/item/coffee_machine.json
523148eac33929fb0d2892856a5ddcb784043bb5 assets/actuallyadditions/models/item/crafter_on_a_stick.json 523148eac33929fb0d2892856a5ddcb784043bb5 assets/actuallyadditions/models/item/crafter_on_a_stick.json
89cc79420e3a7c2952ce729537b7503a517bb9de assets/actuallyadditions/models/item/crate_keeper.json 89cc79420e3a7c2952ce729537b7503a517bb9de assets/actuallyadditions/models/item/crate_keeper.json
cfc7022ad26717b33c916d380435cc32ace34c0b assets/actuallyadditions/models/item/crate_small.json
9bc734dadf9d5b85b8cc5685b673a1d074cf3d6d assets/actuallyadditions/models/item/crusher.json 9bc734dadf9d5b85b8cc5685b673a1d074cf3d6d assets/actuallyadditions/models/item/crusher.json
4b7ef5dd15d930d4b0b5507cd08c27cb5ee1498a assets/actuallyadditions/models/item/crusher_double.json 4b7ef5dd15d930d4b0b5507cd08c27cb5ee1498a assets/actuallyadditions/models/item/crusher_double.json
91e18e2c5ae8f657b977865312e8cd7ee348d8f1 assets/actuallyadditions/models/item/crystallized_canola_seed.json 91e18e2c5ae8f657b977865312e8cd7ee348d8f1 assets/actuallyadditions/models/item/crystallized_canola_seed.json

View file

@ -1,3 +0,0 @@
{
"parent": "actuallyadditions:block/crate_small"
}

View file

@ -1,21 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "actuallyadditions:crate_small"
}
],
"rolls": 1.0
}
],
"random_sequence": "actuallyadditions:blocks/crate_small"
}

View file

@ -1,15 +0,0 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "actuallyadditions:breaker"
},
{
"item": "actuallyadditions:phantom_itemface"
}
],
"result": {
"item": "actuallyadditions:phantom_breaker"
}
}

View file

@ -1,15 +0,0 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "actuallyadditions:placer"
},
{
"item": "actuallyadditions:phantom_itemface"
}
],
"result": {
"item": "actuallyadditions:phantom_placer"
}
}

View file

@ -317,16 +317,6 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('F', ActuallyBlocks.BREAKER.get()) .define('F', ActuallyBlocks.BREAKER.get())
.save(recipeOutput); .save(recipeOutput);
// Phantom Placer
Recipe.shapeless(ActuallyBlocks.PHANTOM_PLACER.get())
.ingredients(ActuallyBlocks.PLACER.get(), ActuallyBlocks.PHANTOM_ITEMFACE.get())
.save(recipeOutput);
// Phantom Breaker
Recipe.shapeless(ActuallyBlocks.PHANTOM_BREAKER.get())
.ingredients(ActuallyBlocks.BREAKER.get(), ActuallyBlocks.PHANTOM_ITEMFACE.get())
.save(recipeOutput);
// Powered furnace. // Powered furnace.
Recipe.shaped(ActuallyBlocks.POWERED_FURNACE.getItem()) Recipe.shaped(ActuallyBlocks.POWERED_FURNACE.getItem())
.pattern("EXC", "FIF", "CXE") .pattern("EXC", "FIF", "CXE")

View file

@ -102,7 +102,6 @@ public class LootTableGenerator extends LootTableProvider {
this.dropSelf(ActuallyBlocks.BREAKER.get()); this.dropSelf(ActuallyBlocks.BREAKER.get());
this.dropSelf(ActuallyBlocks.PLACER.get()); this.dropSelf(ActuallyBlocks.PLACER.get());
this.dropSelf(ActuallyBlocks.DROPPER.get()); this.dropSelf(ActuallyBlocks.DROPPER.get());
this.dropSelf(ActuallyBlocks.CRATE_SMALL.get());
this.dropSelf(ActuallyBlocks.FLUID_PLACER.get()); this.dropSelf(ActuallyBlocks.FLUID_PLACER.get());
this.dropSelf(ActuallyBlocks.FLUID_COLLECTOR.get()); this.dropSelf(ActuallyBlocks.FLUID_COLLECTOR.get());
this.dropSelf(ActuallyBlocks.COFFEE_MACHINE.get()); this.dropSelf(ActuallyBlocks.COFFEE_MACHINE.get());

View file

@ -27,7 +27,6 @@ import net.minecraft.util.FormattedCharSequence;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResult;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -110,34 +109,40 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
@Nullable @Nullable
@Override @Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> entityType) { public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> entityType) {
return switch (this.type) { switch (this.type) {
case PLACER, BREAKER -> case PLACER:
level.isClientSide ? TileEntityPhantomPlacer::clientTick : TileEntityPhantomPlacer::serverTick; return level.isClientSide? TileEntityPhantomPlacer::clientTick : TileEntityPhantomPlacer::serverTick;
case LIQUIFACE -> case BREAKER:
level.isClientSide ? TileEntityPhantomLiquiface::clientTick : TileEntityPhantomLiquiface::serverTick; return level.isClientSide? TileEntityPhantomBreaker::clientTick : TileEntityPhantomBreaker::serverTick;
case ENERGYFACE -> case LIQUIFACE:
level.isClientSide ? TileEntityPhantomEnergyface::clientTick : TileEntityPhantomEnergyface::serverTick; return level.isClientSide? TileEntityPhantomLiquiface::clientTick : TileEntityPhantomLiquiface::serverTick;
case REDSTONEFACE -> case ENERGYFACE:
level.isClientSide ? TileEntityPhantomRedstoneface::clientTick : TileEntityPhantomRedstoneface::serverTick; return level.isClientSide? TileEntityPhantomEnergyface::clientTick : TileEntityPhantomEnergyface::serverTick;
default -> case REDSTONEFACE:
level.isClientSide ? TileEntityPhantomItemface::clientTick : TileEntityPhantomItemface::serverTick; return level.isClientSide? TileEntityPhantomRedstoneface::clientTick : TileEntityPhantomRedstoneface::serverTick;
}; default:
return level.isClientSide? TileEntityPhantomItemface::clientTick : TileEntityPhantomItemface::serverTick;
}
} }
// TODO: [port] validate this works
@Override @Override
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) { public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
if (this.tryToggleRedstone(world, pos, player)) { if (this.tryToggleRedstone(world, pos, player)) {
return InteractionResult.SUCCESS; return InteractionResult.PASS;
} }
/*
if (!world.isClientSide) { if (!world.isClientSide) {
BlockEntity tile = world.getBlockEntity(pos); TileEntity tile = world.getBlockEntity(pos);
if (tile instanceof MenuProvider menuProvider) { if (tile instanceof IPhantomTile && ((IPhantomTile) tile).getGuiID() != -1) {
player.openMenu(menuProvider, pos); NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tile, pos);
} }
} }
return InteractionResult.SUCCESS; */
return InteractionResult.PASS;
} }
// TODO: [port] fix all of this, it's a mess
@Override @Override
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public void displayHud(GuiGraphics guiGraphics, Minecraft minecraft, Player player, ItemStack stack, HitResult rayCast, Window resolution) { public void displayHud(GuiGraphics guiGraphics, Minecraft minecraft, Player player, ItemStack stack, HitResult rayCast, Window resolution) {
@ -158,8 +163,10 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
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); 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()) { if (phantom.isBoundThingInRange()) {
//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); drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.connectedRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
} else { } else {
//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); drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
} }
} else { } else {

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
@ -20,8 +19,6 @@ import net.minecraft.world.inventory.AbstractContainerMenu;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public abstract class AAScreen<T extends AbstractContainerMenu> extends AbstractContainerScreen<T> { public abstract class AAScreen<T extends AbstractContainerMenu> extends AbstractContainerScreen<T> {
//TODO standardize this to dunswe?
public static final String[] SIDES = { I18n.get("info.actuallyadditions.gui.disabled"), I18n.get("info.actuallyadditions.gui.up"), I18n.get("info.actuallyadditions.gui.down"), I18n.get("info.actuallyadditions.gui.north"), I18n.get("info.actuallyadditions.gui.east"), I18n.get("info.actuallyadditions.gui.south"), I18n.get("info.actuallyadditions.gui.west") };
public AAScreen(T container, Inventory inventory, Component pTitle) { public AAScreen(T container, Inventory inventory, Component pTitle) {
super(container, inventory, pTitle); super(container, inventory, pTitle);

View file

@ -12,12 +12,9 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerPhantomPlacer; import de.ellpeck.actuallyadditions.mod.inventory.ContainerPhantomPlacer;
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Inventory;
@ -25,15 +22,12 @@ import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn; import net.neoforged.api.distmarker.OnlyIn;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public class GuiPhantomPlacer extends AAScreen<ContainerPhantomPlacer> { public class GuiPhantomPlacer extends AAScreen<ContainerPhantomPlacer> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker"); private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker");
private final TileEntityPhantomPlacer placer; private final TileEntityPhantomPlacer placer;
private Button buttonSide;
public GuiPhantomPlacer(ContainerPhantomPlacer container, Inventory inventory, Component title) { public GuiPhantomPlacer(ContainerPhantomPlacer container, Inventory inventory, Component title) {
super(container, inventory, title); super(container, inventory, title);
@ -46,40 +40,44 @@ public class GuiPhantomPlacer extends AAScreen<ContainerPhantomPlacer> {
public void init() { public void init() {
super.init(); super.init();
if (!this.placer.isBreaker) { // if (!this.placer.isBreaker) {
buttonSide = Button.builder(Component.literal(this.getSide()), (button) -> PacketHandlerHelper.sendButtonPacket(this.placer, 0)) // this.addButton(new Button(0, this.leftPos + 63, this.topPos + 75, 50, 20, this.getSide()));
.bounds(this.leftPos + 63, this.topPos + 75, 50, 20).build(); // }
this.addRenderableWidget(buttonSide);
}
} }
@Override @Override
protected void containerTick() { protected void containerTick() {
super.containerTick(); super.containerTick();
if (!this.placer.isBreaker && this.buttonSide != null) { // if (!this.placer.isBreaker) {
buttonSide.setMessage(Component.literal(this.getSide())); // this.buttonList.get(0).displayString = this.getSide();
} // }
} }
@Override @Override
public void render(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { public void render(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
super.render(guiGraphics, mouseX, mouseY, partialTicks); super.render(guiGraphics, mouseX, mouseY, partialTicks);
if (!this.placer.isBreaker && buttonSide.isMouseOver(mouseX, mouseY)) { // if (!this.placer.isBreaker && this.buttonList.get(0).isMouseOver()) {
String loc = "info.actuallyadditions.placer.sides"; // String loc = "info." + ActuallyAdditions.MODID + ".placer.sides";
//
List<Component> textList = new ArrayList<>(); // List<String> textList = new ArrayList<>();
textList.add(Component.translatable(loc + ".1").withStyle(ChatFormatting.GOLD)); // textList.add(TextFormatting.GOLD + StringUtil.localize(loc + ".1"));
textList.add(Component.translatable(loc + ".2")); // textList.addAll(this.font.listFormattedStringToWidth(StringUtil.localize(loc + ".2"), 200));
guiGraphics.renderComponentTooltip(font, textList, mouseX, mouseY); // this.drawHoveringText(textList, mouseX, mouseY); //renderComponentTooltip
} // }
} }
// @Override
// protected void actionPerformed(Button button) throws IOException {
// if (!this.placer.isBreaker) {
// PacketHandlerHelper.sendButtonPacket(this.placer, button.id);
// }
// }
private String getSide() { // private String getSide() {
return SIDES[this.placer.side + 1]; // return GuiInputter.SIDES[this.placer.side + 1];
} // }
@Override @Override
public void renderBg(GuiGraphics guiGraphics, float f, int x, int y) { public void renderBg(GuiGraphics guiGraphics, float f, int x, int y) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -111,7 +111,6 @@ public class DrillItem extends ItemEnergy {
@Nonnull @Nonnull
@Override @Override
public InteractionResult useOn(UseOnContext context) { public InteractionResult useOn(UseOnContext context) {
Level level = context.getLevel();
Player player = context.getPlayer(); Player player = context.getPlayer();
InteractionHand hand = context.getHand(); InteractionHand hand = context.getHand();
@ -122,11 +121,28 @@ public class DrillItem extends ItemEnergy {
if (slot >= 0 && slot < 9) { // TODO: validate... old = PlayerInventory.getHotbarSize(); new = 9 if (slot >= 0 && slot < 9) { // TODO: validate... old = PlayerInventory.getHotbarSize(); new = 9
ItemStack equip = player.getInventory().getItem(slot); ItemStack equip = player.getInventory().getItem(slot);
if (!equip.isEmpty() && equip != stack) { if (!equip.isEmpty() && equip != stack) {
ItemStack toPlaceStack = equip; ItemStack toPlaceStack = equip.copy();
WorldUtil.setHandItemWithoutAnnoyingSound(player, hand, toPlaceStack);
//tryPlaceItemIntoWorld could throw an Exception
try {
//Places the Block into the World //Places the Block into the World
BlockHitResult result = new BlockHitResult(context.getClickLocation(), context.getClickedFace(), context.getClickedPos(), context.isInside()); if (toPlaceStack.useOn(context) != InteractionResult.FAIL) {
return toPlaceStack.useOn(new UseOnContext(level, player, hand, toPlaceStack, result)); if (!player.isCreative()) {
WorldUtil.setHandItemWithoutAnnoyingSound(player, hand, toPlaceStack.copy());
}
}
}
//Notify the Player and log the Exception
catch (Exception e) {
ActuallyAdditions.LOGGER.error("Player " + player.getName() + " who should place a Block using a Drill at " + player.getX() + ", " + player.getY() + ", " + player.getZ() + " in World " + context.getLevel().dimension() + " threw an Exception! Don't let that happen again!");
}
player.getInventory().setItem(slot, player.getItemInHand(hand));
WorldUtil.setHandItemWithoutAnnoyingSound(player, hand, stack);
return InteractionResult.SUCCESS;
} }
} }
} }

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResult;
import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.InteractionResultHolder;
@ -42,7 +41,6 @@ public class ItemDrillUpgrade extends ItemBase {
ItemStack stack = player.getItemInHand(hand); ItemStack stack = player.getItemInHand(hand);
if (!world.isClientSide && this.type == UpgradeType.PLACER) { if (!world.isClientSide && this.type == UpgradeType.PLACER) {
this.setSlotToPlaceFrom(stack, player.getInventory().selected); this.setSlotToPlaceFrom(stack, player.getInventory().selected);
player.sendSystemMessage(Component.literal("Set the slot to place from to " + (player.getInventory().selected + 1)));
return new InteractionResultHolder<>(InteractionResult.SUCCESS, stack); return new InteractionResultHolder<>(InteractionResult.SUCCESS, stack);
} }
return new InteractionResultHolder<>(InteractionResult.FAIL, stack); return new InteractionResultHolder<>(InteractionResult.FAIL, stack);

View file

@ -15,11 +15,10 @@ import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import javax.annotation.Nonnull;
public class TileEntityPhantomBreaker extends TileEntityPhantomPlacer { public class TileEntityPhantomBreaker extends TileEntityPhantomPlacer {
public TileEntityPhantomBreaker(BlockPos pos, BlockState state) { public TileEntityPhantomBreaker(BlockPos pos, BlockState state) {
@ -27,6 +26,18 @@ public class TileEntityPhantomBreaker extends TileEntityPhantomPlacer {
this.isBreaker = true; this.isBreaker = true;
} }
public static <T extends BlockEntity> void clientTick(Level level, BlockPos pos, BlockState state, T t) {
if (t instanceof TileEntityPhantomBreaker tile) {
tile.clientTick();
}
}
public static <T extends BlockEntity> void serverTick(Level level, BlockPos pos, BlockState state, T t) {
if (t instanceof TileEntityPhantomBreaker tile) {
tile.serverTick();
}
}
@Override @Override
public IAcceptor getAcceptor() { public IAcceptor getAcceptor() {
return (slot, stack, automation) -> !automation; return (slot, stack, automation) -> !automation;
@ -37,9 +48,4 @@ public class TileEntityPhantomBreaker extends TileEntityPhantomPlacer {
return ItemStackHandlerAA.REMOVE_TRUE; return ItemStackHandlerAA.REMOVE_TRUE;
} }
@Nonnull
@Override
public Component getDisplayName() {
return Component.translatable("container.actuallyadditions.phantomBreaker");
}
} }

View file

@ -37,7 +37,6 @@ import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List; import java.util.List;
@ -237,10 +236,9 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
this.sendUpdate(); this.sendUpdate();
} }
@Nonnull
@Override @Override
public Component getDisplayName() { public Component getDisplayName() {
return Component.translatable("container.actuallyadditions.phantomPlacer"); return Component.empty();
} }
@Nullable @Nullable

View file

@ -214,7 +214,6 @@ public final class WorldUtil {
return false; return false;
} }
//TODO standardize this to dunswe?
public static Direction getDirectionBySidesInOrder(int side) { public static Direction getDirectionBySidesInOrder(int side) {
switch (side) { switch (side) {
case 0: case 0:

View file

@ -136,12 +136,12 @@
"block.actuallyadditions.lamp_cyan": "Cyan Lamp", "block.actuallyadditions.lamp_cyan": "Cyan Lamp",
"block.actuallyadditions.lamp_purple": "Purple Lamp", "block.actuallyadditions.lamp_purple": "Purple Lamp",
"block.actuallyadditions.phantom_itemface": "Phantom Itemface", "block.actuallyadditions.phantom_itemface": "Phantom Itemface",
"block.actuallyadditions.player_interface": "Player Interface", "block.actuallyadditions.player_interface": "Player Interface (wip)",
"block.actuallyadditions.phantom_energyface": "Phantom Energyface", "block.actuallyadditions.phantom_energyface": "Phantom Energyface",
"block.actuallyadditions.phantom_redstoneface": "Phantom Redstoneface", "block.actuallyadditions.phantom_redstoneface": "Phantom Redstoneface",
"block.actuallyadditions.phantom_liquiface": "Phantom Liquiface", "block.actuallyadditions.phantom_liquiface": "Phantom Liquiface",
"block.actuallyadditions.phantom_placer": "Phantom Placer", "block.actuallyadditions.phantom_placer": "Phantom Placer (wip)",
"block.actuallyadditions.phantom_breaker": "Phantom Breaker", "block.actuallyadditions.phantom_breaker": "Phantom Breaker (wip)",
"block.actuallyadditions.lava_factory_controller": "Lava Factory Controller", "block.actuallyadditions.lava_factory_controller": "Lava Factory Controller",
"block.actuallyadditions.lava_factory_casing": "Lava Casing", "block.actuallyadditions.lava_factory_casing": "Lava Casing",
"block.actuallyadditions.fluid_placer": "Fluid Placer", "block.actuallyadditions.fluid_placer": "Fluid Placer",
@ -257,26 +257,23 @@
"block.actuallyadditions.atomic_reconstructor.info.2.12": "Replacer", "block.actuallyadditions.atomic_reconstructor.info.2.12": "Replacer",
"block.actuallyadditions.atomic_reconstructor.info.2.13": "Differentiator", "block.actuallyadditions.atomic_reconstructor.info.2.13": "Differentiator",
"block.actuallyadditions.atomic_reconstructor.info.2.14": "Receiver", "block.actuallyadditions.atomic_reconstructor.info.2.14": "Receiver",
"block.actuallyadditions.crate_small": "Small Storage Crate (wip)",
"block.actuallyadditions.crate_medium": "Medium Storage Crate (wip)",
"block.actuallyadditions.crate_large": "Large Storage Crate (wip)",
"_comment": "Items", "_comment": "Items",
"item.actuallyadditions.drill_blue": "Blue Drill", "item.actuallyadditions.drill_blue": "Blue Drill (wip)",
"item.actuallyadditions.drill_light_blue": "Light Blue Drill", "item.actuallyadditions.drill_light_blue": "Light Blue Drill (wip)",
"item.actuallyadditions.drill_brown": "Brown Drill", "item.actuallyadditions.drill_brown": "Brown Drill (wip)",
"item.actuallyadditions.drill_black": "Black Drill", "item.actuallyadditions.drill_black": "Black Drill (wip)",
"item.actuallyadditions.drill_white": "White Drill", "item.actuallyadditions.drill_white": "White Drill (wip)",
"item.actuallyadditions.drill_magenta": "Magenta Drill", "item.actuallyadditions.drill_magenta": "Magenta Drill (wip)",
"item.actuallyadditions.drill_orange": "Orange Drill", "item.actuallyadditions.drill_orange": "Orange Drill (wip)",
"item.actuallyadditions.drill_pink": "Pink Drill", "item.actuallyadditions.drill_pink": "Pink Drill (wip)",
"item.actuallyadditions.drill_purple": "Purple Drill", "item.actuallyadditions.drill_purple": "Purple Drill (wip)",
"item.actuallyadditions.drill_red": "Red Drill", "item.actuallyadditions.drill_red": "Red Drill (wip)",
"item.actuallyadditions.drill_yellow": "Yellow Drill", "item.actuallyadditions.drill_yellow": "Yellow Drill (wip)",
"item.actuallyadditions.drill_cyan": "Cyan Drill", "item.actuallyadditions.drill_cyan": "Cyan Drill (wip)",
"item.actuallyadditions.drill_gray": "Gray Drill", "item.actuallyadditions.drill_gray": "Gray Drill (wip)",
"item.actuallyadditions.drill_green": "Green Drill", "item.actuallyadditions.drill_green": "Green Drill (wip)",
"item.actuallyadditions.drill_light_gray": "Light Gray Drill", "item.actuallyadditions.drill_light_gray": "Light Gray Drill (wip)",
"item.actuallyadditions.drill_lime": "Lime Drill", "item.actuallyadditions.drill_lime": "Lime Drill (wip)",
"item.actuallyadditions.rice": "Rice", "item.actuallyadditions.rice": "Rice",
"item.actuallyadditions.rice_dough": "Rice Dough", "item.actuallyadditions.rice_dough": "Rice Dough",
"item.actuallyadditions.rice_seeds": "Rice Seeds", "item.actuallyadditions.rice_seeds": "Rice Seeds",
@ -316,7 +313,7 @@
"item.actuallyadditions.drill_upgrade_silk_touch": "Drill Silk Touch Augment", "item.actuallyadditions.drill_upgrade_silk_touch": "Drill Silk Touch Augment",
"item.actuallyadditions.drill_upgrade_fortune": "Drill Fortune Augment I", "item.actuallyadditions.drill_upgrade_fortune": "Drill Fortune Augment I",
"item.actuallyadditions.drill_upgrade_fortune_ii": "Drill Fortune Augment II (Gives Fortune III!)", "item.actuallyadditions.drill_upgrade_fortune_ii": "Drill Fortune Augment II (Gives Fortune III!)",
"item.actuallyadditions.drill_upgrade_block_placing": "Drill Block Placing Augment", "item.actuallyadditions.drill_upgrade_block_placing": "Drill Block Placing Augment (wip)",
"item.actuallyadditions.drill_upgrade_three_by_three": "Drill Area Augment I", "item.actuallyadditions.drill_upgrade_three_by_three": "Drill Area Augment I",
"item.actuallyadditions.drill_upgrade_five_by_five": "Drill Area Augment II", "item.actuallyadditions.drill_upgrade_five_by_five": "Drill Area Augment II",
"item.actuallyadditions.dough": "Dough (wip)", "item.actuallyadditions.dough": "Dough (wip)",
@ -533,10 +530,10 @@
"container.actuallyadditions.crusher_double": "Double Crusher", "container.actuallyadditions.crusher_double": "Double Crusher",
"container.actuallyadditions.powered_furnace": "Powered Furnace", "container.actuallyadditions.powered_furnace": "Powered Furnace",
"container.actuallyadditions.feeder": "Feeder", "container.actuallyadditions.feeder": "Feeder",
"container.actuallyadditions.crate_small": "Small Storage Crate", "container.actuallyadditions.crate_small": "Small Storage Crate (wip)",
"container.actuallyadditions.crate_small.desc": "'Small'", "container.actuallyadditions.crate_small.desc": "'Small'",
"container.actuallyadditions.crate_medium": "Medium Storage Crate", "container.actuallyadditions.crate_medium": "Medium Storage Crate (wip)",
"container.actuallyadditions.crate_large": "Large Storage Crate", "container.actuallyadditions.crate_large": "Large Storage Crate (wip)",
"container.actuallyadditions.crate_large.desc": "Supersolid", "container.actuallyadditions.crate_large.desc": "Supersolid",
"container.actuallyadditions.repairer": "Repairer", "container.actuallyadditions.repairer": "Repairer",
"container.actuallyadditions.placer": "Placer", "container.actuallyadditions.placer": "Placer",