From 2d525f3c7fef5b01b9b81d220857a5d4d86cccea Mon Sep 17 00:00:00 2001 From: zontreck Date: Wed, 24 Apr 2024 04:24:16 -0700 Subject: [PATCH] Get creeperheal to properly log blocks in the database, using the new queue system. --- build.gradle | 2 + gradle.properties | 2 +- .../0dd424b1f6e76c7253bc0752a6cda5cc982b6cc2 | 5 +- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 4 +- .../blockstates/tflipflop.json | 64 ++++++ .../models/block/tflipflop.json | 3 + .../models/item/tflipflop.json | 3 + ...astor_corner_block.json => tflipflop.json} | 4 +- .../zontreck/essentials/AriasEssentials.java | 4 + .../antiexplode/CreeperHealQueue.java | 27 ++- .../zontreck/essentials/blocks/ModBlocks.java | 4 + .../blocks/logicgates/TFlipFlopBlock.java | 75 +++++++ .../configs/server/AEServerConfig.java | 12 +- .../configs/server/sections/CreeperHeal.java | 67 +++++++ .../data/ModBlockStatesProvider.java | 2 + .../data/loot/ModBlockLootTablesProvider.java | 2 + .../dev/zontreck/essentials/imc/Events.java | 32 ++- .../assets/ariasessentials/lang/en_us.json | 1 + .../logicgates/redstone_tflipflop.bbmodel | 1 + .../models/block/logicgates/tflipflop.json | 187 ++++++++++++++++++ .../textures/block/logicgates/locked_bar.png | Bin 0 -> 115 bytes .../textures/block/logicgates/logic_gate.png | Bin 0 -> 265 bytes .../textures/block/logicgates/off.png | Bin 0 -> 73 bytes .../textures/block/logicgates/tflipflop.png | Bin 0 -> 341 bytes .../textures/block/logicgates/torch.png | Bin 0 -> 330 bytes 25 files changed, 492 insertions(+), 9 deletions(-) create mode 100644 src/generated/resources/assets/ariasessentials/blockstates/tflipflop.json create mode 100644 src/generated/resources/assets/ariasessentials/models/block/tflipflop.json create mode 100644 src/generated/resources/assets/ariasessentials/models/item/tflipflop.json rename src/generated/resources/data/ariasessentials/loot_tables/blocks/{clinker_brick_sastor_corner_block.json => tflipflop.json} (66%) create mode 100644 src/main/java/dev/zontreck/essentials/blocks/logicgates/TFlipFlopBlock.java create mode 100644 src/main/java/dev/zontreck/essentials/configs/server/sections/CreeperHeal.java create mode 100644 src/main/resources/assets/ariasessentials/models/block/logicgates/redstone_tflipflop.bbmodel create mode 100644 src/main/resources/assets/ariasessentials/models/block/logicgates/tflipflop.json create mode 100644 src/main/resources/assets/ariasessentials/textures/block/logicgates/locked_bar.png create mode 100644 src/main/resources/assets/ariasessentials/textures/block/logicgates/logic_gate.png create mode 100644 src/main/resources/assets/ariasessentials/textures/block/logicgates/off.png create mode 100644 src/main/resources/assets/ariasessentials/textures/block/logicgates/tflipflop.png create mode 100644 src/main/resources/assets/ariasessentials/textures/block/logicgates/torch.png diff --git a/build.gradle b/build.gradle index bb6a1fc..202f799 100644 --- a/build.gradle +++ b/build.gradle @@ -157,6 +157,8 @@ dependencies { // then special handling is done to allow a setup of a vanilla dependency without the use of an external repository. minecraft "net.neoforged:forge:${minecraft_version}-${neo_version}" + runtimeOnly fg.deobf("maven.modrinth:mariadb-jdbc:3.1.4+20230506") + implementation fg.deobf("dev.zontreck:LibZontreckMod:${libzontreck}") // Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime diff --git a/gradle.properties b/gradle.properties index 14ddb30..43c83a6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false -libzontreck=1201.13.041224.0832 +libzontreck=1201.13.042424.0415 ## Environment Properties diff --git a/src/generated/resources/.cache/0dd424b1f6e76c7253bc0752a6cda5cc982b6cc2 b/src/generated/resources/.cache/0dd424b1f6e76c7253bc0752a6cda5cc982b6cc2 index 4b49e46..0c5cdbe 100644 --- a/src/generated/resources/.cache/0dd424b1f6e76c7253bc0752a6cda5cc982b6cc2 +++ b/src/generated/resources/.cache/0dd424b1f6e76c7253bc0752a6cda5cc982b6cc2 @@ -1,4 +1,4 @@ -// 1.20.1 2024-03-03T19:44:16.098572878 Block States: ariasessentials +// 1.20.1 2024-04-23T21:56:19.854483943 Block States: ariasessentials ae2f6cd918bd461be7fb693641eaa5b78410b538 assets/ariasessentials/blockstates/clinker_brick_block.json f48474f63edb825feaa3cc2c990ecd5ed6909c74 assets/ariasessentials/blockstates/clinker_brick_slab.json 5b501afd2a40c586b6811b9784ca2cd1a2dba373 assets/ariasessentials/blockstates/clinker_brick_stained_block.json @@ -34,6 +34,7 @@ acdba80ab9bebc435f3cfdc80f845fa942eaf1d4 assets/ariasessentials/blockstates/stee b2076aa8074c942d074509a3ee27df350f81ab0f assets/ariasessentials/blockstates/steel_floor_grating_top.json a637df1cfe9b47f5691beb585ad9e7f72a8a641b assets/ariasessentials/blockstates/steel_railing.json 7c667fb64bd412a080e1d92d9b7e194ef1a7cb25 assets/ariasessentials/blockstates/steel_table.json +1bef53c224409e06091b0f9da5407589e173845b assets/ariasessentials/blockstates/tflipflop.json e03106a0ee60bc58f97f5cc3b1ad921f245c99dd assets/ariasessentials/models/block/clinker_brick_block_model0.json d777dea2873725f45fadd678d411040f530f8f58 assets/ariasessentials/models/block/clinker_brick_block_model1.json c480c6d87ce48bdf5d6fbb846a9c435a5c263c06 assets/ariasessentials/models/block/clinker_brick_block_model2.json @@ -391,6 +392,7 @@ c33b748f6f17358bd7d58374caea829f5af46c8d assets/ariasessentials/models/block/ste e7f3120933bf9c3e48b630a6451cbadc3cfb49cb assets/ariasessentials/models/block/steel_floor_grating_top.json 711b9bb46c9847800562b02eb8cb83ad18e9cc82 assets/ariasessentials/models/block/steel_railing.json 8f302a21d929580d8500d08ebb54ad6b98071de2 assets/ariasessentials/models/block/steel_table.json +585d5b3662ac26492f4e06ba82306930f94ae07e assets/ariasessentials/models/block/tflipflop.json 4fca23a45d563abf5cf473dc0d1c245d48174b2a assets/ariasessentials/models/item/clinker_brick_block.json e4ed8c1d0d0f321a19c7e72b059778bbbc9b38b5 assets/ariasessentials/models/item/clinker_brick_slab.json 4fbbce22895215e022ceed79aada64c3a498da6a assets/ariasessentials/models/item/clinker_brick_stained_block.json @@ -426,3 +428,4 @@ cf2fb18ac1885dc8d29dd6910a480e6df6f0159a assets/ariasessentials/models/item/stee 609df26ad277d9ed6f9e10a8c03d828136dd8cbb assets/ariasessentials/models/item/steel_floor_grating_top.json ac717f3bc13cb5de4400d736175cacc91f525bdc assets/ariasessentials/models/item/steel_railing.json 18a59a078fccb7d9a638033aa76c5175d4abaa01 assets/ariasessentials/models/item/steel_table.json +fadd2e7bba0010cc7e3c0139ffda671a728ebe3f assets/ariasessentials/models/item/tflipflop.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index 4d4f0dd..b9bc179 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,7 +1,6 @@ -// 1.20.1 2024-03-03T19:41:24.288854196 Loot Tables +// 1.20.1 2024-04-23T21:53:46.136412523 Loot Tables 2b4a329fcd0a69fdad6c43120bd5de86ad0565af data/ariasessentials/loot_tables/blocks/clinker_brick_block.json 1ec32912180bc6bc4127ed7ddba8be226035858c data/ariasessentials/loot_tables/blocks/clinker_brick_recessed.json -006e62eaf1f971fd385a92b5d6b5477d032c88e3 data/ariasessentials/loot_tables/blocks/clinker_brick_sastor_corner_block.json f9732252ea209ddd741e2b993a1e8917dd2ea889 data/ariasessentials/loot_tables/blocks/clinker_brick_slab.json 1ebd50d212ef1833facb449ff4926ca684238f5f data/ariasessentials/loot_tables/blocks/clinker_brick_stained_block.json 28f5cc93c182169e183435e963ed928c69a225d9 data/ariasessentials/loot_tables/blocks/clinker_brick_stained_slab.json @@ -37,3 +36,4 @@ b5b1ddda0fb43e0b553667d8fc7b7a036a0c5150 data/ariasessentials/loot_tables/blocks 54db4e8dce7f9d4b654de37cb16f7e292cb4fac9 data/ariasessentials/loot_tables/blocks/steel_floor_grating_top.json 7716ab37ac37d21bcb205d283bda1658f75a2df8 data/ariasessentials/loot_tables/blocks/steel_railing.json 878361275ccef96377190d00986722463f8da79c data/ariasessentials/loot_tables/blocks/steel_table.json +9f87deac2a9b034e2b571cf6113bc9ffd90e778e data/ariasessentials/loot_tables/blocks/tflipflop.json diff --git a/src/generated/resources/assets/ariasessentials/blockstates/tflipflop.json b/src/generated/resources/assets/ariasessentials/blockstates/tflipflop.json new file mode 100644 index 0000000..9cf31bf --- /dev/null +++ b/src/generated/resources/assets/ariasessentials/blockstates/tflipflop.json @@ -0,0 +1,64 @@ +{ + "variants": { + "facing=east,input_power=false,powered=false": { + "model": "ariasessentials:block/tflipflop", + "y": 90 + }, + "facing=east,input_power=false,powered=true": { + "model": "ariasessentials:block/tflipflop", + "y": 90 + }, + "facing=east,input_power=true,powered=false": { + "model": "ariasessentials:block/tflipflop", + "y": 90 + }, + "facing=east,input_power=true,powered=true": { + "model": "ariasessentials:block/tflipflop", + "y": 90 + }, + "facing=north,input_power=false,powered=false": { + "model": "ariasessentials:block/tflipflop" + }, + "facing=north,input_power=false,powered=true": { + "model": "ariasessentials:block/tflipflop" + }, + "facing=north,input_power=true,powered=false": { + "model": "ariasessentials:block/tflipflop" + }, + "facing=north,input_power=true,powered=true": { + "model": "ariasessentials:block/tflipflop" + }, + "facing=south,input_power=false,powered=false": { + "model": "ariasessentials:block/tflipflop", + "y": 180 + }, + "facing=south,input_power=false,powered=true": { + "model": "ariasessentials:block/tflipflop", + "y": 180 + }, + "facing=south,input_power=true,powered=false": { + "model": "ariasessentials:block/tflipflop", + "y": 180 + }, + "facing=south,input_power=true,powered=true": { + "model": "ariasessentials:block/tflipflop", + "y": 180 + }, + "facing=west,input_power=false,powered=false": { + "model": "ariasessentials:block/tflipflop", + "y": 270 + }, + "facing=west,input_power=false,powered=true": { + "model": "ariasessentials:block/tflipflop", + "y": 270 + }, + "facing=west,input_power=true,powered=false": { + "model": "ariasessentials:block/tflipflop", + "y": 270 + }, + "facing=west,input_power=true,powered=true": { + "model": "ariasessentials:block/tflipflop", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/ariasessentials/models/block/tflipflop.json b/src/generated/resources/assets/ariasessentials/models/block/tflipflop.json new file mode 100644 index 0000000..ab49651 --- /dev/null +++ b/src/generated/resources/assets/ariasessentials/models/block/tflipflop.json @@ -0,0 +1,3 @@ +{ + "parent": "ariasessentials:block/logicgates/tflipflop" +} \ No newline at end of file diff --git a/src/generated/resources/assets/ariasessentials/models/item/tflipflop.json b/src/generated/resources/assets/ariasessentials/models/item/tflipflop.json new file mode 100644 index 0000000..9e4200e --- /dev/null +++ b/src/generated/resources/assets/ariasessentials/models/item/tflipflop.json @@ -0,0 +1,3 @@ +{ + "parent": "ariasessentials:block/tflipflop" +} \ No newline at end of file diff --git a/src/generated/resources/data/ariasessentials/loot_tables/blocks/clinker_brick_sastor_corner_block.json b/src/generated/resources/data/ariasessentials/loot_tables/blocks/tflipflop.json similarity index 66% rename from src/generated/resources/data/ariasessentials/loot_tables/blocks/clinker_brick_sastor_corner_block.json rename to src/generated/resources/data/ariasessentials/loot_tables/blocks/tflipflop.json index 9085923..0db794a 100644 --- a/src/generated/resources/data/ariasessentials/loot_tables/blocks/clinker_brick_sastor_corner_block.json +++ b/src/generated/resources/data/ariasessentials/loot_tables/blocks/tflipflop.json @@ -11,11 +11,11 @@ "entries": [ { "type": "minecraft:item", - "name": "ariasessentials:clinker_brick_sastor_corner_block" + "name": "ariasessentials:tflipflop" } ], "rolls": 1.0 } ], - "random_sequence": "ariasessentials:blocks/clinker_brick_sastor_corner_block" + "random_sequence": "ariasessentials:blocks/tflipflop" } \ No newline at end of file diff --git a/src/main/java/dev/zontreck/essentials/AriasEssentials.java b/src/main/java/dev/zontreck/essentials/AriasEssentials.java index 702cca0..43ac913 100644 --- a/src/main/java/dev/zontreck/essentials/AriasEssentials.java +++ b/src/main/java/dev/zontreck/essentials/AriasEssentials.java @@ -5,6 +5,9 @@ import java.util.HashMap; import java.util.Map; import java.util.Random; import java.util.UUID; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; import dev.zontreck.essentials.blocks.ModBlocks; import dev.zontreck.essentials.client.Keybindings; @@ -60,6 +63,7 @@ public class AriasEssentials { public static boolean ALIVE; public static Map player_homes = new HashMap<>(); public static boolean DEBUG = true; + public static ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); diff --git a/src/main/java/dev/zontreck/essentials/antiexplode/CreeperHealQueue.java b/src/main/java/dev/zontreck/essentials/antiexplode/CreeperHealQueue.java index 390168f..430f2b8 100644 --- a/src/main/java/dev/zontreck/essentials/antiexplode/CreeperHealQueue.java +++ b/src/main/java/dev/zontreck/essentials/antiexplode/CreeperHealQueue.java @@ -1,12 +1,37 @@ package dev.zontreck.essentials.antiexplode; import dev.zontreck.libzontreck.memory.world.BlockRestoreQueue; +import dev.zontreck.libzontreck.memory.world.PrimitiveBlock; import dev.zontreck.libzontreck.memory.world.SortedBlockQueue; -public class CreeperHealQueue extends SortedBlockQueue +public class CreeperHealQueue extends BlockRestoreQueue { @Override public String getRestoreQueueName() { return "creeperheal"; } + + @Override + public boolean usesDatabase() { + return true; + } + + @Override + public void databaseUpdate(PrimitiveBlock block) { + super.databaseUpdate(block); + notifyDirtyQueue(true); + } + + @Override + public void notifyDirtyQueue(boolean b) { + // Queue was modified. + // Restart the timer for repairing blocks if necessary + } + + @Override + public boolean sorted() { + return true; + } + + } diff --git a/src/main/java/dev/zontreck/essentials/blocks/ModBlocks.java b/src/main/java/dev/zontreck/essentials/blocks/ModBlocks.java index b2151f3..2428e33 100644 --- a/src/main/java/dev/zontreck/essentials/blocks/ModBlocks.java +++ b/src/main/java/dev/zontreck/essentials/blocks/ModBlocks.java @@ -1,6 +1,7 @@ package dev.zontreck.essentials.blocks; import dev.zontreck.essentials.AriasEssentials; +import dev.zontreck.essentials.blocks.logicgates.TFlipFlopBlock; import dev.zontreck.essentials.items.CreativeModeTabs; import dev.zontreck.libzontreck.edlibmc.Auxiliaries; import dev.zontreck.libzontreck.edlibmc.StandardBlocks; @@ -318,4 +319,7 @@ public class ModBlocks { public static final RegistryObject STEEL_CATWALK_BLOCK = registerWithItem(BLOCKS.register("steel_catwalk_block", ()-> new Block(gratingBlock)), new Item.Properties()); + public static final RegistryObject TFLIPFLOP_BLOCK = registerWithItem(BLOCKS.register("tflipflop", () -> new TFlipFlopBlock(noViewBlocking().noOcclusion().noCollission())), new Item.Properties()); + + } diff --git a/src/main/java/dev/zontreck/essentials/blocks/logicgates/TFlipFlopBlock.java b/src/main/java/dev/zontreck/essentials/blocks/logicgates/TFlipFlopBlock.java new file mode 100644 index 0000000..b6f87e8 --- /dev/null +++ b/src/main/java/dev/zontreck/essentials/blocks/logicgates/TFlipFlopBlock.java @@ -0,0 +1,75 @@ +package dev.zontreck.essentials.blocks.logicgates; + +import dev.zontreck.essentials.blocks.RotatableBlock; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.jetbrains.annotations.Nullable; + +public class TFlipFlopBlock extends RotatableBlock +{ + public static final BooleanProperty POWERED = BlockStateProperties.POWERED; + public static final BooleanProperty INPUTPOWER = BooleanProperty.create("input_power"); + + + public TFlipFlopBlock(Properties p_49795_) { + super(p_49795_); + } + + @Override + public BlockState rotate(BlockState p_55115_, Rotation p_55116_) { + return p_55115_.setValue(FACING, p_55116_.rotate(p_55115_.getValue(FACING))); + } + + @Override + public BlockState mirror(BlockState p_55112_, Mirror p_55113_) { + return p_55112_.rotate(p_55113_.getRotation(p_55112_.getValue(FACING))); + } + + + @Override + public BlockState getStateForPlacement(BlockPlaceContext p_55087_) { + return super.getStateForPlacement(p_55087_).setValue(POWERED, false).setValue(INPUTPOWER, false); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(POWERED, INPUTPOWER); + } + + @Override + public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @Nullable Direction direction) { + return true; + } + + @Override + public int getSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { + return state.getValue(POWERED) && state.getValue(FACING) == direction ? 15 : 0; + } + + public void updatePowered(BlockState state) + { + boolean powered = state.getValue(POWERED); + boolean inputPower = state.getValue(INPUTPOWER); + + if(inputPower)return; + + inputPower = true; + powered = !powered; + + state.setValue((POWERED), powered); + state.setValue((INPUTPOWER), inputPower); + } + + public void removePower(BlockState state) + { + state.setValue(INPUTPOWER, false); + } +} diff --git a/src/main/java/dev/zontreck/essentials/configs/server/AEServerConfig.java b/src/main/java/dev/zontreck/essentials/configs/server/AEServerConfig.java index 686bbb9..00664ef 100644 --- a/src/main/java/dev/zontreck/essentials/configs/server/AEServerConfig.java +++ b/src/main/java/dev/zontreck/essentials/configs/server/AEServerConfig.java @@ -22,6 +22,7 @@ public class AEServerConfig public Teleportation teleport; public Messages messages; public Bottles bottles; + public CreeperHeal creeperHeal; @@ -45,6 +46,11 @@ public class AEServerConfig config.bottles = Bottles.deserialize(tag.getCompound(Bottles.TAG_NAME)); } else config.bottles = new Bottles(); + if(tag.contains(CreeperHeal.TAG_NAME)) + { + config.creeperHeal = CreeperHeal.deserialize(tag.getCompound(CreeperHeal.TAG_NAME)); + } + return config; } @@ -55,6 +61,8 @@ public class AEServerConfig if(serverConfig.toFile().exists()) { inst = deserialize(SNbtIo.loadSnbt(serverConfig)); + + save(); // incase of updates }else { initNewConfig(); } @@ -65,7 +73,7 @@ public class AEServerConfig private static void initNewConfig() { inst = new AEServerConfig(); - inst.reset(); + inst.reset(); // also saves } private void reset() @@ -95,6 +103,7 @@ public class AEServerConfig ); messages = new Messages(); bottles = new Bottles(); + creeperHeal = new CreeperHeal(); @@ -124,6 +133,7 @@ public class AEServerConfig tag.put(Teleportation.TAG_NAME, teleport.serialize()); tag.put(Messages.TAG_NAME, messages.serialize()); tag.put(Bottles.TAG_NAME, bottles.serialize()); + tag.put(CreeperHeal.TAG_NAME, creeperHeal.serialize()); diff --git a/src/main/java/dev/zontreck/essentials/configs/server/sections/CreeperHeal.java b/src/main/java/dev/zontreck/essentials/configs/server/sections/CreeperHeal.java new file mode 100644 index 0000000..f020bc8 --- /dev/null +++ b/src/main/java/dev/zontreck/essentials/configs/server/sections/CreeperHeal.java @@ -0,0 +1,67 @@ +package dev.zontreck.essentials.configs.server.sections; + +import dev.zontreck.essentials.configs.server.AEServerConfig; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.StringTag; +import net.minecraft.nbt.Tag; + +import java.util.ArrayList; +import java.util.List; + +public class CreeperHeal +{ + public static final String TAG_NAME = "creeper_heal"; + public static final String TAG_BLACKLIST = "blacklisted_dims"; + public static final String TAG_VERSION = "version"; + public static final String TAG_DURATION = "duration"; + + + public List blacklistedDimensions = new ArrayList<>(); + public int version = 0; + + public int duration = 40; // Once every 2 seconds + + + public static final int VERSION = 1; + + public CompoundTag serialize() + { + CompoundTag tag = new CompoundTag(); + tag.putInt(TAG_VERSION, version); + ListTag blacklist = new ListTag(); + for(String dimension : blacklistedDimensions) + { + blacklist.add(StringTag.valueOf(dimension)); + } + tag.put(TAG_BLACKLIST, blacklist); + tag.putInt(TAG_DURATION, duration); + + return tag; + } + + public static CreeperHeal deserialize(CompoundTag tag) + { + CreeperHeal heal = new CreeperHeal(); + heal.version = tag.getInt(TAG_VERSION); + + if(heal.version == 0){ + heal.version = VERSION; + return heal; + } + + if(heal.version >= 1) + { + + ListTag lst = tag.getList(TAG_BLACKLIST, StringTag.TAG_STRING); + for(Tag t : lst) + { + heal.blacklistedDimensions.add(t.getAsString()); + } + heal.duration = tag.getInt(TAG_DURATION); + } + + return heal; + } + +} diff --git a/src/main/java/dev/zontreck/essentials/data/ModBlockStatesProvider.java b/src/main/java/dev/zontreck/essentials/data/ModBlockStatesProvider.java index 1f38191..53d0bb0 100644 --- a/src/main/java/dev/zontreck/essentials/data/ModBlockStatesProvider.java +++ b/src/main/java/dev/zontreck/essentials/data/ModBlockStatesProvider.java @@ -138,6 +138,8 @@ public class ModBlockStatesProvider extends BlockStateProvider { blockWithExistingModel(ModBlocks.STEEL_CATWALK_BLOCK, "block/engineersdecor/steel_catwalk_block", false); + blockWithExistingModel(ModBlocks.TFLIPFLOP_BLOCK, "block/logicgates/tflipflop", true); + } private void blockWithExistingModel(RegistryObject blk, String model, boolean rotatable) diff --git a/src/main/java/dev/zontreck/essentials/data/loot/ModBlockLootTablesProvider.java b/src/main/java/dev/zontreck/essentials/data/loot/ModBlockLootTablesProvider.java index 6a87153..b80bc4a 100644 --- a/src/main/java/dev/zontreck/essentials/data/loot/ModBlockLootTablesProvider.java +++ b/src/main/java/dev/zontreck/essentials/data/loot/ModBlockLootTablesProvider.java @@ -76,6 +76,8 @@ public class ModBlockLootTablesProvider extends BlockLootSubProvider dropSelf(ModBlocks.STEEL_CATWALK_BLOCK.get()); + dropSelf(ModBlocks.TFLIPFLOP_BLOCK.get()); + } diff --git a/src/main/java/dev/zontreck/essentials/imc/Events.java b/src/main/java/dev/zontreck/essentials/imc/Events.java index d61f563..18baebd 100644 --- a/src/main/java/dev/zontreck/essentials/imc/Events.java +++ b/src/main/java/dev/zontreck/essentials/imc/Events.java @@ -1,13 +1,26 @@ package dev.zontreck.essentials.imc; +import dev.zontreck.essentials.AriasEssentials; import dev.zontreck.essentials.antiexplode.CreeperHealQueue; import dev.zontreck.essentials.commands.teleport.TeleportActioner; import dev.zontreck.essentials.commands.teleport.TeleportContainer; +import dev.zontreck.essentials.configs.server.AEServerConfig; +import dev.zontreck.libzontreck.config.ServerConfig; import dev.zontreck.libzontreck.events.BlockRestoreQueueRegistrationEvent; import dev.zontreck.libzontreck.events.TeleportEvent; +import dev.zontreck.libzontreck.memory.world.BlockRestoreQueue; +import dev.zontreck.libzontreck.memory.world.BlockRestoreQueueRegistry; +import dev.zontreck.libzontreck.memory.world.BlockRestoreRunner; +import dev.zontreck.libzontreck.memory.world.SavedBlock; +import dev.zontreck.libzontreck.vectors.Vector3i; +import net.minecraft.core.BlockPos; import net.minecraft.world.phys.Vec2; +import net.minecraftforge.event.level.ExplosionEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; +import java.util.Timer; +import java.util.concurrent.TimeUnit; + public class Events { @SubscribeEvent @@ -26,6 +39,23 @@ public class Events @SubscribeEvent public static void onRegisterRestoreQueues (BlockRestoreQueueRegistrationEvent event) { - event.register(new CreeperHealQueue()); + CreeperHealQueue queue = new CreeperHealQueue(); + event.register(queue); + + BlockRestoreRunner runner = new BlockRestoreRunner(queue); + AriasEssentials.executorService.scheduleAtFixedRate(runner, 0, AEServerConfig.getInstance().creeperHeal.duration * 1000 / 20, TimeUnit.MILLISECONDS); + + } + + @SubscribeEvent + public static void onExplosionEvent(ExplosionEvent.Detonate event) + { + for(BlockPos pos : event.getAffectedBlocks()) + { + SavedBlock sb = SavedBlock.takeSnapshot(new Vector3i(pos), event.getLevel()); + + BlockRestoreQueue queue = BlockRestoreQueueRegistry.getQueue("creeperheal"); + queue.enqueueBlock(sb); + } } } diff --git a/src/main/resources/assets/ariasessentials/lang/en_us.json b/src/main/resources/assets/ariasessentials/lang/en_us.json index 93a487e..ff2c510 100644 --- a/src/main/resources/assets/ariasessentials/lang/en_us.json +++ b/src/main/resources/assets/ariasessentials/lang/en_us.json @@ -43,6 +43,7 @@ "block.ariasessentials.steel_catwalk_stairs_rr": "Steel Catwalk Right Rail", "block.ariasessentials.steel_catwalk_stairs_dr": "Steel Catwalk Double Rail", "block.ariasessentials.steel_catwalk_block": "Steel Catwalk Block", + "block.ariasessentials.tflipflop": "T-Flip Flop", "key.category.ariasessentials": "Aria's Essentials", "key.ariasessentials.autowalk": "Auto Walk" diff --git a/src/main/resources/assets/ariasessentials/models/block/logicgates/redstone_tflipflop.bbmodel b/src/main/resources/assets/ariasessentials/models/block/logicgates/redstone_tflipflop.bbmodel new file mode 100644 index 0000000..62463f0 --- /dev/null +++ b/src/main/resources/assets/ariasessentials/models/block/logicgates/redstone_tflipflop.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.9","model_format":"java_block","box_uv":false},"name":"tflipflop","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":16,"height":16},"elements":[{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[0,0,0],"to":[16,0.25,16],"autouv":0,"color":4,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,16,16],"texture":0},"east":{"uv":[0,0,16,16],"texture":0},"south":{"uv":[0,0,16,16],"texture":0},"west":{"uv":[0,0,16,16],"texture":0},"up":{"uv":[0,0,16,16],"rotation":270,"texture":0},"down":{"uv":[16,0,0,16],"rotation":90,"texture":0}},"type":"cube","uuid":"6ee87a67-7b5b-776a-921d-31996e4fc4b1"},{"name":"torch","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[8.399999999999999,0.5,14.25],"to":[9.149999999999999,3.25,15],"autouv":0,"color":1,"origin":[0,0,0],"faces":{"north":{"uv":[1,0,2,3],"texture":3},"east":{"uv":[2,0,2.75,2.75],"texture":3},"south":{"uv":[0,3,1,6],"texture":3},"west":{"uv":[0,0,1,3],"texture":3},"up":{"uv":[4,1,3,0],"rotation":270,"texture":3},"down":{"uv":[2,3,1,4],"rotation":90,"texture":3}},"type":"cube","uuid":"5719ff79-ec66-b969-5065-ca4707d376b6"},{"name":"indicator","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[8.399999999999999,3.2499999999999996,14.25],"to":[9.149999999999999,4.25,15],"autouv":0,"color":1,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,16,16],"texture":4},"east":{"uv":[0,0,16,16],"texture":4},"south":{"uv":[0,0,16,16],"texture":4},"west":{"uv":[0,0,16,16],"texture":4},"up":{"uv":[0,0,16,16],"rotation":270,"texture":4},"down":{"uv":[0,0,0,0],"rotation":90,"texture":null}},"type":"cube","uuid":"6ad6333f-d348-c38b-7248-092f275f20d0"},{"name":"torch","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[8.399999999999999,0.5,4.25],"to":[9.149999999999999,3.25,5],"autouv":0,"color":1,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,0.75,2.75],"texture":3},"east":{"uv":[0,0,0.75,2.75],"texture":3},"south":{"uv":[0,0,0.75,2.75],"texture":3},"west":{"uv":[0,0,0.75,2.75],"texture":3},"up":{"uv":[0,0,0.75,0.75],"rotation":270,"texture":3},"down":{"uv":[0,0,0.75,0.75],"rotation":90,"texture":3}},"type":"cube","uuid":"f14671dc-ab6e-40c4-e6e4-12e68121a66a"},{"name":"torch","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[8.399999999999999,0.5,1.25],"to":[9.149999999999999,3.25,2],"autouv":1,"color":1,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,0.75,2.75],"texture":3},"east":{"uv":[0,0,0.75,2.75],"texture":3},"south":{"uv":[0,0,0.75,2.75],"texture":3},"west":{"uv":[0,0,0.75,2.75],"texture":3},"up":{"uv":[0,0,0.75,0.75],"rotation":270,"texture":3},"down":{"uv":[0,0,0.75,0.75],"rotation":90,"texture":3}},"type":"cube","uuid":"f5ee3c0e-8dca-0749-be61-c29aec042cec"},{"name":"lock_bar","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[3,0.5,11],"to":[13,1,12],"autouv":0,"color":9,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,9,1],"texture":2},"east":{"uv":[2,3,3,4],"texture":2},"south":{"uv":[0,1,9,2],"texture":2},"west":{"uv":[2,2,3,3],"texture":2},"up":{"uv":[1,11,0,2],"rotation":270,"texture":2},"down":{"uv":[0,0,0,0],"rotation":90,"texture":null}},"type":"cube","uuid":"00b86e03-593b-7ea9-0d5c-d410efa603bb"},{"name":"cube","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[0.25,0.25,0.25],"to":[15.75,0.5,15.75],"autouv":1,"color":3,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,15.5,0.25],"texture":0},"east":{"uv":[0,0,15.5,0.25],"texture":0},"south":{"uv":[0,0,15.5,0.25],"texture":0},"west":{"uv":[0,0,15.5,0.25],"texture":0},"up":{"uv":[0,0,15.5,15.5],"rotation":270,"texture":1},"down":{"uv":[0,0,15.5,15.5],"rotation":90,"texture":null}},"type":"cube","uuid":"70cdfb63-6983-46ac-c64f-5d139ee02b56"},{"name":"indicator","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[8.399999999999999,3.2499999999999996,4.25],"to":[9.149999999999999,4.25,5],"autouv":0,"color":1,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,16,16],"texture":4},"east":{"uv":[0,0,16,16],"texture":4},"south":{"uv":[0,0,16,16],"texture":4},"west":{"uv":[0,0,16,16],"texture":4},"up":{"uv":[0,0,16,16],"rotation":270,"texture":4},"down":{"uv":[0,0,0,0],"rotation":90,"texture":null}},"type":"cube","uuid":"c5083ded-86e9-3def-44b0-718c97d41ade"},{"name":"indicator","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[8.399999999999999,3.2499999999999996,1.25],"to":[9.149999999999999,4.25,2],"autouv":0,"color":1,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,16,16],"texture":4},"east":{"uv":[0,0,16,16],"texture":4},"south":{"uv":[0,0,16,16],"texture":4},"west":{"uv":[0,0,16,16],"texture":4},"up":{"uv":[0,0,16,16],"rotation":270,"texture":4},"down":{"uv":[0,0,0,0],"rotation":90,"texture":null}},"type":"cube","uuid":"3278e5e9-3228-e3db-6be2-1a2d6cabdb1d"}],"outliner":[{"name":"base","origin":[0,0,0],"color":0,"nbt":"{}","uuid":"08890b43-7b79-31ac-b4ae-af59395020c5","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["70cdfb63-6983-46ac-c64f-5d139ee02b56","00b86e03-593b-7ea9-0d5c-d410efa603bb","6ee87a67-7b5b-776a-921d-31996e4fc4b1"]},{"name":"input","origin":[0,0,0],"color":0,"nbt":"{}","uuid":"fce1f3ca-f703-4418-f950-f2fddb1d35d7","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["6ad6333f-d348-c38b-7248-092f275f20d0","5719ff79-ec66-b969-5065-ca4707d376b6"]},{"name":"state","origin":[0,0,0],"color":0,"nbt":"{}","uuid":"8fd3a6eb-cf3b-05b3-e33b-76c89aaff656","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["c5083ded-86e9-3def-44b0-718c97d41ade","f14671dc-ab6e-40c4-e6e4-12e68121a66a"]},{"name":"state","origin":[0,0,0],"color":0,"nbt":"{}","uuid":"2b896569-ecaa-f15e-7a43-9ecbb8fdcd6f","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["3278e5e9-3228-e3db-6be2-1a2d6cabdb1d","f5ee3c0e-8dca-0749-be61-c29aec042cec"]}],"textures":[{"path":"/media/tara/Data/DevEnv/Minecraft/Mods/Arias-Essentials/src/main/resources/assets/ariasessentials/textures/block/logicgates/logic_gate.png","name":"logic_gate.png","folder":"block/logicgates","namespace":"ariasessentials","id":"0","width":16,"height":16,"uv_width":32,"uv_height":32,"particle":true,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"fc146ff8-eb63-70f5-b4c1-f6e9c0a3d522","relative_path":"../../../../textures/block/logicgates/logic_gate.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAQRJREFUOE91k9uKhTAMRRv1q31QBFFEP1ntsDOzJCfjKQTb2qzuXGrjONau60rbtoWv5k3TFEattciu6yrneT6mtU3TVOUAQI6am5mbRgYAcsA8z1VOMilgDkDOGvd9u0mBHDFblsUBckA68rUHgBAEwVlz27atchsg1gAIARURYvu+u0YdBkDyvgGiGjuO4zfIUv5lXkDdFvOQ1XwAYtZRhUPMRYQ4gJ9P4f9KlxVQ0lhazwHENwUK4W1wqVchK2CNAsJ5A9m6ro+CGHdsJJTlr59XJ0YFlI6y6l/si6jG9/UWMuDNIffJc2YYhg9A7EZamr38ThzS970DiI+XmEH5lQL7AYuQKCQQq/dmAAAAAElFTkSuQmCC"},{"path":"/media/tara/Data/DevEnv/Minecraft/Mods/Arias-Essentials/src/main/resources/assets/ariasessentials/textures/block/logicgates/tflipflop.png","name":"tflipflop.png","folder":"block/logicgates","namespace":"ariasessentials","id":"1","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"ad2c5c62-9aaf-8c8e-b419-d8a21cfc2b74","relative_path":"../../../../textures/block/logicgates/tflipflop.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAWtJREFUOE91kz1qw0AQhWdlVTmKEbh3nb/GuPFNbLBxISEQsmXpKDIGNwkktXujY6RPZWnDm+SJ1SZZGPZv5tu3s7MmSRIbhqGMRiNhj3EQBMJmrRVY27Zyu916w9ykaWoRQAACMTbGqKH5AIIUkGWZRRAMCjgmAMFoXdepQQECaSbPcwUggNIpH2sE8AqAMBhjUxSF5WkEcU4Ar0AVLsSUZaka4UwAk/cfwFVjqqr6vqSIAuq6lsViodIxx2luHnw1AwBOPB6Pcne5yHNVqaqX5VKeylIh1+u1f1oMxuOxKOB1tdINOJ5OJwU8Hg6qAHsPRSFv67V8TCYDQBRFojmgLDh9Tqcyn881AO1+v5f3zUb7pml+A/AKvCN2z+ezzGazPifIAZM8iP6ZmN1u1yugI4BuIbEi/V79UYmuAj4dn9WF/QXSv+AD3EKiKr9Oep84jgcAtxpZ0lzz/4lCttutAiiPP9EH+b+UsC+heB6jdMm9ewAAAABJRU5ErkJggg=="},{"path":"/media/tara/Data/DevEnv/Minecraft/Mods/Arias-Essentials/src/main/resources/assets/ariasessentials/textures/block/logicgates/locked_bar.png","name":"locked_bar.png","folder":"block/logicgates","namespace":"ariasessentials","id":"2","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"b7624b75-7c1f-ec24-cb46-69865ce1f1d9","relative_path":"../../../../textures/block/logicgates/locked_bar.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAElJREFUOE9jVFdX/89AANy8eZMRlxJGqhigY+XLcOXYZgZ8NuF1AVUMWDu/B6c/8QUROAxALhg1YCDDgFAyJiRPVtwjGzoMDAAAj+cyEWdOocgAAAAASUVORK5CYII="},{"path":"/media/tara/Data/DevEnv/Minecraft/Mods/Arias-Essentials/src/main/resources/assets/ariasessentials/textures/block/logicgates/torch.png","name":"torch.png","folder":"block/logicgates","namespace":"ariasessentials","id":"3","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"e424e05b-ce6b-2b7c-d1b3-9ecfcecf09a6","relative_path":"../../../../textures/block/logicgates/torch.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAU9JREFUOE9tU1tSAzEMs9OLLKXQU/D46EB53v8wZU2lSNkMQ2Y6m/ohW7KT50NUy4is4FlLv4i4lOwZATfiArH9E4n7x50AkO1kfS8KlCsaQgQwwL6PtEWhREX81HZfVUUuVuTJIFi2iAQAbYpakSWQFYFoX4m8C4Bg6ObrGIXqAKi1B1gPBkxVSUUgtufnfRSEM4AKUCSc1raqbp/UzOb98A+AOJKrW52okC06BtDbbdfPvGk0wDQ6gGnSvbZ0ytf9Zjey50w6Y+gjj+17avlyIwCRmvmJJhOsBTvEwmlaeVqiPCZ4YHeLQ0hrgcSpfXb4vPQOLNYQSIQBsvM4oYPEYwcAeFj6nvA9aM5caVUaPrVjITF67s/jBKCczkCVAMZHowJ+TFh5+p6WKOw1KZhj9/Fl/gWwXthaUjjtOwVXoLiigCpca6vJjGkLr/9/ATbAoJLQB1pkAAAAAElFTkSuQmCC"},{"path":"/media/tara/Data/DevEnv/Minecraft/Mods/Arias-Essentials/src/main/resources/assets/ariasessentials/textures/block/logicgates/off.png","name":"off.png","folder":"block/logicgates","namespace":"ariasessentials","id":"4","width":16,"height":16,"uv_width":16,"uv_height":16,"particle":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"0752c378-3d0a-10ad-d4d4-551ffb907a2a","relative_path":"../../../../textures/block/logicgates/off.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAB5JREFUOE9jZGBg+M9AAWAcNYBhNAwYRsOAYViEAQBOThABC541RwAAAABJRU5ErkJggg=="}],"display":{"thirdperson_righthand":{"translation":[0,4.5,0],"scale":[0.5,0.5,0.5]},"thirdperson_lefthand":{"translation":[0,4,0],"scale":[0.5,0.5,0.5]},"firstperson_righthand":{"translation":[0,3.5,0],"scale":[0.5,0.5,0.5]},"firstperson_lefthand":{"translation":[0,4.5,0],"scale":[0.5,0.5,0.5]},"ground":{"scale":[0.5,0.5,0.5]},"gui":{"rotation":[45,45,0],"translation":[0,-0.5,0],"scale":[0.5,0.5,0.5]},"head":{"translation":[0,14.25,0]},"fixed":{"rotation":[-90,0,0],"translation":[0,0,-3.75],"scale":[0.5,0.5,0.5]}}} \ No newline at end of file diff --git a/src/main/resources/assets/ariasessentials/models/block/logicgates/tflipflop.json b/src/main/resources/assets/ariasessentials/models/block/logicgates/tflipflop.json new file mode 100644 index 0000000..bc429a3 --- /dev/null +++ b/src/main/resources/assets/ariasessentials/models/block/logicgates/tflipflop.json @@ -0,0 +1,187 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "ariasessentials:block/logicgates/logic_gate", + "1": "ariasessentials:block/logicgates/tflipflop", + "2": "ariasessentials:block/logicgates/locked_bar", + "3": "ariasessentials:block/logicgates/torch", + "4": "ariasessentials:block/logicgates/off", + "particle": "ariasessentials:block/logicgates/logic_gate" + }, + "elements": [ + { + "from": [0.25, 0.25, 0.25], + "to": [15.75, 0.5, 15.75], + "faces": { + "north": {"uv": [0, 0, 15.5, 0.25], "texture": "#0"}, + "east": {"uv": [0, 0, 15.5, 0.25], "texture": "#0"}, + "south": {"uv": [0, 0, 15.5, 0.25], "texture": "#0"}, + "west": {"uv": [0, 0, 15.5, 0.25], "texture": "#0"}, + "up": {"uv": [0, 0, 15.5, 15.5], "rotation": 270, "texture": "#1"} + } + }, + { + "name": "lock_bar", + "from": [3, 0.5, 11], + "to": [13, 1, 12], + "faces": { + "north": {"uv": [0, 0, 9, 1], "texture": "#2"}, + "east": {"uv": [2, 3, 3, 4], "texture": "#2"}, + "south": {"uv": [0, 1, 9, 2], "texture": "#2"}, + "west": {"uv": [2, 2, 3, 3], "texture": "#2"}, + "up": {"uv": [1, 11, 0, 2], "rotation": 270, "texture": "#2"} + } + }, + { + "from": [0, 0, 0], + "to": [16, 0.25, 16], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#0"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#0"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#0"}, + "up": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#0"}, + "down": {"uv": [16, 0, 0, 16], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "indicator", + "from": [8.4, 3.25, 14.25], + "to": [9.15, 4.25, 15], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#4"} + } + }, + { + "name": "torch", + "from": [8.4, 0.5, 14.25], + "to": [9.15, 3.25, 15], + "faces": { + "north": {"uv": [1, 0, 2, 3], "texture": "#3"}, + "east": {"uv": [2, 0, 2.75, 2.75], "texture": "#3"}, + "south": {"uv": [0, 3, 1, 6], "texture": "#3"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#3"}, + "up": {"uv": [4, 1, 3, 0], "rotation": 270, "texture": "#3"}, + "down": {"uv": [2, 3, 1, 4], "rotation": 90, "texture": "#3"} + } + }, + { + "name": "indicator", + "from": [8.4, 3.25, 4.25], + "to": [9.15, 4.25, 5], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#4"} + } + }, + { + "name": "torch", + "from": [8.4, 0.5, 4.25], + "to": [9.15, 3.25, 5], + "faces": { + "north": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"}, + "east": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"}, + "south": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"}, + "west": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"}, + "up": {"uv": [0, 0, 0.75, 0.75], "rotation": 270, "texture": "#3"}, + "down": {"uv": [0, 0, 0.75, 0.75], "rotation": 90, "texture": "#3"} + } + }, + { + "name": "indicator", + "from": [8.4, 3.25, 1.25], + "to": [9.15, 4.25, 2], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#4"} + } + }, + { + "name": "torch", + "from": [8.4, 0.5, 1.25], + "to": [9.15, 3.25, 2], + "faces": { + "north": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"}, + "east": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"}, + "south": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"}, + "west": {"uv": [0, 0, 0.75, 2.75], "texture": "#3"}, + "up": {"uv": [0, 0, 0.75, 0.75], "rotation": 270, "texture": "#3"}, + "down": {"uv": [0, 0, 0.75, 0.75], "rotation": 90, "texture": "#3"} + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [0, 4.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "translation": [0, 4, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "translation": [0, 3.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "translation": [0, 4.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [45, 45, 0], + "translation": [0, -0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "head": { + "translation": [0, 14.25, 0] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -3.75], + "scale": [0.5, 0.5, 0.5] + } + }, + "groups": [ + { + "name": "base", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "children": [0, 1, 2] + }, + { + "name": "input", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "children": [3, 4] + }, + { + "name": "state", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "children": [5, 6] + }, + { + "name": "state", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "children": [7, 8] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/ariasessentials/textures/block/logicgates/locked_bar.png b/src/main/resources/assets/ariasessentials/textures/block/logicgates/locked_bar.png new file mode 100644 index 0000000000000000000000000000000000000000..dc4583f5a1d61e07907be5551342b854832fe8be GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`R-P`7Ar`&KA>rZw&pR;O*;6@L zaJr1J;@K7kZf0iY=Dw-=ho>gb{&>s9So{F5!tt_KyArN61R5-0U~qQkF;Ldt@&afI NgQu&X%Q~loCIHuOBG>=` literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ariasessentials/textures/block/logicgates/logic_gate.png b/src/main/resources/assets/ariasessentials/textures/block/logicgates/logic_gate.png new file mode 100644 index 0000000000000000000000000000000000000000..12774a59cfe84ad30ada334546bcabd493ab34e1 GIT binary patch literal 265 zcmV+k0rvihP)Px#!%0LzR5*==Q(F$iAP5`>?%j(E?8gSeQrjgVHWlW9x~}UARfUKkR}le8WJCla z0%nH2ccqzuB(c`2>`hP6>zQmPkPb8fvsOtKz`w?b_+=-dB64HT!a0M<4&bX``kD%6 zb|8I|P7>~Zv{N&9^PSC;`3CSbu&LmrLOa9s@9uDSJjGfIdh(bn$@-qNs#EAbb0gK{ zUjH}2)XZ+aviMCwSvUb?@$}#K>J%nGe;56dO^^cEd*7~ZHoN0Ct Ud~mdKI;Vst0MiT)d;kCd literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ariasessentials/textures/block/logicgates/tflipflop.png b/src/main/resources/assets/ariasessentials/textures/block/logicgates/tflipflop.png new file mode 100644 index 0000000000000000000000000000000000000000..63529375ac91c89126e9003ba9abe32cfbddb6fc GIT binary patch literal 341 zcmV-b0jmCqP)5gs499IJkArmk%_nsM@h*2KaT_a$M`2@VE76yLh^Oe@iP#;?xoN6;h$83z^H+>* z+j{Svb9y@GhzI}xKtx0&#<)K%#z;hjPct3-G1HKS%oxK`SOuQwNb;XlM1H~(dFNaj zUZ2w*((nM_wZ)7vwV7d*mOhT7h%mFBddZSdR{HDps_M7fO)tx`tm_&=*tQK3JpjDl z?*Q;J3`#Py*2&Cs(|n#zzvep(gXW!^=IeZ}>w0b)0JwDB$K!G7x)6e?i=x23@2$#d znyRV-03u>$tvmZcpLSN3B{L(UIuX&PY^0AdrgKmQ5veoFfQUJu3auw|9;=Z8wp8|; nDRTh(zNhP;YVE|fD1G_{H$UF?U6xZ?00000NkvXXu0mjf*HfBe literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ariasessentials/textures/block/logicgates/torch.png b/src/main/resources/assets/ariasessentials/textures/block/logicgates/torch.png new file mode 100644 index 0000000000000000000000000000000000000000..b460d8b28c419ec8b6befba14afe9b8e5ee019a7 GIT binary patch literal 330 zcmV-Q0k!^#P)Px$1W80eR5*=YlTmWSAPhsFS$dNmX77KVE$Rmnc$1k-5+h{EDE0nDqo4!;OTK}R zTrUtXYQOtI70g%dg(^U8QJ~Z@fuGgL=4>Q1Rx&eT1tC;DhV{6* z!pv!|R#ZAV2Tf_;cTY`CL538WU%quuAoUf3<-mkGof9f>Xp+<>A7Fl57|pjDAjw?* z$nau){?U$D&BCK=jx`oCuX(cHrxY@)Sshbfnc4)y_wm@|KCd&#Soj(D*NoS6?Xhlq cHs1UG0UPv@o325liU0rr07*qoM6N<$f`qAyxc~qF literal 0 HcmV?d00001