From 0f3ec5805ae800efbd0902e0fc6bc3e147e38ab2 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Sat, 13 Nov 2021 22:13:33 +0100 Subject: [PATCH] [#25] Current process Added some help logic for connecting, still needs to get completed. --- build.gradle | 8 +- .../net/landofrails/stellwand/Stellwand.java | 2 +- .../content/blocks/CustomBlocks.java | 4 +- ...Receiver.java => BlockButtonReceiver.java} | 10 +- ...=> BlockButtonReceiverFunctionEntity.java} | 14 +-- .../function/BlockSignalFunctionEntity.java | 69 +++++++------ ...a => BlockButtonReceiverRenderEntity.java} | 46 ++++----- ... => BlockButtonReceiverStorageEntity.java} | 14 +-- .../stellwand/content/items/CustomItems.java | 5 +- ...iver.java => ItemBlockButtonReceiver.java} | 14 +-- .../items/connector/AItemConnector.java | 96 ++++++++++++++++++ .../items/{ => connector}/ItemConnector.java | 45 +++++++- .../items/connector/ItemConnectorSender.java | 4 + .../items/connector/ItemConnectorSignal.java | 33 ++++++ .../stellwand/content/messages/EMessage.java | 1 + .../BlockReceiverEntry.java | 2 +- .../BlockReceiverEntryBlock.java | 2 +- .../BlockReceiverEntryItem.java | 2 +- .../contentpacks/loader/StaticLoader.java | 8 +- .../contentpacks/types/EntryType.java | 2 +- .../assets/landofsignals/lang/de_DE.lang | 1 + .../assets/landofsignals/lang/en_US.lang | 1 + .../blockbutton/blockbutton.bbmodel | 1 + .../blockreceiver.bbmodel | 0 .../blockbuttonreceiver}/blockreceiver.mtl | 0 .../blockbuttonreceiver}/blockreceiver.obj | 0 .../blockbuttonreceiver}/iron_bars.png | Bin .../blockbuttonreceiver}/smooth_stone.png | Bin .../blockbuttonreceiver}/smooth_stone_off.png | Bin .../blockbuttonreceiver}/smooth_stone_on.png | Bin 30 files changed, 286 insertions(+), 98 deletions(-) rename src/main/java/net/landofrails/stellwand/content/blocks/others/{BlockReceiver.java => BlockButtonReceiver.java} (60%) rename src/main/java/net/landofrails/stellwand/content/entities/function/{BlockReceiverFunctionEntity.java => BlockButtonReceiverFunctionEntity.java} (63%) rename src/main/java/net/landofrails/stellwand/content/entities/rendering/{BlockReceiverRenderEntity.java => BlockButtonReceiverRenderEntity.java} (65%) rename src/main/java/net/landofrails/stellwand/content/entities/storage/{BlockReceiverStorageEntity.java => BlockButtonReceiverStorageEntity.java} (92%) rename src/main/java/net/landofrails/stellwand/content/items/{ItemBlockReceiver.java => ItemBlockButtonReceiver.java} (95%) create mode 100644 src/main/java/net/landofrails/stellwand/content/items/connector/AItemConnector.java rename src/main/java/net/landofrails/stellwand/content/items/{ => connector}/ItemConnector.java (78%) create mode 100644 src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnectorSender.java create mode 100644 src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnectorSignal.java rename src/main/java/net/landofrails/stellwand/contentpacks/entries/{receiver => buttonreceiver}/BlockReceiverEntry.java (93%) rename src/main/java/net/landofrails/stellwand/contentpacks/entries/{receiver => buttonreceiver}/BlockReceiverEntryBlock.java (89%) rename src/main/java/net/landofrails/stellwand/contentpacks/entries/{receiver => buttonreceiver}/BlockReceiverEntryItem.java (82%) create mode 100644 src/main/resources/assets/stellwand/models/block/blockbutton/blockbutton/blockbutton.bbmodel rename src/main/resources/assets/stellwand/models/block/{blockreceiver/blockreceiver => blockbuttonreceiver/blockbuttonreceiver}/blockreceiver.bbmodel (100%) rename src/main/resources/assets/stellwand/models/block/{blockreceiver/blockreceiver => blockbuttonreceiver/blockbuttonreceiver}/blockreceiver.mtl (100%) rename src/main/resources/assets/stellwand/models/block/{blockreceiver/blockreceiver => blockbuttonreceiver/blockbuttonreceiver}/blockreceiver.obj (100%) rename src/main/resources/assets/stellwand/models/block/{blockreceiver/blockreceiver => blockbuttonreceiver/blockbuttonreceiver}/iron_bars.png (100%) rename src/main/resources/assets/stellwand/models/block/{blockreceiver/blockreceiver => blockbuttonreceiver/blockbuttonreceiver}/smooth_stone.png (100%) rename src/main/resources/assets/stellwand/models/block/{blockreceiver/blockreceiver => blockbuttonreceiver/blockbuttonreceiver}/smooth_stone_off.png (100%) rename src/main/resources/assets/stellwand/models/block/{blockreceiver/blockreceiver => blockbuttonreceiver/blockbuttonreceiver}/smooth_stone_on.png (100%) diff --git a/build.gradle b/build.gradle index ea97c7e6..22ddd657 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,12 @@ buildscript { repositories { jcenter() + mavenCentral() maven { url = 'https://teamopenindustry.cc/maven/' } } dependencies { classpath 'cam72cam.universalmodcore:UniversalModCoreGradle:0.1.3' + classpath 'org.jetbrains:annotations:22.0.0' } } @@ -19,7 +21,7 @@ universalmodcore { modName = 'LandOfSignals' modId = 'landofsignals' modVersion = version - umcVersion = '1.1.2' + umcVersion = '0.1.3' } task('umcIntegration') { @@ -50,3 +52,7 @@ task('showBuildInfo') { System.out.println("https://teamopenindustry.cc/maven/cam72cam/universalmodcore/UniversalModCore/${umcVersionString}/UniversalModCore-${umcVersionString}.jar") } } + +dependencies { + implementation 'org.jetbrains:annotations:20.1.0' +} diff --git a/src/main/java/net/landofrails/stellwand/Stellwand.java b/src/main/java/net/landofrails/stellwand/Stellwand.java index 9de85fb0..6e4d88d7 100644 --- a/src/main/java/net/landofrails/stellwand/Stellwand.java +++ b/src/main/java/net/landofrails/stellwand/Stellwand.java @@ -59,7 +59,7 @@ public static void commonEvent(ModEvent event) { BlockSignalStorageEntity.prepare(); BlockSenderStorageEntity.prepare(); BlockMultisignalStorageEntity.prepare(); - BlockReceiverStorageEntity.prepare(); + BlockButtonReceiverStorageEntity.prepare(); break; case RELOAD: case START: diff --git a/src/main/java/net/landofrails/stellwand/content/blocks/CustomBlocks.java b/src/main/java/net/landofrails/stellwand/content/blocks/CustomBlocks.java index a1f0215a..7fbd304d 100644 --- a/src/main/java/net/landofrails/stellwand/content/blocks/CustomBlocks.java +++ b/src/main/java/net/landofrails/stellwand/content/blocks/CustomBlocks.java @@ -16,7 +16,7 @@ private CustomBlocks() { public static final BlockSender BLOCKSENDER = new BlockSender(); public static final BlockSignal BLOCKSIGNAL = new BlockSignal(); public static final BlockMultisignal BLOCKMULTISIGNAL = new BlockMultisignal(); - public static final BlockReceiver BLOCKRECEIVER = new BlockReceiver(); + public static final BlockButtonReceiver BLOCKRECEIVER = new BlockButtonReceiver(); public static void init() { // WICHTIG: Triggert das Laden der Blöcke. @@ -30,7 +30,7 @@ public static void registerBlockRenderers() { BlockRender.register(BLOCKSENDER, BlockSenderRenderEntity::render, BlockSenderStorageEntity.class); BlockRender.register(BLOCKMULTISIGNAL, BlockMultisignalRenderEntity::render, BlockMultisignalStorageEntity.class); - BlockRender.register(BLOCKRECEIVER, BlockReceiverRenderEntity::render, BlockReceiverStorageEntity.class); + BlockRender.register(BLOCKRECEIVER, BlockButtonReceiverRenderEntity::render, BlockButtonReceiverStorageEntity.class); } diff --git a/src/main/java/net/landofrails/stellwand/content/blocks/others/BlockReceiver.java b/src/main/java/net/landofrails/stellwand/content/blocks/others/BlockButtonReceiver.java similarity index 60% rename from src/main/java/net/landofrails/stellwand/content/blocks/others/BlockReceiver.java rename to src/main/java/net/landofrails/stellwand/content/blocks/others/BlockButtonReceiver.java index ca64e156..fb346baf 100644 --- a/src/main/java/net/landofrails/stellwand/content/blocks/others/BlockReceiver.java +++ b/src/main/java/net/landofrails/stellwand/content/blocks/others/BlockButtonReceiver.java @@ -4,17 +4,17 @@ import cam72cam.mod.block.BlockTypeEntity; import cam72cam.mod.block.Material; import net.landofrails.landofsignals.LandOfSignals; -import net.landofrails.stellwand.content.entities.storage.BlockReceiverStorageEntity; +import net.landofrails.stellwand.content.entities.storage.BlockButtonReceiverStorageEntity; -public class BlockReceiver extends BlockTypeEntity { +public class BlockButtonReceiver extends BlockTypeEntity { - public BlockReceiver() { - super(LandOfSignals.MODID, "stellwand.blockreceiver"); + public BlockButtonReceiver() { + super(LandOfSignals.MODID, "stellwand.blockbuttonreceiver"); } @Override protected BlockEntity constructBlockEntity() { - return new BlockReceiverStorageEntity(); + return new BlockButtonReceiverStorageEntity(); } @Override diff --git a/src/main/java/net/landofrails/stellwand/content/entities/function/BlockReceiverFunctionEntity.java b/src/main/java/net/landofrails/stellwand/content/entities/function/BlockButtonReceiverFunctionEntity.java similarity index 63% rename from src/main/java/net/landofrails/stellwand/content/entities/function/BlockReceiverFunctionEntity.java rename to src/main/java/net/landofrails/stellwand/content/entities/function/BlockButtonReceiverFunctionEntity.java index e0713e63..001644d6 100644 --- a/src/main/java/net/landofrails/stellwand/content/entities/function/BlockReceiverFunctionEntity.java +++ b/src/main/java/net/landofrails/stellwand/content/entities/function/BlockButtonReceiverFunctionEntity.java @@ -3,19 +3,19 @@ import cam72cam.mod.block.BlockEntity; import cam72cam.mod.item.ItemStack; import cam72cam.mod.serialization.TagCompound; -import net.landofrails.stellwand.content.entities.storage.BlockReceiverStorageEntity; +import net.landofrails.stellwand.content.entities.storage.BlockButtonReceiverStorageEntity; import net.landofrails.stellwand.content.items.CustomItems; -public class BlockReceiverFunctionEntity extends BlockEntity { +public class BlockButtonReceiverFunctionEntity extends BlockEntity { - private BlockReceiverStorageEntity entity; + private BlockButtonReceiverStorageEntity entity; @SuppressWarnings("java:S112") - protected BlockReceiverFunctionEntity() { - if (this instanceof BlockReceiverStorageEntity) - entity = (BlockReceiverStorageEntity) this; + protected BlockButtonReceiverFunctionEntity() { + if (this instanceof BlockButtonReceiverStorageEntity) + entity = (BlockButtonReceiverStorageEntity) this; else - throw new RuntimeException("This should be a subclass of BlockReceiverStorageEntity!"); + throw new RuntimeException("This should be a subclass of BlockButtonReceiverStorageEntity!"); } @Override diff --git a/src/main/java/net/landofrails/stellwand/content/entities/function/BlockSignalFunctionEntity.java b/src/main/java/net/landofrails/stellwand/content/entities/function/BlockSignalFunctionEntity.java index 388274f2..c9538d51 100644 --- a/src/main/java/net/landofrails/stellwand/content/entities/function/BlockSignalFunctionEntity.java +++ b/src/main/java/net/landofrails/stellwand/content/entities/function/BlockSignalFunctionEntity.java @@ -11,40 +11,43 @@ import net.landofrails.stellwand.config.StellwandConfig; import net.landofrails.stellwand.content.entities.storage.BlockSignalStorageEntity; import net.landofrails.stellwand.content.items.CustomItems; + public abstract class BlockSignalFunctionEntity extends BlockEntity { - private BlockSignalStorageEntity entity; - - @SuppressWarnings("java:S112") - public BlockSignalFunctionEntity() { - if (this instanceof BlockSignalStorageEntity) - entity = (BlockSignalStorageEntity) this; - else - throw new RuntimeException( - "This should be a subclass of BlockSignalStorageEntity!"); - } - - @Override - public ItemStack onPick() { - ItemStack is = new ItemStack(CustomItems.ITEMBLOCKSIGNAL, 1); - TagCompound tag = is.getTagCompound(); - tag.setString("itemId", entity.getContentPackBlockId()); - is.setTagCompound(tag); - return is; - } - - @Override - public boolean onClick(Player player, Hand hand, Facing facing, Vec3d hit) { - if (StellwandConfig.Debugging.debugOutput) { - player.sendMessage(PlayerMessage.direct("ContentBlockId: " + entity.contentPackBlockId)); - player.sendMessage(PlayerMessage.direct("DisplayMode: " + entity.displayMode)); - } - return super.onClick(player, hand, facing, hit); - } - - @Override - public void onBreak() { - getWorld().dropItem(onPick(), getPos()); - } + private static final String SIGNALKEY = "signalPos"; + private BlockSignalStorageEntity entity; + + @SuppressWarnings("java:S112") + protected BlockSignalFunctionEntity() { + if (this instanceof BlockSignalStorageEntity) + entity = (BlockSignalStorageEntity) this; + else + throw new RuntimeException( + "This should be a subclass of BlockSignalStorageEntity!"); + } + + @Override + public ItemStack onPick() { + ItemStack is = new ItemStack(CustomItems.ITEMBLOCKSIGNAL, 1); + TagCompound tag = is.getTagCompound(); + tag.setString("itemId", entity.getContentPackBlockId()); + is.setTagCompound(tag); + return is; + } + + @Override + public boolean onClick(Player player, Hand hand, Facing facing, Vec3d hit) { + if (StellwandConfig.Debugging.debugOutput) { + player.sendMessage(PlayerMessage.direct("ContentBlockId: " + entity.contentPackBlockId)); + player.sendMessage(PlayerMessage.direct("DisplayMode: " + entity.displayMode)); + } + return super.onClick(player, hand, facing, hit); + } + + @Override + public void onBreak() { + getWorld().dropItem(onPick(), getPos()); + } + } diff --git a/src/main/java/net/landofrails/stellwand/content/entities/rendering/BlockReceiverRenderEntity.java b/src/main/java/net/landofrails/stellwand/content/entities/rendering/BlockButtonReceiverRenderEntity.java similarity index 65% rename from src/main/java/net/landofrails/stellwand/content/entities/rendering/BlockReceiverRenderEntity.java rename to src/main/java/net/landofrails/stellwand/content/entities/rendering/BlockButtonReceiverRenderEntity.java index 03e625c9..a6b39531 100644 --- a/src/main/java/net/landofrails/stellwand/content/entities/rendering/BlockReceiverRenderEntity.java +++ b/src/main/java/net/landofrails/stellwand/content/entities/rendering/BlockButtonReceiverRenderEntity.java @@ -6,23 +6,23 @@ import cam72cam.mod.render.OpenGL; import cam72cam.mod.render.StandardModel; import cam72cam.mod.render.obj.OBJRender; -import net.landofrails.stellwand.content.entities.storage.BlockReceiverStorageEntity; +import net.landofrails.stellwand.content.entities.storage.BlockButtonReceiverStorageEntity; import net.landofrails.stellwand.utils.compact.IRotatableBlockEntity; import org.lwjgl.opengl.GL11; import java.util.ArrayList; import java.util.stream.Collectors; -public class BlockReceiverRenderEntity implements IRotatableBlockEntity { +public class BlockButtonReceiverRenderEntity implements IRotatableBlockEntity { - private BlockReceiverStorageEntity entity; + private BlockButtonReceiverStorageEntity entity; private OBJModel model; private OBJRender renderer; private float[] defaultRotation; private float[] defaultTranslation; - public BlockReceiverRenderEntity(BlockReceiverStorageEntity entity) { + public BlockButtonReceiverRenderEntity(BlockButtonReceiverStorageEntity entity) { this.entity = entity; } @@ -36,10 +36,10 @@ public void setRotation(float rotation) { public OBJModel getModel() { if (model == null) { - if (entity.contentPackBlockId != null && BlockReceiverStorageEntity.getModels().containsKey(entity.contentPackBlockId)) - model = BlockReceiverStorageEntity.getModels().get(entity.contentPackBlockId); + if (entity.contentPackBlockId != null && BlockButtonReceiverStorageEntity.getModels().containsKey(entity.contentPackBlockId)) + model = BlockButtonReceiverStorageEntity.getModels().get(entity.contentPackBlockId); else - model = BlockReceiverStorageEntity.getModels().get(BlockReceiverStorageEntity.MISSING); + model = BlockButtonReceiverStorageEntity.getModels().get(BlockButtonReceiverStorageEntity.MISSING); } return model; @@ -47,18 +47,18 @@ public OBJModel getModel() { public OBJRender getRenderer() { if (renderer == null) { - if (entity.contentPackBlockId != null && BlockReceiverStorageEntity.getModels().containsKey(entity.contentPackBlockId)) { - if (!BlockReceiverStorageEntity.getRenderers().containsKey(entity.contentPackBlockId)) { - OBJModel m = BlockReceiverStorageEntity.getModels().get(entity.contentPackBlockId); - BlockReceiverStorageEntity.getRenderers().put(entity.contentPackBlockId, new OBJRender(m)); + if (entity.contentPackBlockId != null && BlockButtonReceiverStorageEntity.getModels().containsKey(entity.contentPackBlockId)) { + if (!BlockButtonReceiverStorageEntity.getRenderers().containsKey(entity.contentPackBlockId)) { + OBJModel m = BlockButtonReceiverStorageEntity.getModels().get(entity.contentPackBlockId); + BlockButtonReceiverStorageEntity.getRenderers().put(entity.contentPackBlockId, new OBJRender(m)); } - renderer = BlockReceiverStorageEntity.getRenderers().get(entity.contentPackBlockId); + renderer = BlockButtonReceiverStorageEntity.getRenderers().get(entity.contentPackBlockId); } else { - if (BlockReceiverStorageEntity.getRenderers().containsKey(BlockReceiverStorageEntity.MISSING)) { - OBJModel m = BlockReceiverStorageEntity.getModels().get(BlockReceiverStorageEntity.MISSING); - BlockReceiverStorageEntity.getRenderers().put(BlockReceiverStorageEntity.MISSING, new OBJRender(m)); + if (BlockButtonReceiverStorageEntity.getRenderers().containsKey(BlockButtonReceiverStorageEntity.MISSING)) { + OBJModel m = BlockButtonReceiverStorageEntity.getModels().get(BlockButtonReceiverStorageEntity.MISSING); + BlockButtonReceiverStorageEntity.getRenderers().put(BlockButtonReceiverStorageEntity.MISSING, new OBJRender(m)); } - renderer = BlockReceiverStorageEntity.getRenderers().get(BlockReceiverStorageEntity.MISSING); + renderer = BlockButtonReceiverStorageEntity.getRenderers().get(BlockButtonReceiverStorageEntity.MISSING); } } return renderer; @@ -66,8 +66,8 @@ public OBJRender getRenderer() { public float[] getTranslation() { if (defaultTranslation == null) { - if (entity.contentPackBlockId != null && BlockReceiverStorageEntity.getTranslations().containsKey(entity.contentPackBlockId)) - defaultTranslation = BlockReceiverStorageEntity.getTranslations().get(entity.contentPackBlockId); + if (entity.contentPackBlockId != null && BlockButtonReceiverStorageEntity.getTranslations().containsKey(entity.contentPackBlockId)) + defaultTranslation = BlockButtonReceiverStorageEntity.getTranslations().get(entity.contentPackBlockId); else defaultTranslation = new float[]{0.5f, 0, 0.5f}; } @@ -76,20 +76,20 @@ public float[] getTranslation() { public float[] getRotation() { if (defaultRotation == null) { - if (entity.contentPackBlockId != null && BlockReceiverStorageEntity.getRotations().containsKey(entity.contentPackBlockId)) - defaultRotation = BlockReceiverStorageEntity.getRotations().get(entity.contentPackBlockId); + if (entity.contentPackBlockId != null && BlockButtonReceiverStorageEntity.getRotations().containsKey(entity.contentPackBlockId)) + defaultRotation = BlockButtonReceiverStorageEntity.getRotations().get(entity.contentPackBlockId); else defaultRotation = new float[]{0, 0, 0}; } return defaultRotation; } - public static StandardModel render(BlockReceiverStorageEntity entity) { + public static StandardModel render(BlockButtonReceiverStorageEntity entity) { return new StandardModel().addCustom(partialTicks -> renderStuff(entity, partialTicks)); } @SuppressWarnings("java:S1172") - private static void renderStuff(BlockReceiverStorageEntity entity, float partialTicks) { + private static void renderStuff(BlockButtonReceiverStorageEntity entity, float partialTicks) { OBJModel model = entity.renderEntity.getModel(); OBJRender renderer = entity.renderEntity.getRenderer(); @@ -130,7 +130,7 @@ private static void renderStuff(BlockReceiverStorageEntity entity, float partial } } - private static void renderMarking(BlockReceiverStorageEntity entity) { + private static void renderMarking(BlockButtonReceiverStorageEntity entity) { float[] color = entity.getMarkedColor(); // 0.5 is edge of block diff --git a/src/main/java/net/landofrails/stellwand/content/entities/storage/BlockReceiverStorageEntity.java b/src/main/java/net/landofrails/stellwand/content/entities/storage/BlockButtonReceiverStorageEntity.java similarity index 92% rename from src/main/java/net/landofrails/stellwand/content/entities/storage/BlockReceiverStorageEntity.java rename to src/main/java/net/landofrails/stellwand/content/entities/storage/BlockButtonReceiverStorageEntity.java index 91303e2e..188a5108 100644 --- a/src/main/java/net/landofrails/stellwand/content/entities/storage/BlockReceiverStorageEntity.java +++ b/src/main/java/net/landofrails/stellwand/content/entities/storage/BlockButtonReceiverStorageEntity.java @@ -7,19 +7,19 @@ import cam72cam.mod.serialization.TagCompound; import cam72cam.mod.serialization.TagField; import net.landofrails.stellwand.Stellwand; -import net.landofrails.stellwand.content.entities.function.BlockReceiverFunctionEntity; -import net.landofrails.stellwand.content.entities.rendering.BlockReceiverRenderEntity; +import net.landofrails.stellwand.content.entities.function.BlockButtonReceiverFunctionEntity; +import net.landofrails.stellwand.content.entities.rendering.BlockButtonReceiverRenderEntity; import net.landofrails.stellwand.content.entities.storage.versionmapper.VersionMapper; import net.landofrails.stellwand.contentpacks.Content; +import net.landofrails.stellwand.contentpacks.entries.buttonreceiver.BlockReceiverEntryBlock; import net.landofrails.stellwand.contentpacks.entries.parent.ContentPackEntry; import net.landofrails.stellwand.contentpacks.entries.parent.ContentPackEntryBlock; -import net.landofrails.stellwand.contentpacks.entries.receiver.BlockReceiverEntryBlock; import net.landofrails.stellwand.utils.StellwandUtils; import java.util.HashMap; import java.util.Map; -public class BlockReceiverStorageEntity extends BlockReceiverFunctionEntity { +public class BlockButtonReceiverStorageEntity extends BlockButtonReceiverFunctionEntity { // Statics public static final String MISSING = "missing"; @@ -51,10 +51,10 @@ public class BlockReceiverStorageEntity extends BlockReceiverFunctionEntity { // Subclasses @SuppressWarnings({"java:S1104"}) - public BlockReceiverRenderEntity renderEntity; + public BlockButtonReceiverRenderEntity renderEntity; - public BlockReceiverStorageEntity() { - renderEntity = new BlockReceiverRenderEntity(this); + public BlockButtonReceiverStorageEntity() { + renderEntity = new BlockButtonReceiverRenderEntity(this); } @SuppressWarnings("java:S3252") diff --git a/src/main/java/net/landofrails/stellwand/content/items/CustomItems.java b/src/main/java/net/landofrails/stellwand/content/items/CustomItems.java index d7b7fe39..a555828f 100644 --- a/src/main/java/net/landofrails/stellwand/content/items/CustomItems.java +++ b/src/main/java/net/landofrails/stellwand/content/items/CustomItems.java @@ -4,6 +4,7 @@ import cam72cam.mod.render.ItemRender; import cam72cam.mod.resource.Identifier; import net.landofrails.stellwand.Stellwand; +import net.landofrails.stellwand.content.items.connector.ItemConnector; import net.landofrails.stellwand.utils.ICustomTexturePath; import java.util.ArrayList; @@ -26,7 +27,7 @@ private CustomItems() { public static final ItemBlockSignal ITEMBLOCKSIGNAL = new ItemBlockSignal(); public static final ItemBlockSender ITEMBLOCKSENDER = new ItemBlockSender(); public static final ItemBlockMultisignal ITEMBLOCKMULTISIGNAL = new ItemBlockMultisignal(); - public static final ItemBlockReceiver ITEMBLOCKRECEIVER = new ItemBlockReceiver(); + public static final ItemBlockButtonReceiver ITEMBLOCKRECEIVER = new ItemBlockButtonReceiver(); public static void register() { itemList.add(ITEMCONNECTOR1); @@ -38,7 +39,7 @@ public static void register() { ItemRender.register(ITEMBLOCKSIGNAL, ItemBlockSignal.getModelFor()); ItemRender.register(ITEMBLOCKSENDER, ItemBlockSender.getModelFor()); ItemRender.register(ITEMBLOCKMULTISIGNAL, ItemBlockMultisignal.getModelFor()); - ItemRender.register(ITEMBLOCKRECEIVER, ItemBlockReceiver.getModelFor()); + ItemRender.register(ITEMBLOCKRECEIVER, ItemBlockButtonReceiver.getModelFor()); } diff --git a/src/main/java/net/landofrails/stellwand/content/items/ItemBlockReceiver.java b/src/main/java/net/landofrails/stellwand/content/items/ItemBlockButtonReceiver.java similarity index 95% rename from src/main/java/net/landofrails/stellwand/content/items/ItemBlockReceiver.java rename to src/main/java/net/landofrails/stellwand/content/items/ItemBlockButtonReceiver.java index 5ce640f9..396a1cee 100644 --- a/src/main/java/net/landofrails/stellwand/content/items/ItemBlockReceiver.java +++ b/src/main/java/net/landofrails/stellwand/content/items/ItemBlockButtonReceiver.java @@ -20,7 +20,7 @@ import net.landofrails.landofsignals.LandOfSignals; import net.landofrails.stellwand.Stellwand; import net.landofrails.stellwand.content.blocks.CustomBlocks; -import net.landofrails.stellwand.content.entities.storage.BlockReceiverStorageEntity; +import net.landofrails.stellwand.content.entities.storage.BlockButtonReceiverStorageEntity; import net.landofrails.stellwand.content.guis.SelectItem; import net.landofrails.stellwand.content.network.ChangeHandHeldItem; import net.landofrails.stellwand.content.tabs.CustomTabs; @@ -33,7 +33,7 @@ import java.util.*; import java.util.stream.Collectors; -public class ItemBlockReceiver extends CustomItem { +public class ItemBlockButtonReceiver extends CustomItem { private static final String ITEMID = "itemId"; @@ -46,8 +46,8 @@ public class ItemBlockReceiver extends CustomItem { private static Map scales = new HashMap<>(); private static Map modes = new HashMap<>(); - public ItemBlockReceiver() { - super(LandOfSignals.MODID, "stellwand.itemblockreceiver"); + public ItemBlockButtonReceiver() { + super(LandOfSignals.MODID, "stellwand.itemblockbuttonreceiver"); } // Only for Clientside @@ -148,7 +148,7 @@ public static ItemRender.IItemModel getModelFor() { return (world, stack) -> new StandardModel().addCustom(() -> { - ItemBlockReceiver.init(); + ItemBlockButtonReceiver.init(); TagCompound tag = stack.getTagCompound(); String itemId = tag.getString(ITEMID); @@ -217,8 +217,8 @@ public ClickResult onClickBlock(Player player, World world, Vec3i pos, Player.Ha is.shrink(1); player.setHeldItem(hand, is); } - BlockReceiverStorageEntity blockEntity = world.getBlockEntity(target, - BlockReceiverStorageEntity.class); + BlockButtonReceiverStorageEntity blockEntity = world.getBlockEntity(target, + BlockButtonReceiverStorageEntity.class); // Set ContentPackBlockId ItemStack item = player.getHeldItem(hand); TagCompound tag = item.getTagCompound(); diff --git a/src/main/java/net/landofrails/stellwand/content/items/connector/AItemConnector.java b/src/main/java/net/landofrails/stellwand/content/items/connector/AItemConnector.java new file mode 100644 index 00000000..2aa5c828 --- /dev/null +++ b/src/main/java/net/landofrails/stellwand/content/items/connector/AItemConnector.java @@ -0,0 +1,96 @@ +package net.landofrails.stellwand.content.items.connector; + +import cam72cam.mod.entity.Player; +import cam72cam.mod.math.Vec3i; +import cam72cam.mod.serialization.TagCompound; +import cam72cam.mod.world.World; + +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiPredicate; + +public abstract class AItemConnector { + + private static final Map, BiPredicate> CONNECTORS = new HashMap<>(); + + private static final long serialVersionUID = -4963471115414960689L; + private static final String KEY_ISCLIENT = "isClient"; + private static final String KEY_WORLD = "world"; + private static final String KEY_POS = "pos"; + + public static void registerConnector(Class connector, BiPredicate isConnectable) { + CONNECTORS.put(connector, isConnectable); + } + + public static boolean suitableConnectorExists(World world, Vec3i pos) { + return CONNECTORS.values().stream().anyMatch(c -> c.test(world, pos)); + } + + public static AItemConnector getConnector(World world, Vec3i pos) { + Class clazz = getImplementor(world, pos); + + if (clazz != null) { + try { + TagCompound tag = worldPosTag(world, pos); + return clazz.getDeclaredConstructor(TagCompound.class).newInstance(tag); + } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { + e.printStackTrace(); + } + } + + return null; + } + + public static Class getImplementor(World world, Vec3i pos) { + return CONNECTORS.entrySet().stream().filter(es -> es.getValue().test(world, pos)).map(Map.Entry::getKey).findFirst().orElse(null); + } + + // Connector + + protected AItemConnector() { + + } + + protected AItemConnector(TagCompound tag) { + if (tag != null && !tag.isEmpty()) { + Boolean isClient = tag.getBoolean(KEY_ISCLIENT); + this.world = tag.getWorld(KEY_WORLD, isClient); + this.pos = tag.getVec3i(KEY_POS); + } + } + + private World world; + private Vec3i pos; + + public World getWorld() { + return world; + } + + public void setWorld(World world) { + this.world = world; + } + + public Vec3i getPos() { + return pos; + } + + public void setPos(Vec3i pos) { + this.pos = pos; + } + + public TagCompound toTag() { + return worldPosTag(world, pos); + } + + protected static TagCompound worldPosTag(World world, Vec3i pos) { + TagCompound tag = new TagCompound(); + tag.setBoolean(KEY_ISCLIENT, world.isClient); + tag.setWorld(KEY_WORLD, world); + tag.setVec3i(KEY_POS, pos); + return tag; + } + + protected abstract boolean connect(World world, Vec3i pos, Player player, Player.Hand hand); + +} diff --git a/src/main/java/net/landofrails/stellwand/content/items/ItemConnector.java b/src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnector.java similarity index 78% rename from src/main/java/net/landofrails/stellwand/content/items/ItemConnector.java rename to src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnector.java index 56e0124c..73b3a9a1 100644 --- a/src/main/java/net/landofrails/stellwand/content/items/ItemConnector.java +++ b/src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnector.java @@ -1,5 +1,6 @@ -package net.landofrails.stellwand.content.items; +package net.landofrails.stellwand.content.items.connector; +import cam72cam.mod.block.BlockEntity; import cam72cam.mod.entity.Player; import cam72cam.mod.entity.Player.Hand; import cam72cam.mod.item.ClickResult; @@ -13,6 +14,7 @@ import cam72cam.mod.world.World; import net.landofrails.landofsignals.LandOfSignals; import net.landofrails.stellwand.content.entities.storage.BlockSenderStorageEntity; +import net.landofrails.stellwand.content.items.CustomItems; import net.landofrails.stellwand.content.messages.EMessage; import net.landofrails.stellwand.content.network.ServerMessagePacket; import net.landofrails.stellwand.content.tabs.CustomTabs; @@ -23,12 +25,14 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Objects; public class ItemConnector extends CustomItem implements ICustomTexturePath { // Constants private static final String SENDERKEY = "senderPos"; private static final String SIGNALKEY = "signalPos"; + // private int variation; @@ -75,7 +79,20 @@ public void onClickAir(Player player, World world, Hand hand) { public ClickResult onClickBlock(Player player, World world, Vec3i pos, Hand hand, Facing facing, Vec3d inBlockPos) { - ItemStack itemStack = player.getHeldItem(hand); + if (world.isServer) { + LoSPlayer p = new LoSPlayer(player); + if (ConnectionHandler.Checker.isConnectable(world, pos)) { + ItemStack itemStack = player.getHeldItem(hand); + + return Objects.requireNonNull(ConnectionHandler.Connector.connect(p, world, pos, itemStack), "ConnectionHandler should not return null!"); + } else { + ServerMessagePacket.send(player, EMessage.MESSAGE_BLOCK_NOT_CONNECTABLE); + return ClickResult.REJECTED; + } + } else { + return ClickResult.PASS; + } + if (itemStack.is(CustomItems.ITEMCONNECTOR1)) { return onClickBlockWithItemConnector1(player, world, hand, pos); @@ -144,6 +161,14 @@ private ClickResult onClickBlockWithItemConnector2(Player player, World world, H SignalContainer signalEntity = getSignal(world, pos); BlockSenderStorageEntity senderEntity = getSender(world, pos); + for (Class clazz : connectableClasses) { + if (IConnectable.class.isAssignableFrom(clazz)) { + if (world.hasBlockEntity(pos, clazz)) { + connect(clazz, world, pos, itemStack, p, hand); + } + } + } + if (signalEntity != null && nbt.hasKey(SENDERKEY)) { Vec3i senderPos = nbt.getVec3i(SENDERKEY); boolean d = player.isCrouching(); @@ -164,6 +189,22 @@ private ClickResult onClickBlockWithItemConnector2(Player player, World world, H return ClickResult.PASS; } + private static void connect(Class clazz, World world, Vec3i pos, ItemStack connector, LoSPlayer p, Player.Hand hand) { + + if (connector.is(CustomItems.ITEMCONNECTOR1)) { + return onClickBlockWithItemConnector1(p, world, hand, pos); + } else if (connector.is(CustomItems.ITEMCONNECTOR2)) { + return onClickBlockWithItemConnector2(p, world, hand, pos); + } else if (connector.is(CustomItems.ITEMCONNECTOR3)) { + return onClickBlockWithItemConnector3(p, world, hand, pos); + } + + T blockEntity = world.getBlockEntity(pos, clazz); + if (blockEntity instanceof IConnectable) { + ((IConnectable) blockEntity).tryConnect(connector, 0, p, hand); + } + } + // Helper public SignalContainer getSignal(World world, Vec3i pos) { diff --git a/src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnectorSender.java b/src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnectorSender.java new file mode 100644 index 00000000..f1eefb8f --- /dev/null +++ b/src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnectorSender.java @@ -0,0 +1,4 @@ +package net.landofrails.stellwand.content.items.connector; + +public class ItemConnectorSender { +} diff --git a/src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnectorSignal.java b/src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnectorSignal.java new file mode 100644 index 00000000..2657b2c4 --- /dev/null +++ b/src/main/java/net/landofrails/stellwand/content/items/connector/ItemConnectorSignal.java @@ -0,0 +1,33 @@ +package net.landofrails.stellwand.content.items.connector; + +import cam72cam.mod.entity.Player; +import cam72cam.mod.math.Vec3i; +import cam72cam.mod.serialization.TagCompound; +import cam72cam.mod.world.World; +import net.landofrails.stellwand.utils.compact.SignalContainer; + +public class ItemConnectorSignal extends AItemConnector { + private static final long serialVersionUID = -7946475502287227609L; + + static { + AItemConnector.registerConnector(ItemConnectorSignal.class, ItemConnectorSignal::isConnectable); + } + + public ItemConnectorSignal() { + super(); + } + + public ItemConnectorSignal(TagCompound tag) { + super(tag); + } + + private static Boolean isConnectable(World world, Vec3i pos) { + return SignalContainer.isSignal(world, pos); + } + + @Override + protected boolean connect(World world, Vec3i pos, Player player, Player.Hand hand) { + return false; + } + +} diff --git a/src/main/java/net/landofrails/stellwand/content/messages/EMessage.java b/src/main/java/net/landofrails/stellwand/content/messages/EMessage.java index 13dc3501..83432d02 100644 --- a/src/main/java/net/landofrails/stellwand/content/messages/EMessage.java +++ b/src/main/java/net/landofrails/stellwand/content/messages/EMessage.java @@ -19,6 +19,7 @@ public enum EMessage { MESSAGE_SIGNALS_MUST_BE_EQUAL("connector.sendersignalsmustbeequal"), MESSAGE_NEW_SIGNAL_SELECTED("connector.newsignalselected"), MESSAGE_NEW_SENDER_SELECTED("connector.newsenderselected"), + MESSAGE_BLOCK_NOT_CONNECTABLE("connector.blocknotconnectable"), // GUI GUI_STELLWAND_SELECTSENDERMODES_GROUP("gui." + Stellwand.DOMAIN + ":selectsendermodes.group", true); diff --git a/src/main/java/net/landofrails/stellwand/contentpacks/entries/receiver/BlockReceiverEntry.java b/src/main/java/net/landofrails/stellwand/contentpacks/entries/buttonreceiver/BlockReceiverEntry.java similarity index 93% rename from src/main/java/net/landofrails/stellwand/contentpacks/entries/receiver/BlockReceiverEntry.java rename to src/main/java/net/landofrails/stellwand/contentpacks/entries/buttonreceiver/BlockReceiverEntry.java index 8e700f4c..fc516f61 100644 --- a/src/main/java/net/landofrails/stellwand/contentpacks/entries/receiver/BlockReceiverEntry.java +++ b/src/main/java/net/landofrails/stellwand/contentpacks/entries/buttonreceiver/BlockReceiverEntry.java @@ -1,4 +1,4 @@ -package net.landofrails.stellwand.contentpacks.entries.receiver; +package net.landofrails.stellwand.contentpacks.entries.buttonreceiver; import net.landofrails.stellwand.contentpacks.entries.parent.ContentPackEntry; import net.landofrails.stellwand.contentpacks.entries.parent.ContentPackEntryBlock; diff --git a/src/main/java/net/landofrails/stellwand/contentpacks/entries/receiver/BlockReceiverEntryBlock.java b/src/main/java/net/landofrails/stellwand/contentpacks/entries/buttonreceiver/BlockReceiverEntryBlock.java similarity index 89% rename from src/main/java/net/landofrails/stellwand/contentpacks/entries/receiver/BlockReceiverEntryBlock.java rename to src/main/java/net/landofrails/stellwand/contentpacks/entries/buttonreceiver/BlockReceiverEntryBlock.java index 4f80f37b..ed996413 100644 --- a/src/main/java/net/landofrails/stellwand/contentpacks/entries/receiver/BlockReceiverEntryBlock.java +++ b/src/main/java/net/landofrails/stellwand/contentpacks/entries/buttonreceiver/BlockReceiverEntryBlock.java @@ -1,4 +1,4 @@ -package net.landofrails.stellwand.contentpacks.entries.receiver; +package net.landofrails.stellwand.contentpacks.entries.buttonreceiver; import net.landofrails.stellwand.contentpacks.entries.parent.ContentPackEntryBlock; diff --git a/src/main/java/net/landofrails/stellwand/contentpacks/entries/receiver/BlockReceiverEntryItem.java b/src/main/java/net/landofrails/stellwand/contentpacks/entries/buttonreceiver/BlockReceiverEntryItem.java similarity index 82% rename from src/main/java/net/landofrails/stellwand/contentpacks/entries/receiver/BlockReceiverEntryItem.java rename to src/main/java/net/landofrails/stellwand/contentpacks/entries/buttonreceiver/BlockReceiverEntryItem.java index c7d67169..9635a896 100644 --- a/src/main/java/net/landofrails/stellwand/contentpacks/entries/receiver/BlockReceiverEntryItem.java +++ b/src/main/java/net/landofrails/stellwand/contentpacks/entries/buttonreceiver/BlockReceiverEntryItem.java @@ -1,4 +1,4 @@ -package net.landofrails.stellwand.contentpacks.entries.receiver; +package net.landofrails.stellwand.contentpacks.entries.buttonreceiver; import net.landofrails.stellwand.contentpacks.entries.parent.ContentPackEntryItem; diff --git a/src/main/java/net/landofrails/stellwand/contentpacks/loader/StaticLoader.java b/src/main/java/net/landofrails/stellwand/contentpacks/loader/StaticLoader.java index abbfca70..64180671 100644 --- a/src/main/java/net/landofrails/stellwand/contentpacks/loader/StaticLoader.java +++ b/src/main/java/net/landofrails/stellwand/contentpacks/loader/StaticLoader.java @@ -12,9 +12,9 @@ import net.landofrails.stellwand.contentpacks.entries.multisignal.BlockMultisignalEntryBlock; import net.landofrails.stellwand.contentpacks.entries.multisignal.BlockMultisignalEntryItem; import net.landofrails.stellwand.contentpacks.entries.parent.ContentPackEntry; -import net.landofrails.stellwand.contentpacks.entries.receiver.BlockReceiverEntry; -import net.landofrails.stellwand.contentpacks.entries.receiver.BlockReceiverEntryBlock; -import net.landofrails.stellwand.contentpacks.entries.receiver.BlockReceiverEntryItem; +import net.landofrails.stellwand.contentpacks.entries.buttonreceiver.BlockReceiverEntry; +import net.landofrails.stellwand.contentpacks.entries.buttonreceiver.BlockReceiverEntryBlock; +import net.landofrails.stellwand.contentpacks.entries.buttonreceiver.BlockReceiverEntryItem; import net.landofrails.stellwand.contentpacks.entries.sender.BlockSenderEntry; import net.landofrails.stellwand.contentpacks.entries.sender.BlockSenderEntryBlock; import net.landofrails.stellwand.contentpacks.entries.sender.BlockSenderEntryItem; @@ -255,7 +255,7 @@ private static List getEntries() { // Blockreceiver prop = new Properties().setName("Blockreceiver"); - prop.setType(EntryType.BLOCKRECEIVER); + prop.setType(EntryType.BLOCKRECEIVER).setWallMountable(true); prop.setModel("models/block/blockreceiver/blockreceiver/blockreceiver.obj"); prop.setBlockTranslation(.5f, 0, .5f); prop.setItemMode("on").setItemTranslation(.5f, .1625f, .5f); diff --git a/src/main/java/net/landofrails/stellwand/contentpacks/types/EntryType.java b/src/main/java/net/landofrails/stellwand/contentpacks/types/EntryType.java index f753e4ef..001bbada 100644 --- a/src/main/java/net/landofrails/stellwand/contentpacks/types/EntryType.java +++ b/src/main/java/net/landofrails/stellwand/contentpacks/types/EntryType.java @@ -3,7 +3,7 @@ import net.landofrails.stellwand.contentpacks.entries.filler.BlockFillerEntry; import net.landofrails.stellwand.contentpacks.entries.multisignal.BlockMultisignalEntry; import net.landofrails.stellwand.contentpacks.entries.parent.ContentPackEntry; -import net.landofrails.stellwand.contentpacks.entries.receiver.BlockReceiverEntry; +import net.landofrails.stellwand.contentpacks.entries.buttonreceiver.BlockReceiverEntry; import net.landofrails.stellwand.contentpacks.entries.sender.BlockSenderEntry; import net.landofrails.stellwand.contentpacks.entries.signal.BlockSignalEntry; diff --git a/src/main/resources/assets/landofsignals/lang/de_DE.lang b/src/main/resources/assets/landofsignals/lang/de_DE.lang index ec47b17d..f9feb663 100644 --- a/src/main/resources/assets/landofsignals/lang/de_DE.lang +++ b/src/main/resources/assets/landofsignals/lang/de_DE.lang @@ -41,5 +41,6 @@ message.stellwand:connector.signalconnected=Signal verbunden! message.stellwand:connector.sendersignalsmustbeequal=Du kannst nur Signale des gleichen Types an einen Sender verbinden! message.stellwand:connector.newsignalselected=Neues Signal ausgewählt! (%s, %s, %s) message.stellwand:connector.newsenderselected=Neuer Sender ausgewählt! (%s, %s, %s) +message.stellwand:connector.blocknotconnectable=Dieser Block lässt sich nicht verbinden! gui.stellwand:selectsendermodes.group=Gruppe: %s \ No newline at end of file diff --git a/src/main/resources/assets/landofsignals/lang/en_US.lang b/src/main/resources/assets/landofsignals/lang/en_US.lang index 52d7f715..c7fa24b3 100644 --- a/src/main/resources/assets/landofsignals/lang/en_US.lang +++ b/src/main/resources/assets/landofsignals/lang/en_US.lang @@ -41,5 +41,6 @@ message.stellwand:connector.signalconnected=Signal connected! message.stellwand:connector.sendersignalsmustbeequal=You only can connect the same type of signal with a sender! message.stellwand:connector.newsignalselected=New signal selected! (%s, %s, %s) message.stellwand:connector.newsenderselected=New sender selected! (%s, %s, %s) +message.stellwand:connector.blocknotconnectable=This block is not connectable! gui.stellwand:selectsendermodes.group=Group: %s \ No newline at end of file diff --git a/src/main/resources/assets/stellwand/models/block/blockbutton/blockbutton/blockbutton.bbmodel b/src/main/resources/assets/stellwand/models/block/blockbutton/blockbutton/blockbutton.bbmodel new file mode 100644 index 00000000..80e69cb2 --- /dev/null +++ b/src/main/resources/assets/stellwand/models/block/blockbutton/blockbutton/blockbutton.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"3.6","creation_time":1633986873,"model_format":"free","box_uv":false},"name":"blockbutton","geometry_name":"","visible_box":[1,1,0],"resolution":{"width":16,"height":16},"elements":[{"name":"generalMount","rescale":false,"from":[-0.5,7.5,6],"to":[0.5,8.5,8],"autouv":1,"color":0,"locked":false,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,1,1],"texture":0},"east":{"uv":[0,0,2,1],"texture":0},"south":{"uv":[0,0,1,1],"texture":0},"west":{"uv":[0,0,2,1],"texture":0},"up":{"uv":[0,0,1,2],"texture":0},"down":{"uv":[0,0,1,2],"texture":0}},"uuid":"5bf25c79-c349-aec6-a67c-fd5da24baaea"},{"name":"offButton","rescale":false,"from":[-1,7,4],"to":[1,9,6],"autouv":1,"color":1,"locked":false,"visibility":false,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,2,2],"texture":1},"east":{"uv":[0,0,2,2],"texture":1},"south":{"uv":[0,0,2,2],"texture":1},"west":{"uv":[0,0,2,2],"texture":1},"up":{"uv":[0,0,2,2],"texture":1},"down":{"uv":[0,0,2,2],"texture":1}},"uuid":"d1974c16-4a0a-aa3a-3b0c-48c8fac6f5ed"},{"name":"onButton","rescale":false,"from":[-1,7,4.5],"to":[1,9,6.5],"autouv":1,"color":1,"locked":false,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,2,2],"texture":2},"east":{"uv":[0,0,2,2],"texture":2},"south":{"uv":[0,0,2,2],"texture":2},"west":{"uv":[0,0,2,2],"texture":2},"up":{"uv":[0,0,2,2],"texture":2},"down":{"uv":[0,0,2,2],"texture":2}},"uuid":"038c14bd-5cd4-949e-a0ec-91e4971ff457"}],"outliner":["5bf25c79-c349-aec6-a67c-fd5da24baaea","d1974c16-4a0a-aa3a-3b0c-48c8fac6f5ed","038c14bd-5cd4-949e-a0ec-91e4971ff457"],"textures":[{"path":"","name":"gray","folder":"block","namespace":"","id":"0","particle":false,"visible":true,"mode":"bitmap","saved":false,"uuid":"009d013a-8ea5-7d51-ad5c-cb7fb847bd32","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAHklEQVQ4T2Nsb2//z0ABYBw1gGE0DBhGw4BhWIQBAMAAKVGF2FCzAAAAAElFTkSuQmCC"},{"path":"","name":"green_off","folder":"block","namespace":"","id":"1","particle":false,"visible":true,"mode":"bitmap","saved":false,"uuid":"d48b0982-bac0-71e0-039e-30c727bd0a9c","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAHklEQVQ4T2P0LGf4z0ABYBw1gGE0DBhGw4BhWIQBACJkHAFWdCoRAAAAAElFTkSuQmCC"},{"path":"","name":"green_on","folder":"block","namespace":"","id":"2","particle":false,"visible":true,"mode":"bitmap","saved":false,"uuid":"7200682e-eb0c-de92-f975-7c275ecee56c","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAHklEQVQ4T2Oc9Ej0PwMFgHHUAIbRMGAYDQOGYREGACrhKJECyxAXAAAAAElFTkSuQmCC"}]} \ No newline at end of file diff --git a/src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/blockreceiver.bbmodel b/src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/blockreceiver.bbmodel similarity index 100% rename from src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/blockreceiver.bbmodel rename to src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/blockreceiver.bbmodel diff --git a/src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/blockreceiver.mtl b/src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/blockreceiver.mtl similarity index 100% rename from src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/blockreceiver.mtl rename to src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/blockreceiver.mtl diff --git a/src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/blockreceiver.obj b/src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/blockreceiver.obj similarity index 100% rename from src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/blockreceiver.obj rename to src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/blockreceiver.obj diff --git a/src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/iron_bars.png b/src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/iron_bars.png similarity index 100% rename from src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/iron_bars.png rename to src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/iron_bars.png diff --git a/src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/smooth_stone.png b/src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/smooth_stone.png similarity index 100% rename from src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/smooth_stone.png rename to src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/smooth_stone.png diff --git a/src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/smooth_stone_off.png b/src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/smooth_stone_off.png similarity index 100% rename from src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/smooth_stone_off.png rename to src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/smooth_stone_off.png diff --git a/src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/smooth_stone_on.png b/src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/smooth_stone_on.png similarity index 100% rename from src/main/resources/assets/stellwand/models/block/blockreceiver/blockreceiver/smooth_stone_on.png rename to src/main/resources/assets/stellwand/models/block/blockbuttonreceiver/blockbuttonreceiver/smooth_stone_on.png