mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 07:13:28 +01:00
Fixed Phantomfaces.
Added Recipes for Phantomfaces.
This commit is contained in:
parent
ffc67e6a5b
commit
ae6695a5ba
14 changed files with 225 additions and 43 deletions
|
@ -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
|
4d3128b37a7153882a9324cda49b5069207561c5 data/actuallyadditions/recipes/atomic_reconstructor.json
|
||||||
b0367f5012651764931e8b8fd0c5bcca4e8614c0 data/actuallyadditions/recipes/battery_box.json
|
b0367f5012651764931e8b8fd0c5bcca4e8614c0 data/actuallyadditions/recipes/battery_box.json
|
||||||
7e05cd54092b998dfdbd2221235dd52576ec79eb data/actuallyadditions/recipes/black_quartz_block.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
|
76f9eb2b859198eec4c50d992c3715633d5109a8 data/actuallyadditions/recipes/lava_factory_controller.json
|
||||||
1e3936f80be1540cd3d6ed570c1ed6381227db7d data/actuallyadditions/recipes/leaf_generator.json
|
1e3936f80be1540cd3d6ed570c1ed6381227db7d data/actuallyadditions/recipes/leaf_generator.json
|
||||||
73696fd4e851f440a9850485fc9ad03fc63442a9 data/actuallyadditions/recipes/oil_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
|
8c78ebb9351b98ffe368391a391b90385c0b8b7f data/actuallyadditions/recipes/placer.json
|
||||||
184acfb5fd3799b3fbe35150c67b6530581f8bf1 data/actuallyadditions/recipes/powered_furnace.json
|
184acfb5fd3799b3fbe35150c67b6530581f8bf1 data/actuallyadditions/recipes/powered_furnace.json
|
||||||
b81a706a5f635d8a63ffd3034c80838dc10699c9 data/actuallyadditions/recipes/ranged_collector.json
|
b81a706a5f635d8a63ffd3034c80838dc10699c9 data/actuallyadditions/recipes/ranged_collector.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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -409,6 +409,45 @@ public class BlockRecipeGenerator extends RecipeProvider {
|
||||||
.define('L', ItemTags.LEAVES)
|
.define('L', ItemTags.LEAVES)
|
||||||
.define('A', ActuallyItems.ADVANCED_COIL.get())
|
.define('A', ActuallyItems.ADVANCED_COIL.get())
|
||||||
.save(recipeOutput);
|
.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 {
|
public static class Recipe {
|
||||||
|
|
|
@ -48,7 +48,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityLavaFactoryController;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLeafGenerator;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLeafGenerator;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
|
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.TileEntityPhantomBreaker;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomEnergyface;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomEnergyface;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomItemface;
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomItemface;
|
||||||
|
@ -231,8 +230,8 @@ public final class ActuallyBlocks {
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomRedstoneface::new);
|
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomRedstoneface::new);
|
||||||
public static final AABlockReg<BlockPhantom, AABlockItem, TileEntityPhantomBreaker> PHANTOM_BREAKER = new AABlockReg<>("phantom_breaker", () -> new BlockPhantom(BlockPhantom.Type.BREAKER),
|
public static final AABlockReg<BlockPhantom, AABlockItem, TileEntityPhantomBreaker> PHANTOM_BREAKER = new AABlockReg<>("phantom_breaker", () -> new BlockPhantom(BlockPhantom.Type.BREAKER),
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBreaker::new);
|
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBreaker::new);
|
||||||
public static final AABlockReg<BlockPhantomBooster, AABlockItem, TileEntityPhantomBooster> PHANTOM_BOOSTER = new AABlockReg<>("phantom_booster", BlockPhantomBooster::new,
|
public static final AABlockReg<BlockPhantomBooster, AABlockItem, ?> PHANTOM_BOOSTER = new AABlockReg<>("phantom_booster", BlockPhantomBooster::new,
|
||||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBooster::new);
|
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||||
|
|
||||||
// Misc Tiles
|
// Misc Tiles
|
||||||
public static final AABlockReg<BlockBatteryBox, AABlockItem, TileEntityBatteryBox> BATTERY_BOX = new AABlockReg<>("battery_box", BlockBatteryBox::new,
|
public static final AABlockReg<BlockBatteryBox, AABlockItem, TileEntityBatteryBox> BATTERY_BOX = new AABlockReg<>("battery_box", BlockBatteryBox::new,
|
||||||
|
@ -376,7 +375,6 @@ public final class ActuallyBlocks {
|
||||||
PHANTOM_ENERGYFACE.getTileEntityType(),
|
PHANTOM_ENERGYFACE.getTileEntityType(),
|
||||||
PHANTOM_REDSTONEFACE.getTileEntityType(),
|
PHANTOM_REDSTONEFACE.getTileEntityType(),
|
||||||
PHANTOM_BREAKER.getTileEntityType(),
|
PHANTOM_BREAKER.getTileEntityType(),
|
||||||
PHANTOM_BOOSTER.getTileEntityType(),
|
|
||||||
BATTERY_BOX.getTileEntityType(),
|
BATTERY_BOX.getTileEntityType(),
|
||||||
FIREWORK_BOX.getTileEntityType(),
|
FIREWORK_BOX.getTileEntityType(),
|
||||||
SHOCK_SUPPRESSOR.getTileEntityType(),
|
SHOCK_SUPPRESSOR.getTileEntityType(),
|
||||||
|
|
|
@ -14,19 +14,17 @@ import com.mojang.blaze3d.platform.Window;
|
||||||
import de.ellpeck.actuallyadditions.api.tile.IPhantomTile;
|
import de.ellpeck.actuallyadditions.api.tile.IPhantomTile;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
||||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBreaker;
|
import de.ellpeck.actuallyadditions.mod.tile.*;
|
||||||
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 net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import net.minecraft.client.resources.language.I18n;
|
import net.minecraft.client.resources.language.I18n;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
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.util.Mth;
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.InteractionResult;
|
import net.minecraft.world.InteractionResult;
|
||||||
|
@ -156,27 +154,37 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
|
||||||
BlockEntity tile = minecraft.level.getBlockEntity(pos);
|
BlockEntity tile = minecraft.level.getBlockEntity(pos);
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
if (tile instanceof IPhantomTile phantom) {
|
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()) {
|
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())));
|
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());
|
BlockState state = minecraft.level.getBlockState(phantom.getBoundPosition());
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
Item item = Item.byBlock(block);
|
Item item = Item.byBlock(block);
|
||||||
String name = item.getName(new ItemStack(block)).getString();
|
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()) {
|
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 {
|
} 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 {
|
} 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 {
|
public enum Type {
|
||||||
ITEMFACE,
|
ITEMFACE,
|
||||||
PLACER,
|
PLACER,
|
||||||
|
|
|
@ -10,33 +10,21 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.blocks;
|
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
|
||||||
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 javax.annotation.Nullable;
|
public class BlockPhantomBooster extends BlockBase {
|
||||||
|
|
||||||
public class BlockPhantomBooster extends BlockContainerBase {
|
|
||||||
|
|
||||||
public BlockPhantomBooster() {
|
public BlockPhantomBooster() {
|
||||||
super(ActuallyBlocks.defaultPickProps());
|
super(ActuallyBlocks.defaultPickProps());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
/* @Nullable
|
||||||
@Override
|
@Override
|
||||||
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
|
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
|
||||||
return new TileEntityPhantomBooster(pos, state);
|
return new TileEntityPhantomBooster(pos, state);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@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 level.isClientSide? TileEntityPhantomBooster::clientTick : TileEntityPhantomBooster::serverTick;
|
return level.isClientSide? TileEntityPhantomBooster::clientTick : TileEntityPhantomBooster::serverTick;
|
||||||
|
@ -45,5 +33,5 @@ public class BlockPhantomBooster extends BlockContainerBase {
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
|
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
|
||||||
return VoxelShapes.BOOSTER_SHAPE;
|
return VoxelShapes.BOOSTER_SHAPE;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||||
*
|
*
|
||||||
* © 2015-2017 Ellpeck
|
* © 2015-2017 Ellpeck
|
||||||
*/
|
*//*
|
||||||
|
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.tile;
|
package de.ellpeck.actuallyadditions.mod.tile;
|
||||||
|
|
||||||
|
@ -34,3 +35,4 @@ public class TileEntityPhantomBooster extends TileEntityBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
@ -16,12 +16,14 @@ import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
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 net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.api.distmarker.OnlyIn;
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
|
import net.neoforged.neoforge.capabilities.ICapabilityInvalidationListener;
|
||||||
|
|
||||||
public abstract class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile {
|
public abstract class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile {
|
||||||
public static final int RANGE = 16;
|
public static final int RANGE = 16;
|
||||||
|
@ -32,6 +34,7 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
|
||||||
private BlockPos boundPosBefore;
|
private BlockPos boundPosBefore;
|
||||||
private Block boundBlockBefore;
|
private Block boundBlockBefore;
|
||||||
private int lastStrength;
|
private int lastStrength;
|
||||||
|
private CapListener capListener = new CapListener(this);
|
||||||
|
|
||||||
public TileEntityPhantomface(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
public TileEntityPhantomface(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
||||||
super(type, pos, state, 0);
|
super(type, pos, state, 0);
|
||||||
|
@ -48,6 +51,7 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return newRange;
|
return newRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +94,13 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
|
||||||
|
|
||||||
if (this.doesNeedUpdateSend()) {
|
if (this.doesNeedUpdateSend()) {
|
||||||
this.onUpdateSent();
|
this.onUpdateSent();
|
||||||
|
|
||||||
|
if (level instanceof ServerLevel serverLevel) {
|
||||||
|
capListener.disable();
|
||||||
|
capListener = new CapListener(this);
|
||||||
|
if (hasBoundPosition())
|
||||||
|
serverLevel.registerCapabilityListener(boundPosition, capListener);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int strength = this.getComparatorStrength();
|
int strength = this.getComparatorStrength();
|
||||||
|
@ -122,7 +133,6 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
|
||||||
if (this.boundPosition != null) {
|
if (this.boundPosition != null) {
|
||||||
this.level.updateNeighborsAt(this.worldPosition, this.level.getBlockState(this.boundPosition).getBlock());
|
this.level.updateNeighborsAt(this.worldPosition, this.level.getBlockState(this.boundPosition).getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendUpdate();
|
this.sendUpdate();
|
||||||
this.setChanged();
|
this.setChanged();
|
||||||
}
|
}
|
||||||
|
@ -191,4 +201,25 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
|
||||||
}
|
}
|
||||||
return 0;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ public final class StringUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Move to official
|
// TODO: Move to official
|
||||||
|
@Deprecated
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public static void drawSplitString(Font renderer, String strg, int x, int y, int width, int color, boolean shadow) {
|
public static void drawSplitString(Font renderer, String strg, int x, int y, int width, int color, boolean shadow) {
|
||||||
// ResourcePackList <- holds the correct way
|
// ResourcePackList <- holds the correct way
|
||||||
|
|
|
@ -135,18 +135,18 @@
|
||||||
"block.actuallyadditions.lamp_pink": "Pink Lamp",
|
"block.actuallyadditions.lamp_pink": "Pink Lamp",
|
||||||
"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 (wip)",
|
"block.actuallyadditions.phantom_itemface": "Phantom Itemface",
|
||||||
"block.actuallyadditions.player_interface": "Player Interface (wip)",
|
"block.actuallyadditions.player_interface": "Player Interface (wip)",
|
||||||
"block.actuallyadditions.phantom_energyface": "Phantom Energyface (wip)",
|
"block.actuallyadditions.phantom_energyface": "Phantom Energyface",
|
||||||
"block.actuallyadditions.phantom_redstoneface": "Phantom Redstoneface (wip)",
|
"block.actuallyadditions.phantom_redstoneface": "Phantom Redstoneface",
|
||||||
"block.actuallyadditions.phantom_liquiface": "Phantom Liquiface (wip)",
|
"block.actuallyadditions.phantom_liquiface": "Phantom Liquiface",
|
||||||
"block.actuallyadditions.phantom_placer": "Phantom Placer (wip)",
|
"block.actuallyadditions.phantom_placer": "Phantom Placer (wip)",
|
||||||
"block.actuallyadditions.phantom_breaker": "Phantom Breaker (wip)",
|
"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",
|
||||||
"block.actuallyadditions.fluid_collector": "Fluid Collector",
|
"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.coffee": "Coffee Plant",
|
||||||
"block.actuallyadditions.ethetic_green_block": "Ethetic Green Quartz",
|
"block.actuallyadditions.ethetic_green_block": "Ethetic Green Quartz",
|
||||||
"block.actuallyadditions.ethetic_white_block": "Ethetic Quartz",
|
"block.actuallyadditions.ethetic_white_block": "Ethetic Quartz",
|
||||||
|
@ -299,7 +299,7 @@
|
||||||
"item.actuallyadditions.gold_aiot": "Golden AIOT (wip)",
|
"item.actuallyadditions.gold_aiot": "Golden AIOT (wip)",
|
||||||
"item.actuallyadditions.diamond_aiot": "Diamond AIOT (wip)",
|
"item.actuallyadditions.diamond_aiot": "Diamond AIOT (wip)",
|
||||||
"item.actuallyadditions.netherite_aiot": "Netherite 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.empty_cup": "Empty Cup",
|
||||||
"item.actuallyadditions.coffee_cup": "Cup with Coffee",
|
"item.actuallyadditions.coffee_cup": "Cup with Coffee",
|
||||||
"item.actuallyadditions.coffee_seeds": "Coffee Seeds",
|
"item.actuallyadditions.coffee_seeds": "Coffee Seeds",
|
||||||
|
|
Loading…
Reference in a new issue