diff --git a/fabric/build.gradle b/fabric/build.gradle index 7923a99..f5cc870 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,50 +1,48 @@ plugins { id 'fabric-loom' version '0.12-SNAPSHOT' + id "io.github.p03w.machete" version "1.+" id 'maven-publish' } sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 -archivesBaseName = project.archives_base_name -version = project.mod_version +archivesBaseName = "${archives_base_name}-mc${mc_version}-${modloader}" +version = "v${mod_version}" group = project.maven_group repositories { mavenLocal() mavenCentral() - maven { - name "SquidDev" - url "https://squiddev.cc/maven" - } - maven { url 'https://jitpack.io' } - maven { url "https://maven.shedaniel.me/" } - maven { - // Location of the maven for vazkii's mods - name 'blamejared' - url 'https://maven.blamejared.com' - } + + maven { url = 'https://maven.parchmentmc.org' } + + maven { url = "https://squiddev.cc/maven/" } + maven { url = "https://maven.shedaniel.me/" } + maven { url = "https://maven.blamejared.com" } // Location of the maven for vazkii's mods + + maven { url = "https://jitpack.io/" } // CC:R, Mixin Extras, fabric ASM maven { url = "https://api.modrinth.com/maven" } // LazyDFU, Suggestion Tweaker - maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu, EMI - maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib maven { url = "https://cursemaven.com" } // Forge Config API Port maven { url = "https://maven.tterrag.com/" } // Registrate and Flywheel - maven { url = "https://maven.cafeteria.dev" } // Fake Player API maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes - maven { url = "https://jitpack.io/" } // Mixin Extras, fabric ASM + + maven { url = "https://maven.terraformersmc.com/releases/" } // Modmenu } dependencies { // dev environment - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" + minecraft "com.mojang:minecraft:${project.mc_version}" + mappings loom.layered() { + officialMojangMappings() + parchment("org.parchmentmc.data:parchment-${project.mc_version}:${project.parchment_version}@zip") + } modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - modLocalRuntime("maven.modrinth:lazydfu:0.1.2") // lazydfu - improves start times - modLocalRuntime("maven.modrinth:suggestion-tweaker:${project.suggestion_tweaker_version}") // suggestion tweaker - dev QOL, improves command suggestions - modLocalRuntime("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { exclude(group: "net.fabricmc.fabric-api") } // required for suggestion tweaker and REI - modLocalRuntime("com.terraformersmc:modmenu:${project.modmenu_version}") { exclude group: "net.fabricmc"; exclude group: "net.fabricmc.fabric-api" } // always good to have + + // dependencies we dont use nowerdays HAHAHAHAHAHA + //modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}") // recipe viewers modRuntimeOnly("dev.architectury:architectury-fabric:${project.architectury_version}") // for REI @@ -62,81 +60,59 @@ dependencies { println("unknown recipe viewer: $recipeViewer") } + modLocalRuntime("maven.modrinth:lazydfu:0.1.2") // lazydfu - improves start times + modLocalRuntime("maven.modrinth:suggestion-tweaker:${project.suggestion_tweaker_version}") // suggestion tweaker - dev QOL, improves command suggestions + modLocalRuntime("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { exclude(group: "net.fabricmc.fabric-api") } // required for suggestion tweaker and REI + modLocalRuntime("com.terraformersmc:modmenu:${project.modmenu_version}") { exclude group: "net.fabricmc"; exclude group: "net.fabricmc.fabric-api" } // always good to have + // used to prevent forge config api port from complaining modImplementation("com.github.AlphaMode:fakeconfig:master-SNAPSHOT") { exclude(group: "net.fabricmc.fabric-api") } modImplementation("com.github.AlphaMode:fakeconfigtoml:master-SNAPSHOT") { exclude(group: "net.fabricmc.fabric-api") } - // create setup - modImplementation("com.simibubi:Create:${project.create_version}") { transitive = false } - modImplementation("io.github.fabricators_of_create:Porting-Lib:${project.port_lib_version}+${project.minecraft_version}-dev.${project.port_lib_hash}") + // Create + modImplementation("com.simibubi.create:create-fabric-${project.mc_version}:${project.create_version}+mc${project.mc_version}") + modImplementation("io.github.fabricators_of_create:Porting-Lib:$project.port_lib_version+$project.mc_version") modImplementation("me.alphamode:ForgeTags:${project.forge_tags_version}") - modImplementation(include("com.electronwill.night-config:core:${project.night_config_core_version}")) - modImplementation(include("com.electronwill.night-config:toml:${project.night_config_toml_version}")) modImplementation("curse.maven:forge-config-api-port-fabric-547434:${project.config_api_id}") { transitive = false } modImplementation("com.tterrag.registrate:Registrate:${project.registrate_version}") - modImplementation("com.jozufozu.flywheel:flywheel-fabric-1.18.2:${project.flywheel_version}") + modImplementation("com.jozufozu.flywheel:flywheel-fabric-${project.mc_version}:${project.flywheel_version}") modImplementation("com.jamieswhiteshirt:reach-entity-attributes:${project.reach_entity_attributes_version}") - modImplementation("dev.cafeteria:fake-player-api:${project.fake_player_api_version}") modImplementation("io.github.tropheusj:milk-lib:${project.milk_lib_version}") - implementation("com.google.code.findbugs:jsr305:${project.jsr305_version}") // CC:R setup - modImplementation("com.github.cc-tweaked:cc-restitched:${project.cc_version}") - - // dependencies - modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}") - - - - - - - - - - - // To change the versions see the gradle.properties file - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - - - - modApi "com.github.cc-tweaked:cc-restitched:${project.cc_version}" - - // create setup - modImplementation("com.simibubi:Create:${project.create_version}") { transitive = false } - - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + modImplementation("com.github.cc-tweaked:cc-restitched:v${project.mc_version}-${project.cc_version}-ccr") } processResources { inputs.property "version", project.version filesMatching("fabric.mod.json") { - expand "version": project.version + expand(project.properties) } } tasks.withType(JavaCompile).configureEach { - // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. it.options.release = 17 -} - -java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // if it is present. - // If you remove this line, sources will not be generated. - withSourcesJar() + options.compilerArgs <<"-Xlint:deprecation" } jar { from("LICENSE") { rename { "${it}_${project.archivesBaseName}"} } + manifest { + attributes([ + "Specification-Title" : "${project.archives_base_name}", + "Specification-Vendor" : "${project.maven_group}", + "Specification-Version" : "1", + "Implementation-Title" : project.name, + "Implementation-Version" : project.mod_version, + "Implementation-Vendor" : "${project.maven_group}", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) + } } -// configure the maven publication publishing { publications { mavenJava(MavenPublication) { @@ -144,11 +120,5 @@ publishing { } } - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - // Notice: This block does NOT have the same function as the block in the top level. - // The repositories here will be used for publishing your artifact, not for - // retrieving dependencies. - } + repositories {} } diff --git a/fabric/gradle.properties b/fabric/gradle.properties index f596dc9..9d8790f 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -1,43 +1,44 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx2G +# Description +copyright_year=2023 +license=Apache-2.0 +modloader=fabric + # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.18.2 -yarn_mappings=1.18.2+build.3 +mc_version=1.18.2 +parchment_version = 2022.11.06 loader_version=0.14.8 # Mod Properties -mod_version = 1.3.1 +mod_version = 1.5.0 maven_group = cc.tweaked_programs archives_base_name = cccbridge # Dependencies -fabric_version=0.57.0+1.18.2 -cc_version=v1.18.2-1.100.5-ccr +fabric_version=0.67.0+1.18.2 +cc_version=1.100.5 # Create setup -# https://modrinth.com/mod/create-fabric -create_version = 0.5.0c-691 +create_version=0.5.1-b-build.1078 +create_version_production=0.5.1-b + +flywheel_version=0.6.8.a-36 +reach_entity_attributes_version=2.1.1 +registrate_version=MC1.18.2-1.1.3 +forge_tags_version=2.1 +milk_lib_version=0.3.2 +port_lib_version=1.2.1031-beta -# https://github.com/Fabricators-of-Create/Create/blob/mc1.18/fabric/dev/gradle.properties config_api_id = 3671141 -forge_config_api_port_version = 3.2.0 -fake_player_api_version = 0.3.0 -flywheel_version = 0.6.4-30 -reach_entity_attributes_version = 2.1.1 -registrate_version = MC1.18.2-1.1.3 -forge_tags_version = 2.1 -milk_lib_version = 0.3.2 -port_lib_version = 1.2.421-beta -port_lib_hash = b8d195a -night_config_core_version = 3.6.3 -night_config_toml_version = 3.6.3 -jsr305_version = 3.0.2 +night_config_core_version = 3.6.6 +night_config_toml_version = 3.6.6 # dev env mods # https://modrinth.com/mod/modmenu -modmenu_version = 3.2.2 +modmenu_version = 3.2.4 # https://modrinth.com/mod/suggestion-tweaker suggestion_tweaker_version = 1.18.x-1.2.0 # https://modrinth.com/mod/cloth-config diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/BlockRegister.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/BlockRegister.java deleted file mode 100644 index d8f4ef0..0000000 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/BlockRegister.java +++ /dev/null @@ -1,45 +0,0 @@ -package cc.tweaked_programs.cccbridge; - -import net.fabricmc.fabric.api.item.v1.FabricItemSettings; -import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; -import net.minecraft.block.Block; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.block.entity.BlockEntityType; -import net.minecraft.item.BlockItem; -import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; - -import java.util.HashMap; -import java.util.Map; - -public class BlockRegister { - private static final Map blockEntitys = new HashMap(); - private static final Map blocks = new HashMap(); - private static final Map items = new HashMap(); - - private static ItemGroup group = ItemGroup.REDSTONE; - - - public static void registerBlockEntity(String id, FabricBlockEntityTypeBuilder.Factory factory, Block block) { - blockEntitys.put(id, - Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(CCCBridge.MOD_ID, id + "_entity"), FabricBlockEntityTypeBuilder.create(factory, block).build(null)) - ); - blocks.put(id, block); - - Item item = new BlockItem(block, new FabricItemSettings().group(group)); - items.put(id, item); - Registry.register(Registry.BLOCK, new Identifier(CCCBridge.MOD_ID, id), block); - Registry.register(Registry.ITEM, new Identifier(CCCBridge.MOD_ID, id), item); - } - - public static BlockEntityType getBlockEntityType(String id) { - return blockEntitys.get(id); - } - - public static Block getBlock(String id) { - return blocks.get(id); - } - -} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCBridge.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCBridge.java index ad5671f..59dfca8 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCBridge.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCBridge.java @@ -1,44 +1,46 @@ package cc.tweaked_programs.cccbridge; -import cc.tweaked_programs.cccbridge.block.RedRouterBlock; -import cc.tweaked_programs.cccbridge.block.ScrollerBlock; -import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; -import cc.tweaked_programs.cccbridge.block.SourceBlock; -import cc.tweaked_programs.cccbridge.blockEntity.ScrollerBlockEntity; +import cc.tweaked_programs.cccbridge.block.*; +import cc.tweaked_programs.cccbridge.blockEntity.*; import cc.tweaked_programs.cccbridge.display.SourceBlockDisplaySource; -import cc.tweaked_programs.cccbridge.blockEntity.SourceBlockEntity; -import cc.tweaked_programs.cccbridge.block.TargetBlock; import cc.tweaked_programs.cccbridge.display.TargetBlockDisplayTarget; -import cc.tweaked_programs.cccbridge.blockEntity.TargetBlockEntity; -import com.simibubi.create.content.logistics.block.display.AllDisplayBehaviours; +import cc.tweaked_programs.cccbridge.entity.animatronic.AnimatronicEntity; +import cc.tweaked_programs.cccbridge.entity.animatronic.AnimatronicModel; +import cc.tweaked_programs.cccbridge.entity.animatronic.AnimatronicRenderer; +import com.simibubi.create.content.redstone.displayLink.AllDisplayBehaviours; import dan200.computercraft.api.ComputerCraftAPI; -import dan200.computercraft.api.peripheral.IPeripheralProvider; import net.fabricmc.api.ModInitializer; -import net.minecraft.sound.SoundEvent; -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.EntityDimensions; +import net.minecraft.world.entity.MobCategory; +import net.minecraft.world.entity.decoration.Motive; public class CCCBridge implements ModInitializer { public static final String MOD_ID = "cccbridge"; - public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); - - public static final IPeripheralProvider peripheralProvider = new PeripheralProvider(); + //public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); @Override public void onInitialize() { - BlockRegister.registerBlockEntity("source_block", SourceBlockEntity::new, new SourceBlock()); - AllDisplayBehaviours.assignTile(AllDisplayBehaviours.register(new Identifier(MOD_ID, "source_block_display_source"), new SourceBlockDisplaySource()), BlockRegister.getBlockEntityType("source_block")); + // Block (-entities) + CCCRegister.registerBlockEntity("source_block", SourceBlockEntity::new, new SourceBlock()); + CCCRegister.registerBlockEntity("target_block", TargetBlockEntity::new, new TargetBlock()); - BlockRegister.registerBlockEntity("target_block", TargetBlockEntity::new, new TargetBlock()); - AllDisplayBehaviours.assignTile(AllDisplayBehaviours.register(new Identifier(MOD_ID, "target_block_display_source"), new TargetBlockDisplayTarget()), BlockRegister.getBlockEntityType("target_block")); + CCCRegister.registerBlockEntity("redrouter_block", RedRouterBlockEntity::new, new RedRouterBlock()); + CCCRegister.registerBlockEntity("scroller_block", ScrollerBlockEntity::new, new ScrollerBlock()); + CCCRegister.registerBlockEntity("animatronic_block", AnimatronicBlockEntity::new, new AnimatronicBlock()); - BlockRegister.registerBlockEntity("redrouter_block", RedRouterBlockEntity::new, new RedRouterBlock()); - BlockRegister.registerBlockEntity("scroller_block", ScrollerBlockEntity::new, new ScrollerBlock()); + // Entities + CCCRegister.registerEntity("animatronic", FabricEntityTypeBuilder.create(MobCategory.MISC, AnimatronicEntity::new).dimensions(EntityDimensions.fixed(0.6F, 1.8F)).build(), AnimatronicRenderer::new, AnimatronicModel.LAYER_LOCATION, AnimatronicModel::createBodyLayer); - CCCSoundEvents.init(); + // Create Display Stuff + AllDisplayBehaviours.assignBlockEntity(AllDisplayBehaviours.register(new ResourceLocation(MOD_ID, "source_block_display_source"), new SourceBlockDisplaySource()), CCCRegister.getBlockEntityType("source_block")); + AllDisplayBehaviours.assignBlockEntity(AllDisplayBehaviours.register(new ResourceLocation(MOD_ID, "target_block_display_target"), new TargetBlockDisplayTarget()), CCCRegister.getBlockEntityType("target_block")); - ComputerCraftAPI.registerPeripheralProvider(peripheralProvider); + // Misc + Registry.register(Registry.MOTIVE, new ResourceLocation(MOD_ID, "funny_redrouters"), new Motive(32,16)); + CCCSoundEvents.init(); + ComputerCraftAPI.registerPeripheralProvider(new PeripheralProvider()); } } diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCBridgeClient.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCBridgeClient.java index 1d9d6ab..7718130 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCBridgeClient.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCBridgeClient.java @@ -1,13 +1,17 @@ package cc.tweaked_programs.cccbridge; +import cc.tweaked_programs.cccbridge.blockEntity.AnimatronicBlockEntity; +import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; +import cc.tweaked_programs.cccbridge.blockEntityRenderer.AnimatronicBlockEntityRenderer; +import cc.tweaked_programs.cccbridge.blockEntityRenderer.RedRouterBlockEntityRenderer; import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; -import net.minecraft.client.render.RenderLayer; +import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry; +import net.minecraft.world.level.block.entity.BlockEntityType; public class CCCBridgeClient implements ClientModInitializer { @Override public void onInitializeClient() { - BlockRenderLayerMap.INSTANCE.putBlock(BlockRegister.getBlock("redrouter_block"), RenderLayer.getCutout()); - BlockRenderLayerMap.INSTANCE.putBlock(BlockRegister.getBlock("scroller_block"), RenderLayer.getCutout()); + BlockEntityRendererRegistry.register((BlockEntityType)CCCRegister.getBlockEntityType("animatronic_block"), AnimatronicBlockEntityRenderer::new); + BlockEntityRendererRegistry.register((BlockEntityType)CCCRegister.getBlockEntityType("redrouter_block"), RedRouterBlockEntityRenderer::new); } } diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCRegister.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCRegister.java new file mode 100644 index 0000000..aac9ce7 --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCRegister.java @@ -0,0 +1,75 @@ +package cc.tweaked_programs.cccbridge; + +import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry; +import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; +import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; +import net.minecraft.client.model.geom.ModelLayerLocation; +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.phys.shapes.VoxelShape; + +import javax.annotation.Nullable; +import java.util.HashMap; +import java.util.Map; + +public class CCCRegister { + private static final Map> blockEntities = new HashMap<>(); + private static final Map blocks = new HashMap<>(); + private static final Map items = new HashMap<>(); + private static final Map> entities = new HashMap<>(); + + private static final CreativeModeTab group = CreativeModeTab.TAB_REDSTONE; + + + public static VoxelShape newBox(float p1, float p2, float p3, float p4, float p5, float p6) { + return Block.box(p1*16,p2*16,p3*16,p4*16,p5*16,p6*16); + } + + public static void registerBlockEntity(String id, FabricBlockEntityTypeBuilder.Factory factory, Block block) { + blockEntities.put(id, + Registry.register(Registry.BLOCK_ENTITY_TYPE, new ResourceLocation(CCCBridge.MOD_ID, id + "_entity"), FabricBlockEntityTypeBuilder.create(factory, block).build(null)) + ); + blocks.put(id, block); + + Item item = new BlockItem(block, new FabricItemSettings().group(group)); + items.put(id, item); + Registry.register(Registry.BLOCK, new ResourceLocation(CCCBridge.MOD_ID, id), block); + Registry.register(Registry.ITEM, new ResourceLocation(CCCBridge.MOD_ID, id), item); + } + + public static > void registerEntity(String id, EntityType entitytype, R renderer, ModelLayerLocation layerLocation, EntityModelLayerRegistry.TexturedModelDataProvider createBodyLayer) { + EntityType registeredEntityType = Registry.register(Registry.ENTITY_TYPE, new ResourceLocation(CCCBridge.MOD_ID, id), entitytype); + + EntityRendererRegistry.register(registeredEntityType, renderer); + EntityModelLayerRegistry.registerModelLayer(layerLocation, createBodyLayer); + + entities.put(id, registeredEntityType); + } + + public static BlockEntityType getBlockEntityType(String id) { + return blockEntities.get(id); + } + + public static EntityType getEntityType(String id) { + return entities.get(id); + } + + @Nullable + public static Block getBlock(String id) { + return blocks.get(id); + } + + public static ResourceLocation getEntityTypeId(String id) { + return new ResourceLocation(CCCBridge.MOD_ID, id); + } +} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCSoundEvents.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCSoundEvents.java index 6cbe56f..72a4b6a 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCSoundEvents.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/CCCSoundEvents.java @@ -1,28 +1,28 @@ package cc.tweaked_programs.cccbridge; -import net.minecraft.sound.SoundEvent; -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.sounds.SoundEvent; import java.util.HashMap; import java.util.Map; public class CCCSoundEvents { - public static final Map entries = new HashMap<>(); + public static final Map entries = new HashMap<>(); public static final SoundEvent CAGE_LOCK = create("cage_lock"), CAGE_UNLOCK = create("cage_unlock"); public static SoundEvent create(String path) { - Identifier id = new Identifier(CCCBridge.MOD_ID, path); + ResourceLocation id = new ResourceLocation(CCCBridge.MOD_ID, path); SoundEvent sound = new SoundEvent(id); entries.put(id, sound); return sound; } public static void init() { - for (Identifier id : entries.keySet()) + for (ResourceLocation id : entries.keySet()) Registry.register(Registry.SOUND_EVENT, id, entries.get(id)); } } diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/Misc.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/Misc.java new file mode 100644 index 0000000..69d25f7 --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/Misc.java @@ -0,0 +1,111 @@ +package cc.tweaked_programs.cccbridge; + +import net.minecraft.client.renderer.LightTexture; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.network.chat.TextComponent; + +import java.util.Random; + +public class Misc { + private static final char[] charsetMC = { + // Lower CP437 characters + 0x0020, 0x263A, 0x263B, 0x2665, 0x2666, 0x2663, 0x2660, 0x25CF, 0x25CB, 0x0020, 0x0020, 0x2642, 0x2640, 0x0020, 0x266A, 0x266C, + 0x25B6, 0x25C0, 0x2195, 0x203C, 0x00B6, 0x2591, 0x25AC, 0x21A8, 0x2B06, 0x2B07, 0x27A1, 0x2B05, 0x221F, 0x29FA, 0x25B2, 0x25BC, + // ASCII characters + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, + 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, + 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x2592, + // Drawing chars + 0x2800, 0x2801, 0x2808, 0x2809, 0x2802, 0x2803, 0x280A, 0x280B, 0x2810, 0x2811, 0x2818, 0x2819, 0x2812, 0x2813, 0x281A, 0x281B, + 0x2804, 0x2805, 0x280C, 0x280D, 0x2806, 0x2807, 0x280E, 0x280F, 0x2814, 0x2815, 0x281C, 0x281D, 0x2816, 0x2817, 0x281E, 0x281F, + // ISO-8859-1 characters + 0x2593, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x2588, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF + }; + + public static MutableComponent toMCTxt(String line) { + StringBuilder mcTxt = new StringBuilder(); + + for (char c : line.toCharArray()) { + if (c > 255) + mcTxt.append('?'); + else if (c == 223) // ß + mcTxt.append((char)0x1E9E); + else + mcTxt.append(charsetMC[c]); + } + + return new TextComponent("").append(mcTxt.toString()); + } + + public static String toCCTxt(String line) { + StringBuilder ccTxt = new StringBuilder(); + + for (char c : line.toCharArray()) { + char index = findCharIndex(c); + + ccTxt.append((index > 255) ? '?' : index); + } + + return ccTxt.toString(); + } + + private static char findCharIndex(char c) { + if (c == ' ') // Because we replace some non-printable chars with a space, we have to add this if-clause here. + return c; + + for (int i=0; i be.fireUpdateValueEvent()); + onlyActiveWhen(() -> (be.getLevel() != null && !(be.getLevel().getBlockState(be.getBlockPos()).getValue(BlockStateProperties.LOCKED)))); + value = 0; + hasMinus = false; + between(-15,15); + } + + @Override + public void write(CompoundTag nbt, boolean clientPacket) { + nbt.putInt("ScrollValue", value); + nbt.putBoolean("ScrollMinus", hasMinus); + nbt.putInt("ScrollLimit", max); + super.write(nbt, clientPacket); + } + + @Override + public void read(CompoundTag nbt, boolean clientPacket) { + value = nbt.getInt("ScrollValue"); + hasMinus = nbt.getBoolean("ScrollMinus"); + int limit = nbt.getInt("ScrollLimit"); + between(-limit, limit); + super.read(nbt, clientPacket); + } + + public void between(int limit) { + between(-limit, limit); + blockEntity.setChanged(); + blockEntity.sendData(); + } + + public void setHasMinus(boolean state) { + hasMinus = state; + blockEntity.setChanged(); + blockEntity.sendData(); + } + + public int getMax() { + return max; + } + + public boolean hasMinus() { + return hasMinus; + } + + @Override + public ValueSettingsBoard createBoard(Player player, BlockHitResult hitResult) { + List rows; + if (hasMinus) + rows = ImmutableList.of( + Components.translatable("cccbridge.general.unit.scroller.negative"), + Components.translatable("cccbridge.general.unit.scroller.positive") + ); + else + rows = ImmutableList.of( + Components.translatable("cccbridge.general.unit.scroller") + ); + + return new ValueSettingsBoard(label, max, 5, rows, + new ValueSettingsFormatter(ValueSettingsBehaviour.ValueSettings::format)); + } + + @Override + public void setValueSettings(Player player, ValueSettingsBehaviour.ValueSettings valueSetting, boolean ctrlDown) { + if (valueSetting.equals(getValueSettings())) + return; + setValue(hasMinus && valueSetting.row() == 0 ? -valueSetting.value() : valueSetting.value()); + playFeedbackSound(this); + } +} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/AnimatronicBlock.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/AnimatronicBlock.java new file mode 100644 index 0000000..e53c022 --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/AnimatronicBlock.java @@ -0,0 +1,53 @@ +package cc.tweaked_programs.cccbridge.block; + +import cc.tweaked_programs.cccbridge.blockEntity.AnimatronicBlockEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.phys.shapes.BooleanOp; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class AnimatronicBlock extends Block implements EntityBlock { + public AnimatronicBlock() { + super(Properties.of(Material.METAL).strength(1.3f).sound(SoundType.CHAIN)); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { + return new AnimatronicBlockEntity(pos, state); + } + + @Override + public @NotNull VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter view, @NotNull BlockPos pos, @NotNull CollisionContext ctx) { + return Shapes.join(Block.box(7.5, 2, 7.5, 8.5, 16, 8.5), Block.box(2, 0, 2, 14, 2, 14), BooleanOp.OR); + } + + @Override + public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) { + BlockEntity blockentity = level.getBlockEntity(pos); + if (!(blockentity instanceof AnimatronicBlockEntity animatronicBlockEntity)) + return; + + float rotation = (float) Mth.floor((Mth.wrapDegrees(placer.yRotO) + 22.5F) / 45.0F) * 45.0F; + animatronicBlockEntity.forceBodyPose(0F, rotation, 0F); + animatronicBlockEntity.setBodyPose(15F, rotation, 0F); + animatronicBlockEntity.setHeadPose(20F, 0F, 0F); + animatronicBlockEntity.setRightArmPose(-15F, 0F, 0F); + animatronicBlockEntity.setLeftArmPose(-15F, 0F, 0F); + animatronicBlockEntity.setChanged(); + } +} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/RedRouterBlock.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/RedRouterBlock.java index cfc1748..3cb2262 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/RedRouterBlock.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/RedRouterBlock.java @@ -1,45 +1,71 @@ package cc.tweaked_programs.cccbridge.block; -import cc.tweaked_programs.cccbridge.BlockRegister; +import cc.tweaked_programs.cccbridge.CCCRegister; +import cc.tweaked_programs.cccbridge.Misc; import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; -import com.simibubi.create.content.contraptions.wrench.IWrenchable; -import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.block.*; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.block.entity.BlockEntityTicker; -import net.minecraft.block.entity.BlockEntityType; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.item.ItemUsageContext; -import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.state.StateManager; -import net.minecraft.state.property.Properties; -import net.minecraft.util.ActionResult; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.BlockView; -import net.minecraft.world.World; +import com.simibubi.create.content.equipment.wrench.IWrenchable; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.HorizontalDirectionalBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.material.Material; +import org.jetbrains.annotations.NotNull; + +public class RedRouterBlock extends HorizontalDirectionalBlock implements EntityBlock, IWrenchable { + public static final IntegerProperty FACE = IntegerProperty.create("face", 0, 16); -public class RedRouterBlock extends HorizontalFacingBlock implements BlockEntityProvider, IWrenchable { public RedRouterBlock() { - super(FabricBlockSettings.of(Material.STONE).strength(1.3f).sounds(BlockSoundGroup.STONE)); - setDefaultState(this.stateManager.getDefaultState().with(Properties.HORIZONTAL_FACING, Direction.NORTH)); + super(Properties.of(Material.STONE).strength(1.3f).sound(SoundType.STONE).noOcclusion()); + registerDefaultState(this.stateDefinition.any() + .setValue(BlockStateProperties.HORIZONTAL_FACING, Direction.NORTH) + .setValue(FACE, 0) + ); } @Override - protected void appendProperties(StateManager.Builder stateManager) { - stateManager.add(Properties.HORIZONTAL_FACING); + protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { + stateManager + .add(BlockStateProperties.HORIZONTAL_FACING) + .add(FACE); } @Override - public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + public void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean pIsMoving) { + if (!level.isClientSide) { + BlockEntity be = level.getBlockEntity(pos); + if (!(be instanceof RedRouterBlockEntity rbe)) + return; + RedRouterBlockEntity.updateInputs(level, pos, rbe); + rbe.setChanged(); + } + } + + @Override + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new RedRouterBlockEntity(pos, state); } - public boolean emitsRedstonePower(BlockState state) { + @Override + public boolean isSignalSource(@NotNull BlockState state) { return true; } - public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction dir) { + @Override + public int getSignal(@NotNull BlockState state, BlockGetter world, @NotNull BlockPos pos, @NotNull Direction dir) { BlockEntity block = world.getBlockEntity(pos); if (!(block instanceof RedRouterBlockEntity redrouter)) return 0; @@ -47,12 +73,12 @@ public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, } @Override - public ActionResult onWrenched(BlockState state, ItemUsageContext context) { - BlockEntity tileentity = context.getWorld().getBlockEntity(context.getBlockPos()); + public InteractionResult onWrenched(BlockState state, UseOnContext context) { + BlockEntity tileentity = context.getLevel().getBlockEntity(context.getClickedPos()); if (!(tileentity instanceof RedRouterBlockEntity redrouter)) - return ActionResult.FAIL; + return InteractionResult.FAIL; - if (context.getSide().getId() < 2) { + if (context.getClickedFace().get3DDataValue() < 2) { int north = redrouter.getPower(Direction.NORTH); int east = redrouter.getPower(Direction.EAST); int south = redrouter.getPower(Direction.SOUTH); @@ -68,12 +94,14 @@ public ActionResult onWrenched(BlockState state, ItemUsageContext context) { } @Override - public BlockEntityTicker getTicker(World world, BlockState state, BlockEntityType type) { - return BlockRegister.getBlockEntityType("redrouter_block") == type ? RedRouterBlockEntity::tick : null; + public BlockEntityTicker getTicker(Level world, BlockState state, BlockEntityType type) { + return CCCRegister.getBlockEntityType("redrouter_block") == type ? RedRouterBlockEntity::tick : null; } @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - return this.getDefaultState().with(Properties.HORIZONTAL_FACING, ctx.getPlayerFacing().getOpposite()); + public BlockState getStateForPlacement(BlockPlaceContext ctx) { + return this.defaultBlockState() + .setValue(BlockStateProperties.HORIZONTAL_FACING, ctx.getHorizontalDirection().getOpposite()) + .setValue(FACE, (ctx.getLevel().isClientSide) ? 0 : Misc.randomFace()); } } \ No newline at end of file diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/ScrollerBlock.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/ScrollerBlock.java index 356a392..0d810dd 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/ScrollerBlock.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/ScrollerBlock.java @@ -1,90 +1,90 @@ package cc.tweaked_programs.cccbridge.block; -import cc.tweaked_programs.cccbridge.BlockRegister; -import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; +import cc.tweaked_programs.cccbridge.CCCRegister; import cc.tweaked_programs.cccbridge.blockEntity.ScrollerBlockEntity; -import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.block.*; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.block.entity.BlockEntityTicker; -import net.minecraft.block.entity.BlockEntityType; -import net.minecraft.fluid.FluidState; -import net.minecraft.fluid.Fluids; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.state.StateManager; -import net.minecraft.state.property.Properties; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.util.shape.VoxelShapes; -import net.minecraft.world.BlockView; -import net.minecraft.world.World; -import net.minecraft.world.WorldAccess; +import dan200.computercraft.shared.util.WaterloggableHelpers; +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.Level; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockBehaviour; +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.material.FluidState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.NotNull; -public class ScrollerBlock extends FacingBlock implements BlockEntityProvider, Waterloggable { +import javax.annotation.Nonnull; + +import static dan200.computercraft.shared.util.WaterloggableHelpers.getFluidStateForPlacement; + +public class ScrollerBlock extends DirectionalBlock implements EntityBlock, SimpleWaterloggedBlock { public ScrollerBlock() { - super(FabricBlockSettings.of(Material.WOOD).strength(1.0f).sounds(BlockSoundGroup.WOOD)); - setDefaultState(this.stateManager.getDefaultState() - .with(Properties.FACING, Direction.NORTH) - .with(Properties.WATERLOGGED, false) - .with(Properties.LOCKED, false)); + super(BlockBehaviour.Properties.of(Material.METAL).strength(1.0f).sound(SoundType.METAL)); + registerDefaultState(this.stateDefinition.any() + .setValue(BlockStateProperties.FACING, Direction.NORTH) + .setValue(BlockStateProperties.WATERLOGGED, false) + .setValue(BlockStateProperties.LOCKED, false)); } @Override - protected void appendProperties(StateManager.Builder stateManager) { - stateManager.add(Properties.FACING, Properties.WATERLOGGED, Properties.LOCKED); + protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { + stateManager.add(BlockStateProperties.FACING, BlockStateProperties.WATERLOGGED, BlockStateProperties.LOCKED); } @Override - public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new ScrollerBlockEntity(pos, state); } @Override - public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - Direction dir = state.get(FACING); - switch(dir) { - case SOUTH: - return VoxelShapes.cuboid(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.125f); - case NORTH: - return VoxelShapes.cuboid(0.0f, 0.0f, 1-0.125f, 1.0f, 1.0f, 1.0f); - case WEST: - return VoxelShapes.cuboid(1-0.125f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f); - case EAST: - return VoxelShapes.cuboid(0.0f, 0.0f, 0.0f, 0.125f, 1.0f, 1.0f); - case UP: - return VoxelShapes.cuboid(0.0f, 0.0f, 0.0f, 1.0f, 0.125f, 1.0f); - case DOWN: - return VoxelShapes.cuboid(0.0f, 1-0.125f, 0.0f, 1.0f, 1.0f, 1.0f); - default: - return VoxelShapes.fullCube(); - } + public @NotNull FluidState getFluidState(@Nonnull BlockState state) + { + return WaterloggableHelpers.getFluidState(state); } @Override - public FluidState getFluidState(BlockState state) { - return state.get(Properties.WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state); + public @NotNull BlockState updateShape(@Nonnull BlockState state, @Nonnull Direction side, @Nonnull BlockState otherState, @Nonnull LevelAccessor world, @Nonnull BlockPos pos, @Nonnull BlockPos otherPos ) { + WaterloggableHelpers.updateShape( state, world, pos ); + return state; } @Override - public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { - if (state.get(Properties.WATERLOGGED)) - world.createAndScheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + public @NotNull VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ctx) { + return switch (state.getValue(FACING)) { + case SOUTH -> newBox(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.125f); + case NORTH -> newBox(0.0f, 0.0f, 1 - 0.125f, 1.0f, 1.0f, 1.0f); + case WEST -> newBox(1 - 0.125f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f); + case EAST -> newBox(0.0f, 0.0f, 0.0f, 0.125f, 1.0f, 1.0f); + case UP -> newBox(0.0f, 0.0f, 0.0f, 1.0f, 0.125f, 1.0f); + case DOWN -> newBox(0.0f, 1 - 0.125f, 0.0f, 1.0f, 1.0f, 1.0f); + default -> newBox(0, 0, 0, 1, 1, 1); + }; + } - return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); + private static VoxelShape newBox(float p1, float p2, float p3, float p4, float p5, float p6) { + return Block.box(p1*16,p2*16,p3*16,p4*16,p5*16,p6*16); } @Override - public BlockEntityTicker getTicker(World world, BlockState state, BlockEntityType type) { - return BlockRegister.getBlockEntityType("scroller_block") == type ? ScrollerBlockEntity::tick : null; + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { + return CCCRegister.getBlockEntityType("scroller_block") == type ? ScrollerBlockEntity::tick : null; } @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - return this.getDefaultState() - .with(Properties.FACING, ctx.getSide()) - .with(Properties.WATERLOGGED,ctx.getWorld().getFluidState(ctx.getBlockPos()).getFluid() == Fluids.WATER) - .with(Properties.LOCKED, false); + public BlockState getStateForPlacement(BlockPlaceContext ctx) { + return this.defaultBlockState() + .setValue(BlockStateProperties.FACING, ctx.getClickedFace()) + .setValue(BlockStateProperties.WATERLOGGED, getFluidStateForPlacement(ctx)) + .setValue(BlockStateProperties.LOCKED, false); } } diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/SourceBlock.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/SourceBlock.java index 1acbb3e..e36aa8f 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/SourceBlock.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/SourceBlock.java @@ -1,22 +1,23 @@ package cc.tweaked_programs.cccbridge.block; import cc.tweaked_programs.cccbridge.blockEntity.SourceBlockEntity; -import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.block.Block; -import net.minecraft.block.BlockEntityProvider; -import net.minecraft.block.BlockState; -import net.minecraft.block.Material; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.util.math.BlockPos; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import org.jetbrains.annotations.Nullable; -public class SourceBlock extends Block implements BlockEntityProvider { +public class SourceBlock extends Block implements EntityBlock { public SourceBlock() { - super(FabricBlockSettings.of(Material.METAL).strength(2.0f).sounds(BlockSoundGroup.COPPER)); + super(Properties.of(Material.METAL).strength(3.0f).sound(SoundType.METAL)); } + @Nullable @Override - public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { return new SourceBlockEntity(pos, state); } } diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/TargetBlock.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/TargetBlock.java index afe2e8d..6e80d20 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/TargetBlock.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/block/TargetBlock.java @@ -1,22 +1,24 @@ package cc.tweaked_programs.cccbridge.block; import cc.tweaked_programs.cccbridge.blockEntity.TargetBlockEntity; -import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.block.Block; -import net.minecraft.block.BlockEntityProvider; -import net.minecraft.block.BlockState; -import net.minecraft.block.Material; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.util.math.BlockPos; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import org.jetbrains.annotations.Nullable; -public class TargetBlock extends Block implements BlockEntityProvider { +public class TargetBlock extends Block implements EntityBlock { public TargetBlock() { - super(FabricBlockSettings.of(Material.METAL).strength(2.0f).sounds(BlockSoundGroup.COPPER)); + super(BlockBehaviour.Properties.of(Material.METAL).strength(3.0f).sound(SoundType.METAL)); } + @Nullable @Override - public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { return new TargetBlockEntity(pos, state); } } diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/AnimatronicBlockEntity.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/AnimatronicBlockEntity.java new file mode 100644 index 0000000..03ca6f7 --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/AnimatronicBlockEntity.java @@ -0,0 +1,119 @@ +package cc.tweaked_programs.cccbridge.blockEntity; + +import cc.tweaked_programs.cccbridge.CCCRegister; +import cc.tweaked_programs.cccbridge.entity.animatronic.AnimatronicEntity; +import cc.tweaked_programs.cccbridge.peripherals.AnimatronicPeripheral; +import dan200.computercraft.api.peripheral.IPeripheral; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.Rotations; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; +import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; + +public class AnimatronicBlockEntity extends BlockEntity implements PeripheralBlockEntity { + private AnimatronicPeripheral peripheral; + private AnimatronicEntity animatronic; + + public AnimatronicBlockEntity(BlockPos pos, BlockState blockState) { + super(CCCRegister.getBlockEntityType("animatronic_block"), pos, blockState); + } + + public Rotations getRightArmPose() { + return getAnimatronic().getDestinationRightArmPose(); + } + + public Rotations getLeftArmPose() { + return getAnimatronic().getDestinationLeftArmPose(); + } + + public Rotations getBodyPose() { + return getAnimatronic().getDestinationBodyPose(); + } + + public Rotations getHeadPose() { + return getAnimatronic().getDestinationHeadPose(); + } + + public void setRightArmPose(float x, float y, float z) { + getAnimatronic().setRightArmPose(new Rotations(x, y, z)); + } + + public void setLeftArmPose(float x, float y, float z) { + getAnimatronic().setLeftArmPose(new Rotations(x, y, z)); + } + + public void setBodyPose(float x, float y, float z) { + getAnimatronic().setBodyPose(new Rotations(x, y, z)); + } + + public void setHeadPose(float x, float y, float z) { + getAnimatronic().setHeadPose(new Rotations(x, y, z)); + } + + public void forceBodyPose(float x, float y, float z) { + getAnimatronic().forceBodyPose(new Rotations(x, y, z)); + } + + @Override + @Nullable + public IPeripheral getPeripheral(@NotNull Direction side) { + if (side.getName().equals(Direction.DOWN.getName())) { + if (peripheral == null) + peripheral = new AnimatronicPeripheral(this); + return peripheral; + } + return null; + } + + public AnimatronicEntity getAnimatronic() { + if (animatronic == null) + this.animatronic = new AnimatronicEntity(CCCRegister.getEntityType("animatronic"), getLevel()); + + if (getLevel() != null) + animatronic.level = getLevel(); + + return animatronic; + } + + @Override + public void load(@NotNull CompoundTag nbt) { + getAnimatronic().read(nbt); + super.load(nbt); + } + + @Override + public void saveAdditional(@NotNull CompoundTag nbt) { + getAnimatronic().add(nbt); + super.saveAdditional(nbt); + } + + @Override + public void setChanged() { + super.setChanged(); + if (level != null && this.hasLevel() && !level.isClientSide) + level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), Block.UPDATE_ALL); + } + @Nullable + @Override + public Packet getUpdatePacket() { + return ClientboundBlockEntityDataPacket.create(this); + } + + @Override + public @NotNull CompoundTag getUpdateTag() { + return saveWithoutMetadata(); + } + + public void setFace(String face) { + getAnimatronic().setFace(face); + } +} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/PeripheralBlockEntity.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/PeripheralBlockEntity.java new file mode 100644 index 0000000..1fd0b76 --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/PeripheralBlockEntity.java @@ -0,0 +1,23 @@ +package cc.tweaked_programs.cccbridge.blockEntity; + +import dan200.computercraft.api.peripheral.IPeripheral; +import net.minecraft.core.Direction; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * This interface is used to give TileEntities the ability to provide its Peripheral. + * By implementing this, it can be made sure that the object has this ability for sure. + * + * @version 1.0 + */ +public interface PeripheralBlockEntity { + /** + * Returns a peripheral. Can be null, if the TileEntity rejects the request. + * + * @param side From which side is the block called? + * @return null or Peripheral for the TileEntity. + */ + @Nullable + IPeripheral getPeripheral(@NotNull Direction side); +} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/RedRouterBlockEntity.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/RedRouterBlockEntity.java index 7563b44..583c2aa 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/RedRouterBlockEntity.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/RedRouterBlockEntity.java @@ -1,36 +1,37 @@ package cc.tweaked_programs.cccbridge.blockEntity; -import cc.tweaked_programs.cccbridge.BlockRegister; -import cc.tweaked_programs.cccbridge.CCCBridge; +import cc.tweaked_programs.cccbridge.CCCRegister; +import cc.tweaked_programs.cccbridge.block.RedRouterBlock; import cc.tweaked_programs.cccbridge.peripherals.RedRouterBlockPeripheral; import dan200.computercraft.api.peripheral.IPeripheral; -import dan200.computercraft.api.peripheral.IPeripheralTile; -import net.minecraft.block.BlockState; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.network.Packet; -import net.minecraft.network.listener.ClientPlayPacketListener; -import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; -import net.minecraft.state.property.Properties; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.World; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; +import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.Map; +import java.util.Objects; -public class RedRouterBlockEntity extends BlockEntity implements IPeripheralTile { - private HashMap outputDir = new HashMap<>(); - private HashMap inputDir = new HashMap<>(); - private RedRouterBlockPeripheral peripheral; +public class RedRouterBlockEntity extends BlockEntity implements PeripheralBlockEntity { + private final HashMap outputDir = new HashMap<>(); + private final HashMap inputDir = new HashMap<>(); private boolean blockupdate = false; + private boolean newInputs = false; + private RedRouterBlockPeripheral peripheral; private Direction facing; public RedRouterBlockEntity(BlockPos pos, BlockState state) { - super(BlockRegister.getBlockEntityType("redrouter_block"), pos, state); - facing = state.get(Properties.HORIZONTAL_FACING); + super(CCCRegister.getBlockEntityType("redrouter_block"), pos, state); + facing = state.getValue(BlockStateProperties.HORIZONTAL_FACING); outputDir.put("up", 0); outputDir.put("down", 0); outputDir.put("north", 0); @@ -46,28 +47,34 @@ public RedRouterBlockEntity(BlockPos pos, BlockState state) { inputDir.put("west", 0); } - public static void tick(World world, BlockPos blockPos, BlockState state, BlockEntity be) { + public static void tick(Level world, BlockPos blockPos, BlockState state, BlockEntity be) { if (!(be instanceof RedRouterBlockEntity redrouter)) return; - if (state.get(Properties.HORIZONTAL_FACING) != redrouter.facing) { + + if (state.getValue(BlockStateProperties.HORIZONTAL_FACING) != redrouter.facing) { redrouter.blockupdate = true; - //redrouter.facing = state.get(Properties.HORIZONTAL_FACING); + redrouter.facing = state.getValue(BlockStateProperties.HORIZONTAL_FACING); } if (redrouter.blockupdate) { - world.updateNeighbors(be.getPos(), world.getBlockState(be.getPos()) - .getBlock()); + world.updateNeighborsAt(be.getBlockPos(), world.getBlockState(be.getBlockPos()).getBlock()); redrouter.blockupdate = false; } - updateInputs(world, blockPos, redrouter); + updateInputs(world, blockPos, redrouter); + + if (redrouter.newInputs && redrouter.peripheral != null) { + redrouter.peripheral.sendEvent(RedRouterBlockPeripheral.REDSTONE_EVENT); + redrouter.newInputs = false; + } } - private static void updateInputs(World world, BlockPos blockPos, RedRouterBlockEntity redrouter) { + public static void updateInputs(Level world, BlockPos blockPos, RedRouterBlockEntity redrouter) { for (Map.Entry entry : redrouter.inputDir.entrySet()) { String side = entry.getKey(); Direction dir = Direction.byName(side).getOpposite(); - BlockPos offsetPos = blockPos.offset(dir); + BlockPos offsetPos = blockPos.relative(dir); BlockState block = world.getBlockState(offsetPos); - int power = block.getBlock().getWeakRedstonePower(block, world, offsetPos, dir); + + int power = block.getBlock().getSignal(block, world, offsetPos, dir); redrouter.inputDir.put(side, power); } } @@ -79,17 +86,10 @@ public Direction getFacing() { return facing; } - @Override - public IPeripheral getPeripheral(@NotNull Direction side) { - if (peripheral == null) - peripheral = new RedRouterBlockPeripheral(this); - return peripheral; - } - public int getRedstoneInput(Direction side) { int value = 0; try { - value = inputDir.get(side.asString()); + value = inputDir.get(side.getName()); } catch (NullPointerException e) { } return value; @@ -97,19 +97,21 @@ public int getRedstoneInput(Direction side) { public int getPower(Direction side) { int value = 0; - try { value = outputDir.get(side.asString()); - } catch (NullPointerException e) { CCCBridge.LOGGER.warn(e.getMessage()); } + try { + value = outputDir.get(side.getName()); + } catch (NullPointerException e) { + } return value; } public void setPower(String side, int power) { outputDir.put(side, power); - markDirty(); + setChanged(); } @Override - public void readNbt(NbtCompound nbt) { - super.readNbt(nbt); + public void load(@NotNull CompoundTag nbt) { + super.load(nbt); for (Map.Entry entry : outputDir.entrySet()) { String side = entry.getKey(); outputDir.put(side, nbt.getInt(side)); @@ -117,26 +119,32 @@ public void readNbt(NbtCompound nbt) { } @Override - public void writeNbt(NbtCompound nbt) { + public void saveAdditional(@NotNull CompoundTag nbt) { for (Map.Entry entry : outputDir.entrySet()) nbt.putInt(entry.getKey(), entry.getValue()); - super.writeNbt(nbt); + super.saveAdditional(nbt); } @Override - public void markDirty() { - super.markDirty(); + public void setChanged() { + super.setChanged(); blockupdate = true; } @Nullable @Override - public Packet toUpdatePacket() { - return BlockEntityUpdateS2CPacket.create(this); + public Packet getUpdatePacket() { + return ClientboundBlockEntityDataPacket.create(this); } @Override - public NbtCompound toInitialChunkDataNbt() { - return createNbt(); + public @NotNull CompoundTag getUpdateTag() { + return saveWithoutMetadata(); + } + + public IPeripheral getPeripheral(@NotNull Direction side) { + if (peripheral == null) + peripheral = new RedRouterBlockPeripheral(this); + return peripheral; } -} +} \ No newline at end of file diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/ScrollerBlockEntity.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/ScrollerBlockEntity.java index a03933b..48cc0ff 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/ScrollerBlockEntity.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/ScrollerBlockEntity.java @@ -1,74 +1,76 @@ package cc.tweaked_programs.cccbridge.blockEntity; -import cc.tweaked_programs.cccbridge.BlockRegister; +import cc.tweaked_programs.cccbridge.CCCRegister; import cc.tweaked_programs.cccbridge.CCCSoundEvents; +import cc.tweaked_programs.cccbridge.behaviour.LuaScrollValueBehaviour; import cc.tweaked_programs.cccbridge.peripherals.ScrollerBlockPeripheral; import com.simibubi.create.AllSoundEvents; -import com.simibubi.create.foundation.tileEntity.SmartTileEntity; -import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; -import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; -import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; +import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; +import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour; +import com.simibubi.create.foundation.blockEntity.behaviour.ValueBoxTransform; import com.simibubi.create.foundation.utility.VecHelper; import dan200.computercraft.api.peripheral.IPeripheral; -import dan200.computercraft.api.peripheral.IPeripheralTile; -import net.minecraft.block.BlockState; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.sound.SoundCategory; -import net.minecraft.state.property.Properties; -import net.minecraft.text.TranslatableText; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; -import org.jetbrains.annotations.NotNull; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.Nullable; import java.util.List; -public class ScrollerBlockEntity extends SmartTileEntity implements IPeripheralTile { + +public class ScrollerBlockEntity extends SmartBlockEntity implements PeripheralBlockEntity { private ScrollerBlockPeripheral peripheral; private boolean locked = false; private boolean updateLock = false; private boolean playTickSound = false; + private LuaScrollValueBehaviour scroller; public ScrollerBlockEntity(BlockPos pos, BlockState state) { - super(BlockRegister.getBlockEntityType("scroller_block"), pos, state); + super(CCCRegister.getBlockEntityType("scroller_block"), pos, state); } - @Override - public IPeripheral getPeripheral(@NotNull Direction side) { - if (side == this.getCachedState().get(Properties.FACING).getOpposite()) { + public IPeripheral getPeripheral(@Nullable Direction side) { + if (side == this.getBlockState().getValue(BlockStateProperties.FACING).getOpposite() || side == null) { if (peripheral == null) - peripheral = new ScrollerBlockPeripheral(this, this.getWorld()); + peripheral = new ScrollerBlockPeripheral(this); return peripheral; } return null; } public void setLock(boolean state) { locked = state; updateLock = true; } - public void playTickSound() { playTickSound = true; } - @Nullable - public ScrollValueBehaviour getBehaviour() { - TileEntityBehaviour behaviour = getBehaviour(ScrollValueBehaviour.TYPE); - if (behaviour instanceof ScrollValueBehaviour scrollValueBehaviour) - return scrollValueBehaviour; - return null; + public int getValue() { + return scroller.getValue(); + } + + public void setValue(int value) { + scroller.setValue(value); } - public static void tick(World world, BlockPos blockPos, BlockState state, BlockEntity be) { + public void fireUpdateValueEvent() { + if (peripheral != null) + peripheral.sendEvent("scroller_changed", scroller.getValue()); + } + + public static void tick(Level world, BlockPos blockPos, BlockState state, BlockEntity be) { if (!(be instanceof ScrollerBlockEntity scroller)) return; - if (scroller.updateLock && state.get(Properties.LOCKED) != scroller.locked) { + if (scroller.updateLock && state.getValue(BlockStateProperties.LOCKED) != scroller.locked) { world.playSound( null, blockPos, scroller.locked ? CCCSoundEvents.CAGE_LOCK : CCCSoundEvents.CAGE_UNLOCK, - SoundCategory.BLOCKS, + SoundSource.BLOCKS, 1.0f, 1.5f); - world.setBlockState(blockPos, state.with(Properties.LOCKED, scroller.locked)); + world.setBlock(blockPos, state.setValue(BlockStateProperties.LOCKED, scroller.locked), 19); // 19 = BLOCK_UPDATE_FLAGS scroller.updateLock = false; } if (scroller.playTickSound) { @@ -76,49 +78,46 @@ public static void tick(World world, BlockPos blockPos, BlockState state, BlockE null, blockPos, AllSoundEvents.SCROLL_VALUE.getMainEvent(), - SoundCategory.BLOCKS, + SoundSource.BLOCKS, 0.25f, 1.5f); scroller.playTickSound = false; } - - scroller.tick(); } @Override - public void addBehaviours(List behaviours) { - ScrollValueBehaviour scroller = new ScrollValueBehaviour(getCachedState().getBlock().getName(), this, new ControllerValueBoxTransform()) - .between(-150, 150) - .moveText(new Vec3d(9, 0, 10)) - .withUnit(i -> new TranslatableText("cccbridge.general.unit.scroller")) - .withCallback(i -> { if (this.peripheral != null) peripheral.newValue(i); }) - .interactiveWhen(playerEntity -> !(playerEntity.getWorld().getBlockState(this.getPos()).get(Properties.LOCKED))) - .withStepFunction(context -> context.shift ? 1 : 10) - .withFormatter(i -> { - StringBuilder number = new StringBuilder(String.valueOf(i)); - if (i <= -10 || i >= 10) - number.insert(number.length()-1,'.'); - else - number.insert( (i>=0) ? 0 : 1, "0."); - return number.toString(); - }); - scroller.value = 0; + public void addBehaviours(List behaviours) { + if (scroller == null) { + scroller = new LuaScrollValueBehaviour(this, new ControllerValueBoxTransform()); + } behaviours.add(scroller); } + public int getLimit() { + return scroller.getMax(); + } + + public void setLimit(int limit) { + scroller.between(limit); + } + + public boolean hasMinus() { + return scroller.hasMinus(); + } + + public void toggleMinusSpectrum(boolean state) { + scroller.setHasMinus(state); + } + private static class ControllerValueBoxTransform extends ValueBoxTransform.Sided { @Override - protected Vec3d getSouthLocation() { - return VecHelper.voxelSpace(8, 8, 0); + protected Vec3 getSouthLocation() { + return VecHelper.voxelSpace(8D, 8D, 0.01D); } @Override - protected boolean isSideActive(BlockState state, Direction direction) { return state.get(Properties.FACING) == direction; } + protected boolean isSideActive(BlockState state, Direction direction) { return state.getValue(BlockStateProperties.FACING) == direction; } - @Override - protected float getScale() { - return 0.5f; - } } } diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/SourceBlockEntity.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/SourceBlockEntity.java index 0e848b5..1420700 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/SourceBlockEntity.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/SourceBlockEntity.java @@ -1,39 +1,27 @@ package cc.tweaked_programs.cccbridge.blockEntity; -import cc.tweaked_programs.cccbridge.BlockRegister; +import cc.tweaked_programs.cccbridge.CCCRegister; import cc.tweaked_programs.cccbridge.peripherals.SourceBlockPeripheral; import dan200.computercraft.api.peripheral.IPeripheral; -import dan200.computercraft.api.peripheral.IPeripheralTile; -import net.minecraft.block.BlockState; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import org.jetbrains.annotations.NotNull; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.Nullable; -import java.util.List; - -public class SourceBlockEntity extends BlockEntity implements IPeripheralTile { +public class SourceBlockEntity extends BlockEntity implements PeripheralBlockEntity { private SourceBlockPeripheral peripheral; public SourceBlockEntity(BlockPos pos, BlockState state) { - super(BlockRegister.getBlockEntityType("source_block"), pos, state); + super(CCCRegister.getBlockEntityType("source_block"), pos, state); } - @Override - public IPeripheral getPeripheral(@NotNull Direction side) { + public IPeripheral getPeripheral(@Nullable Direction side) { if (peripheral == null) peripheral = new SourceBlockPeripheral(this); return peripheral; } - @Nullable - public List getContent() { - if (peripheral == null) - return null; - return peripheral.getContent(); - } - public void setSize(int width, int height) { if (peripheral != null) peripheral.setSize(width, height); diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/TargetBlockEntity.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/TargetBlockEntity.java index 61295f0..07b801a 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/TargetBlockEntity.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/TargetBlockEntity.java @@ -1,29 +1,21 @@ package cc.tweaked_programs.cccbridge.blockEntity; -import cc.tweaked_programs.cccbridge.BlockRegister; +import cc.tweaked_programs.cccbridge.CCCRegister; import cc.tweaked_programs.cccbridge.peripherals.TargetBlockPeripheral; import dan200.computercraft.api.peripheral.IPeripheral; -import dan200.computercraft.api.peripheral.IPeripheralTile; -import net.minecraft.block.BlockState; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.NotNull; import java.util.List; -public class TargetBlockEntity extends BlockEntity implements IPeripheralTile { +public class TargetBlockEntity extends BlockEntity implements PeripheralBlockEntity { private TargetBlockPeripheral peripheral; public TargetBlockEntity(BlockPos pos, BlockState state) { - super(BlockRegister.getBlockEntityType("target_block"), pos, state); - } - - @Override - public IPeripheral getPeripheral(@NotNull Direction side) { - if (peripheral == null) - peripheral = new TargetBlockPeripheral(this); - return peripheral; + super(CCCRegister.getBlockEntityType("target_block"), pos, state); } public void updateContent(int offset, List content) { @@ -31,20 +23,19 @@ public void updateContent(int offset, List content) { return; int height = getHeight(); int i = 0; - String dot = Character.toString(183); for (String line : content) { - if (i < height) { - // Replace chars that exist in C and can't be displayed in CC: - line = line.replaceAll("\u2588", "="); - line = line.replaceAll("\u2592", "-"); - line = line.replaceAll("\u2591", dot); - + if (i < height) peripheral.replaceLine(offset + i, line); - } i++; } } + public IPeripheral getPeripheral(@NotNull Direction side) { + if (peripheral == null) + peripheral = new TargetBlockPeripheral(this); + return peripheral; + } + public int getWidth() { if (peripheral == null) return 1; diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/AnimatronicBlockEntityRenderer.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/AnimatronicBlockEntityRenderer.java new file mode 100644 index 0000000..f3b256f --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/AnimatronicBlockEntityRenderer.java @@ -0,0 +1,33 @@ +package cc.tweaked_programs.cccbridge.blockEntityRenderer; + +import cc.tweaked_programs.cccbridge.blockEntity.AnimatronicBlockEntity; +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +import net.minecraft.client.renderer.entity.EntityRenderDispatcher; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.block.entity.BlockEntity; +import org.jetbrains.annotations.NotNull; + +public class AnimatronicBlockEntityRenderer implements BlockEntityRenderer { + private final EntityRenderDispatcher entityRenderer; + private static final float scale = 1F/32F*(32F-4F); + + public AnimatronicBlockEntityRenderer(BlockEntityRendererProvider.Context context) { + this.entityRenderer = Minecraft.getInstance().getEntityRenderDispatcher(); + } + + @Override + public void render(@NotNull AnimatronicBlockEntity blockEntity, float partialTick, @NotNull PoseStack poseStack, @NotNull MultiBufferSource bufferSource, int packedLight, int packedOverlay) { + poseStack.pushPose(); + + poseStack.scale(scale, scale, scale); + + Entity entity = blockEntity.getAnimatronic(); + this.entityRenderer.render(entity, 0.575D, 0.15D, 0.575D, 0.0F, partialTick, poseStack, bufferSource, packedLight); + + poseStack.popPose(); + } +} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/RedRouterBlockEntityRenderer.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/RedRouterBlockEntityRenderer.java new file mode 100644 index 0000000..ecc46a1 --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/RedRouterBlockEntityRenderer.java @@ -0,0 +1,105 @@ +package cc.tweaked_programs.cccbridge.blockEntityRenderer; + +import cc.tweaked_programs.cccbridge.CCCBridge; +import cc.tweaked_programs.cccbridge.Misc; +import cc.tweaked_programs.cccbridge.block.RedRouterBlock; +import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import com.mojang.math.Vector3f; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.core.Direction; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.inventory.InventoryMenu; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; + +import java.util.HashMap; +import java.util.Map; + + +public class RedRouterBlockEntityRenderer implements BlockEntityRenderer { + private final Map FACE_TEXTURE; + public RedRouterBlockEntityRenderer(BlockEntityRendererProvider.Context context) { + Map faces = new HashMap<>(); + for (int i=0; i<=16; i++) { + faces.put(i, new ResourceLocation(CCCBridge.MOD_ID, "block/redrouter/face/"+i)); + } + FACE_TEXTURE = faces; + } + + @Override + public void render(RedRouterBlockEntity blockEntity, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) { + BlockState block = blockEntity.getBlockState(); + VertexConsumer buffer = bufferSource.getBuffer(RenderType.cutout()); + int flickering = Misc.flickering(); + + poseStack.pushPose(); + + // Rotate + poseStack.translate(0.5D, 0.5D, 0.5D); + if (block.hasProperty(BlockStateProperties.HORIZONTAL_FACING)) + poseStack.mulPose(Vector3f.YP.rotationDegrees(getDir(block.getValue(BlockStateProperties.HORIZONTAL_FACING)))); + poseStack.translate(-0.5D, -0.5D, -0.5D); + + int id = 0; + if (block.hasProperty(RedRouterBlock.FACE)) + id = block.getValue(RedRouterBlock.FACE); + + TextureAtlasSprite sprite = Minecraft.getInstance().getTextureAtlas(InventoryMenu.BLOCK_ATLAS).apply(getFace(id)); + int sprite_size = sprite.getWidth(); + + poseStack.translate(0D, 0D, 2D/16D-0.01); + + buffer.vertex(poseStack.last().pose(), 0 ,0 ,0) + .color(0.7F, 0.7F, 0.7F, 1.0F) + .uv(sprite.getU(sprite_size), sprite.getV(sprite_size)) + .overlayCoords(OverlayTexture.NO_OVERLAY) + .uv2(flickering) + .normal(poseStack.last().normal(), 0, 0, 0).endVertex(); + + buffer.vertex(poseStack.last().pose(), 0 ,1 ,0) + .color(0.7F, 0.7F, 0.7F, 1.0F) + .uv(sprite.getU(sprite_size), sprite.getV(0)) + .overlayCoords(OverlayTexture.NO_OVERLAY) + .uv2(flickering) + .normal(poseStack.last().normal(), 0, 0, 0).endVertex(); + + buffer.vertex(poseStack.last().pose(), 1 ,1 ,0) + .color(0.7F, 0.7F, 0.7F, 1.0F) + .uv(sprite.getU(0), sprite.getV(0)) + .overlayCoords(OverlayTexture.NO_OVERLAY) + .uv2(flickering) + .normal(poseStack.last().normal(), 0, 0, 0).endVertex(); + + buffer.vertex(poseStack.last().pose(), 1 ,0 ,0) + .color(0.7F, 0.7F, 0.7F, 1.0F) + .uv(sprite.getU(0), sprite.getV(sprite_size)) + .overlayCoords(OverlayTexture.NO_OVERLAY) + .uv2(flickering) + .normal(poseStack.last().normal(), 0, 0, 0).endVertex(); + + poseStack.popPose(); + } + + public ResourceLocation getFace(int id) { + return (id >= 1 && id <= 16) ? FACE_TEXTURE.get(id) : FACE_TEXTURE.get(0); + } + + public int getDir(Direction dir) { + return switch(dir) { + case NORTH -> 0; + case EAST -> 270; + case SOUTH -> 180; + case WEST -> 90; + default -> 0; + }; + } +} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/display/SourceBlockDisplaySource.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/display/SourceBlockDisplaySource.java index 09198e5..2151a9c 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/display/SourceBlockDisplaySource.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/display/SourceBlockDisplaySource.java @@ -1,32 +1,42 @@ package cc.tweaked_programs.cccbridge.display; import cc.tweaked_programs.cccbridge.blockEntity.SourceBlockEntity; -import com.simibubi.create.content.logistics.block.display.DisplayLinkContext; -import com.simibubi.create.content.logistics.block.display.source.DisplaySource; -import com.simibubi.create.content.logistics.block.display.target.DisplayTargetStats; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.text.MutableText; -import net.minecraft.text.TranslatableText; +import cc.tweaked_programs.cccbridge.Misc; +import cc.tweaked_programs.cccbridge.peripherals.SourceBlockPeripheral; +import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext; +import com.simibubi.create.content.redstone.displayLink.source.DisplaySource; +import com.simibubi.create.content.redstone.displayLink.target.DisplayTargetStats; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.level.block.entity.BlockEntity; import java.util.LinkedList; import java.util.List; public class SourceBlockDisplaySource extends DisplaySource { @Override - public List provideText(DisplayLinkContext context, DisplayTargetStats stats) { - BlockEntity block = context.getSourceTE(); + public List provideText(DisplayLinkContext context, DisplayTargetStats stats) { + BlockEntity block = context.getSourceBlockEntity(); + if (!(block instanceof SourceBlockEntity sourceBlock)) return EMPTY; + if (!(sourceBlock.getPeripheral(null) instanceof SourceBlockPeripheral peripheral)) + return EMPTY; + sourceBlock.setSize(stats.maxColumns(), stats.maxRows()); - List data = sourceBlock.getContent(); + List data = peripheral.getContent(); if (data == null) return EMPTY; - List content = new LinkedList<>(); + List content = new LinkedList<>(); for (String line : data) - content.add(new TranslatableText("").append(line)); + content.add(Misc.toMCTxt(line)); return content; } + + @Override + public int getPassiveRefreshTicks() { + return 20; + } } \ No newline at end of file diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/display/TargetBlockDisplayTarget.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/display/TargetBlockDisplayTarget.java index 002fc07..4df4acc 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/display/TargetBlockDisplayTarget.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/display/TargetBlockDisplayTarget.java @@ -1,28 +1,29 @@ package cc.tweaked_programs.cccbridge.display; +import cc.tweaked_programs.cccbridge.Misc; import cc.tweaked_programs.cccbridge.blockEntity.TargetBlockEntity; -import com.simibubi.create.content.logistics.block.display.DisplayLinkContext; -import com.simibubi.create.content.logistics.block.display.target.DisplayBoardTarget; -import com.simibubi.create.content.logistics.block.display.target.DisplayTargetStats; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.text.MutableText; +import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext; +import com.simibubi.create.content.redstone.displayLink.target.DisplayBoardTarget; +import com.simibubi.create.content.redstone.displayLink.target.DisplayTargetStats; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.level.block.entity.BlockEntity; import java.util.LinkedList; import java.util.List; public class TargetBlockDisplayTarget extends DisplayBoardTarget { @Override - public void acceptFlapText(int line, List> text, DisplayLinkContext context) { - BlockEntity block = context.getTargetTE(); + public void acceptFlapText(int line, List> text, DisplayLinkContext context) { + BlockEntity block = context.getTargetBlockEntity(); if (!(block instanceof TargetBlockEntity targetBlock)) return; List content = new LinkedList<>(); - for (List c : text) { - String parts = ""; - for (MutableText sLine : c) - parts = parts + sLine.getString() + " "; - content.add(parts); + for (List c : text) { + StringBuilder parts = new StringBuilder(); + for (MutableComponent sLine : c) + parts.append(sLine.getString()).append(" "); + content.add(Misc.toCCTxt(parts.toString())); } targetBlock.updateContent(line, content); @@ -30,10 +31,10 @@ public void acceptFlapText(int line, List> text, DisplayLinkCo @Override public DisplayTargetStats provideStats(DisplayLinkContext context) { - BlockEntity block = context.getTargetTE(); + BlockEntity block = context.getTargetBlockEntity(); if (!(block instanceof TargetBlockEntity targetBlock)) return new DisplayTargetStats(24, 1, this); return new DisplayTargetStats(24, targetBlock.getWidth(), this); } -} +} \ No newline at end of file diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicEntity.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicEntity.java new file mode 100644 index 0000000..c346f6c --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicEntity.java @@ -0,0 +1,242 @@ +package cc.tweaked_programs.cccbridge.entity.animatronic; + +import cc.tweaked_programs.cccbridge.Misc; +import net.minecraft.core.Rotations; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; +import net.minecraft.network.syncher.EntityDataAccessor; +import net.minecraft.network.syncher.EntityDataSerializers; +import net.minecraft.network.syncher.SynchedEntityData; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.NotNull; + +import java.util.Optional; + +public class AnimatronicEntity extends Entity { + private static final Rotations DEFAULT_HEAD_POSE = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_BODY_POSE = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_LEFT_ARM_POSE = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_RIGHT_ARM_POSE = new Rotations(0.0F, 0.0F, 0.0F); + + public static final EntityDataAccessor DATA_HEAD_POSE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.ROTATIONS); + public static final EntityDataAccessor DATA_BODY_POSE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.ROTATIONS); + public static final EntityDataAccessor DATA_LEFT_ARM_POSE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.ROTATIONS); + public static final EntityDataAccessor DATA_RIGHT_ARM_POSE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.ROTATIONS); + public static final EntityDataAccessor DATA_FACE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.STRING); + + + private Rotations headPose = new Rotations(DEFAULT_HEAD_POSE.getX(), DEFAULT_HEAD_POSE.getY(), DEFAULT_HEAD_POSE.getZ()); + private Rotations bodyPose = new Rotations(DEFAULT_BODY_POSE.getX(), DEFAULT_BODY_POSE.getY(), DEFAULT_BODY_POSE.getZ()); + private Rotations leftArmPose = new Rotations(DEFAULT_LEFT_ARM_POSE.getX(), DEFAULT_LEFT_ARM_POSE.getY(), DEFAULT_LEFT_ARM_POSE.getZ()); + private Rotations rightArmPose = new Rotations(DEFAULT_RIGHT_ARM_POSE.getX(), DEFAULT_RIGHT_ARM_POSE.getY(), DEFAULT_RIGHT_ARM_POSE.getZ()); + + private Rotations current_headPose = new Rotations(DEFAULT_HEAD_POSE.getX(), DEFAULT_HEAD_POSE.getY(), DEFAULT_HEAD_POSE.getZ()); + private Rotations current_bodyPose = new Rotations(DEFAULT_BODY_POSE.getX(), DEFAULT_BODY_POSE.getY(), DEFAULT_BODY_POSE.getZ()); + private Rotations current_leftArmPose = new Rotations(DEFAULT_LEFT_ARM_POSE.getX(), DEFAULT_LEFT_ARM_POSE.getY(), DEFAULT_LEFT_ARM_POSE.getZ()); + private Rotations current_rightArmPose = new Rotations(DEFAULT_RIGHT_ARM_POSE.getX(), DEFAULT_RIGHT_ARM_POSE.getY(), DEFAULT_RIGHT_ARM_POSE.getZ()); + + private Rotations start_headPose = new Rotations(DEFAULT_HEAD_POSE.getX(), DEFAULT_HEAD_POSE.getY(), DEFAULT_HEAD_POSE.getZ()); + private Rotations start_bodyPose = new Rotations(DEFAULT_BODY_POSE.getX(), DEFAULT_BODY_POSE.getY(), DEFAULT_BODY_POSE.getZ()); + private Rotations start_leftArmPose = new Rotations(DEFAULT_LEFT_ARM_POSE.getX(), DEFAULT_LEFT_ARM_POSE.getY(), DEFAULT_LEFT_ARM_POSE.getZ()); + private Rotations start_rightArmPose = new Rotations(DEFAULT_RIGHT_ARM_POSE.getX(), DEFAULT_RIGHT_ARM_POSE.getY(), DEFAULT_RIGHT_ARM_POSE.getZ()); + + private boolean isMoving; + private double step; + private long start_animation; + + private String face; + + public AnimatronicEntity(EntityType entityType, Level level) { + super(entityType, level); + isMoving = true; + step = 0.0; + face = "normal"; + start_animation = 0; + } + + public void updateCurrentPoses(float partialTicks) { + step = (level.getGameTime()-start_animation+partialTicks) * (0.0175*6); + + current_headPose = updatePose(start_headPose, getDestinationHeadPose()); + current_bodyPose = updatePose(start_bodyPose, getDestinationBodyPose()); + current_leftArmPose = updatePose(start_leftArmPose, getDestinationLeftArmPose()); + current_rightArmPose = updatePose(start_rightArmPose, getDestinationRightArmPose()); + + if (step >= 1) { + isMoving = false; + current_headPose = getDestinationHeadPose(); + current_bodyPose = getDestinationBodyPose(); + current_leftArmPose = getDestinationLeftArmPose(); + current_rightArmPose = getDestinationRightArmPose(); + } + } + + private Rotations updatePose(Rotations start, Rotations destination) { + float x = Misc.updateMovement(start.getX(), destination.getX(), step); + float y = Misc.updateMovement(start.getY(), destination.getY(), step); + float z = Misc.updateMovement(start.getZ(), destination.getZ(), step); + return new Rotations(x, y, z); + } + + public boolean isMoving() { + return isMoving; + } + + public void startAnimation() { + // onLoad level is null; skip animation + if (level == null) { + current_headPose = getDestinationHeadPose(); + current_bodyPose = getDestinationBodyPose(); + current_leftArmPose = getDestinationLeftArmPose(); + current_rightArmPose = getRightArmPose(); + return; + } + + if (!level.isClientSide) + return; + + start_animation = level.getGameTime(); + start_headPose = current_headPose; + start_bodyPose = current_bodyPose; + start_leftArmPose = current_leftArmPose; + start_rightArmPose = current_rightArmPose; + isMoving = true; + step = 0.0; + } + + public ResourceLocation getFace() { + if (this.entityData.get(DATA_FACE) == null) + return AnimatronicRenderer.TEXTURE_FACE_NORMAL; + + return switch (this.entityData.get(DATA_FACE)) { + case "normal" -> AnimatronicRenderer.TEXTURE_FACE_NORMAL; + case "happy" -> AnimatronicRenderer.TEXTURE_FACE_HAPPY; + case "question" -> AnimatronicRenderer.TEXTURE_FACE_QUESTION; + case "sad" -> AnimatronicRenderer.TEXTURE_FACE_SAD; + + default -> AnimatronicRenderer.TEXTURE_FACE_NORMAL; + }; + } + + public void setFace(String face) { + this.entityData.set(DATA_FACE, face); + } + + public void setRightArmPose(Rotations rotations) { + this.entityData.set(DATA_RIGHT_ARM_POSE, rotations); + } + + public void setLeftArmPose(Rotations rotations) { + this.entityData.set(DATA_LEFT_ARM_POSE, rotations); + } + + public void setBodyPose(Rotations rotations) { + this.entityData.set(DATA_BODY_POSE, rotations); + } + + public void forceBodyPose(Rotations rotations) { + setBodyPose(rotations); + current_bodyPose = rotations; + } + + + public void setHeadPose(Rotations rotations) { + this.entityData.set(DATA_HEAD_POSE, rotations); + + } + + public Rotations getRightArmPose() { + return current_rightArmPose; + } + + public Rotations getLeftArmPose() { + return current_leftArmPose; + } + + public Rotations getBodyPose() { + return current_bodyPose; + } + + public Rotations getHeadPose() { + return current_headPose; + } + + public Rotations getDestinationHeadPose() { + return Optional.ofNullable(this.entityData.get(DATA_HEAD_POSE)).orElse(DEFAULT_HEAD_POSE); + } + + public Rotations getDestinationBodyPose() { + return Optional.ofNullable(this.entityData.get(DATA_BODY_POSE)).orElse(DEFAULT_BODY_POSE); + } + + public Rotations getDestinationLeftArmPose() { + return Optional.ofNullable(this.entityData.get(DATA_LEFT_ARM_POSE)).orElse(DEFAULT_LEFT_ARM_POSE); + } + + public Rotations getDestinationRightArmPose() { + return Optional.ofNullable(this.entityData.get(DATA_RIGHT_ARM_POSE)).orElse(DEFAULT_RIGHT_ARM_POSE); + } + + + public void read(CompoundTag nbt) { + readAdditionalSaveData(nbt); + } + + public void add(CompoundTag nbt) { + addAdditionalSaveData(nbt); + } + + @Override + protected void readAdditionalSaveData(CompoundTag nbt) { + ListTag ltHead = nbt.getList("headPose", 5); + this.setHeadPose(ltHead.isEmpty() ? DEFAULT_HEAD_POSE : new Rotations(ltHead)); + + ListTag ltBody = nbt.getList("bodyPose", 5); + this.setBodyPose(ltBody.isEmpty() ? DEFAULT_HEAD_POSE : new Rotations(ltBody)); + + ListTag ltLeftArm = nbt.getList("leftArmPose", 5); + this.setLeftArmPose(ltLeftArm.isEmpty() ? DEFAULT_HEAD_POSE : new Rotations(ltLeftArm)); + + ListTag ltArmPose = nbt.getList("rightArmPose", 5); + this.setRightArmPose(ltArmPose.isEmpty() ? DEFAULT_HEAD_POSE : new Rotations(ltArmPose)); + + setFace(nbt.getString("face")); + + startAnimation(); + } + + @Override + protected void addAdditionalSaveData(CompoundTag nbt) { + nbt.put("headPose", getDestinationHeadPose().save()); + nbt.put("bodyPose", getDestinationBodyPose().save()); + nbt.put("leftArmPose", getDestinationLeftArmPose().save()); + nbt.put("rightArmPose", getDestinationRightArmPose().save()); + if (this.entityData.get(DATA_FACE) != null) + nbt.putString("face", this.entityData.get(DATA_FACE)); + } + + @Override + protected void defineSynchedData() { + this.entityData.define(DATA_HEAD_POSE, headPose); + this.entityData.define(DATA_BODY_POSE, bodyPose); + this.entityData.define(DATA_LEFT_ARM_POSE, leftArmPose); + this.entityData.define(DATA_RIGHT_ARM_POSE, rightArmPose); + this.entityData.define(DATA_FACE, face); + } + + @Override + public @NotNull Packet getAddEntityPacket() { + return new ClientboundAddEntityPacket(this); + } + + @Override + public void onSyncedDataUpdated(EntityDataAccessor key) { + super.onSyncedDataUpdated(key); + startAnimation(); + } +} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicModel.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicModel.java new file mode 100644 index 0000000..04b31d9 --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicModel.java @@ -0,0 +1,65 @@ +package cc.tweaked_programs.cccbridge.entity.animatronic; + +import cc.tweaked_programs.cccbridge.CCCRegister; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.EntityModel; +import net.minecraft.client.model.geom.ModelLayerLocation; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import org.jetbrains.annotations.NotNull; + +public class AnimatronicModel extends EntityModel { + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(CCCRegister.getEntityTypeId("animatronic"), "main"); + private static final float awesomeFactor = ((float)Math.PI / 180F); + private final ModelPart root; + + public AnimatronicModel(ModelPart root) { + this.root = root.getChild("root"); + } + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create().texOffs(8, 32).addBox(-1.0F, -6.0F, -3.5F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 20).addBox(-3.0F, -4.0F, -4.5F, 6.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(26, 20).addBox(-6.0F, -2.5F, -3.0F, 12.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 10.0F, 0.0F)); + + PartDefinition head = root.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -9.0F, -5.0F, 10.0F, 10.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -6.0F, -2.5F)); + + PartDefinition rightarm = root.addOrReplaceChild("rightarm", CubeListBuilder.create().texOffs(0, 32).addBox(-1.0F, -2.0F, -1.0F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(-6.0F, -2.0F, -2.5F)); + + PartDefinition leftarm = root.addOrReplaceChild("leftarm", CubeListBuilder.create().texOffs(20, 20).addBox(-1.0F, -2.0F, -1.0F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(6.0F, -2.0F, -2.5F)); + + return LayerDefinition.create(meshdefinition, 64, 64); + } + + @Override + public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float partialTicks, float netHeadYaw, float headPitch) { + if (entity.isMoving()) + entity.updateCurrentPoses(partialTicks); + + this.root.getChild("head").xRot = entity.getHeadPose().getX() * awesomeFactor; + this.root.getChild("head").yRot = entity.getHeadPose().getY() * awesomeFactor; + this.root.getChild("head").zRot = entity.getHeadPose().getZ() * awesomeFactor; + + this.root.yRot = entity.getBodyPose().getY() * awesomeFactor; + this.root.xRot = entity.getBodyPose().getX() * awesomeFactor; + this.root.zRot = entity.getBodyPose().getZ() * awesomeFactor; + + this.root.getChild("leftarm").xRot = entity.getLeftArmPose().getX() * awesomeFactor; + this.root.getChild("leftarm").yRot = entity.getLeftArmPose().getY() * awesomeFactor; + this.root.getChild("leftarm").zRot = entity.getLeftArmPose().getZ() * awesomeFactor; + + this.root.getChild("rightarm").xRot = entity.getRightArmPose().getX() * awesomeFactor; + this.root.getChild("rightarm").yRot = entity.getRightArmPose().getY() * awesomeFactor; + this.root.getChild("rightarm").zRot = entity.getRightArmPose().getZ() * awesomeFactor; + } + + @Override + public void renderToBuffer(@NotNull PoseStack poseStack, @NotNull VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + root.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } +} \ No newline at end of file diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicRenderer.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicRenderer.java new file mode 100644 index 0000000..499f11b --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicRenderer.java @@ -0,0 +1,57 @@ +package cc.tweaked_programs.cccbridge.entity.animatronic; + +import cc.tweaked_programs.cccbridge.CCCBridge; +import cc.tweaked_programs.cccbridge.Misc; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.entity.EntityRenderer; +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.resources.ResourceLocation; +import org.jetbrains.annotations.NotNull; + +public class AnimatronicRenderer extends EntityRenderer { + public static final ResourceLocation TEXTURE_BODY = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/body.png"); + + public static final ResourceLocation TEXTURE_FACE_NORMAL = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_normal.png"); + public static final ResourceLocation TEXTURE_FACE_HAPPY = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_happy.png"); + public static final ResourceLocation TEXTURE_FACE_QUESTION = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_question.png"); + public static final ResourceLocation TEXTURE_FACE_SAD = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_sad.png"); + + public static final ResourceLocation TEXTURE_FACE_CURSED = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_creepy.png"); + + private final AnimatronicModel model; + + public AnimatronicRenderer(EntityRendererProvider.Context context) { + super(context); + this.model = new AnimatronicModel<>(context.bakeLayer(AnimatronicModel.LAYER_LOCATION)); + } + + @Override + public @NotNull ResourceLocation getTextureLocation(@NotNull AnimatronicEntity entity) { + return TEXTURE_BODY; + } + + @Override + public void render(@NotNull AnimatronicEntity entity, float yaw, float tickDelta, PoseStack poseStack, MultiBufferSource multiBufferSource, int light) { + // Setup + poseStack.pushPose(); + poseStack.scale(-1.0F, -1.0F, 1.0F); + poseStack.translate(0.0F, -1.5F, 0.0F); + + this.model.setupAnim(entity, 0.0F, 0.0F, tickDelta, 0.0F, 0.0F); + + // Render model + VertexConsumer vertexConsumer = multiBufferSource.getBuffer(this.model.renderType(TEXTURE_BODY)); + this.model.renderToBuffer(poseStack, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + + // Eyes + vertexConsumer = multiBufferSource.getBuffer(this.model.renderType(Misc.rareCreepiness() ? TEXTURE_FACE_CURSED : entity.getFace())); + this.model.renderToBuffer(poseStack, vertexConsumer, Misc.flickering(), OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + + // Checkout + poseStack.popPose(); + super.render(entity, yaw, tickDelta, poseStack, multiBufferSource, light); + } +} \ No newline at end of file diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/AnimatronicPeripheral.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/AnimatronicPeripheral.java new file mode 100644 index 0000000..3c2c115 --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/AnimatronicPeripheral.java @@ -0,0 +1,234 @@ +package cc.tweaked_programs.cccbridge.peripherals; + +import cc.tweaked_programs.cccbridge.blockEntity.AnimatronicBlockEntity; +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.lua.LuaFunction; +import dan200.computercraft.api.lua.MethodResult; +import net.minecraft.core.Rotations; +import net.minecraft.util.Mth; + +/** + * This peripheral is used by the Animatronic. It is an electronic puppet that can be positioned however needed. + * Neat for decoration purposes! A bit rusty, however. + * + * @version 1.1 + */ +public class AnimatronicPeripheral extends TweakedPeripheral { + private float[] headRot; + private float[] bodyRot; + private float[] leftArmRot; + private float[] rightArmRot; + + public AnimatronicPeripheral(AnimatronicBlockEntity blockEntity) { + super("animatronic", blockEntity); + + headRot = new float[]{0,0,0}; + bodyRot = new float[]{0,0,0}; + leftArmRot = new float[]{0,0,0}; + rightArmRot = new float[]{0,0,0}; + } + + /** + * Changes the face of the Animatronic. + * + * @param face The new face. Must be either 'normal', 'happy', 'question' or 'sad'. + * + * @throws LuaException Whenever the given string is not one of those types. + */ + @LuaFunction + public final void setFace(String face) throws LuaException { + if (face.equals("normal") || face.equals("happy") || face.equals("question") || face.equals("sad")) { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + be.setFace(face); + be.setChanged(); + } + } else throw new LuaException("Given string must be either 'normal', 'happy', 'question' or 'sad'"); + } + + /** + * Pushes the stored rotation values to the Animatronic. + * After pushing them, the rotations get reset to 0 everywhere. + */ + @LuaFunction + public final void push() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + be.setHeadPose(headRot[0], headRot[1], headRot[2]); + be.setBodyPose(bodyRot[0], bodyRot[1], bodyRot[2]); + be.setLeftArmPose(leftArmRot[0], leftArmRot[1], leftArmRot[2]); + be.setRightArmPose(rightArmRot[0], rightArmRot[1], rightArmRot[2]); + be.setChanged(); + } + + headRot = new float[]{0,0,0}; + bodyRot = new float[]{0,0,0}; + leftArmRot = new float[]{0,0,0}; + rightArmRot = new float[]{0,0,0}; + } + + /** + * Sets the head rotation. + * Can only be set within the bounds -180° to 180° for `X`, `Y` and `Z`. + * + * @param x The X rotation. + * @param y The Y rotation. + * @param z The Z rotation. + */ + @LuaFunction + public final void setHeadRot(double x, double y, double z) { + x = Mth.clamp(x, -180D, 180D); + y = Mth.clamp(y, -180D, 180D); + z = Mth.clamp(z, -180D, 180D); + headRot = new float[]{(float)x, (float)y, (float)z}; + } + + /** + * Sets the body rotation. + * Can only be set within the bounds -180° to 180° for `Y` and `Z`; + * > Note: `X` can be set within 360°. + * + * @param x The X rotation. + * @param y The Y rotation. + * @param z The Z rotation. + */ + @LuaFunction + public final void setBodyRot(double x, double y, double z) { + x = Mth.clamp(x, -360D, 360D); + y = Mth.clamp(y, -180D, 180D); + z = Mth.clamp(z, -180D, 180D); + bodyRot = new float[]{(float)x, (float)y, (float)z}; + } + + /** + * Sets the left arm rotation. + * Can only be set within the bounds -180° to 180° for `X`, `Y` and `Z`. + * + * @param x The X rotation. + * @param y The Y rotation. + * @param z The Z rotation. + */ + @LuaFunction + public final void setLeftArmRot(double x, double y, double z) { + x = Mth.clamp(x, -180, 180); + y = Mth.clamp(y, -180, 180); + z = Mth.clamp(z, -180, 180); + leftArmRot = new float[]{(float)x, (float)y, (float)z}; + } + + /** + * Sets the right arm rotation. + * Can only be set within the bounds -180° to 180° for `X`, `Y` and `Z`. + * + * @param x The X rotation. + * @param y The Y rotation. + * @param z The Z rotation. + */ + @LuaFunction + public final void setRightArmRot(double x, double y, double z) { + x = Mth.clamp(x, -180, 180); + y = Mth.clamp(y, -180, 180); + z = Mth.clamp(z, -180, 180); + rightArmRot = new float[]{(float)x, (float)y, (float)z}; + } + + /** + * Returns the current stored head rotation. + * + * @return Head rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getStoredHeadRot() { + return MethodResult.of((double)headRot[0], (double)headRot[1], (double)headRot[2]); + } + + /** + * Returns the current stored body rotation. + * + * @return Body rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getStoredBodyRot() { + return MethodResult.of((double)bodyRot[0], (double)bodyRot[1], (double)bodyRot[2]); + } + + /** + * Returns the current stored left arm rotation. + * + * @return Left arm rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getStoredLeftArmRot() { + return MethodResult.of((double)leftArmRot[0], (double)leftArmRot[1], (double)leftArmRot[2]); + } + + /** + * Returns the current stored right arm rotation. + * + * @return Right arm rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getStoredRightArmRot() { + return MethodResult.of((double)rightArmRot[0], (double)rightArmRot[1], (double)rightArmRot[2]); + } + + /** + * Returns the head rotation of the Animatronic. + * + * @return Head rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getAppliedHeadRot() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + Rotations rot = be.getHeadPose(); + return MethodResult.of((double)rot.getX(), (double)rot.getY(), (double)rot.getZ()); + } + return MethodResult.of(0F, 0F, 0F); + } + + /** + * Returns the body rotation of the Animatronic. + * + * @return Body rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getAppliedBodyRot() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + Rotations rot = be.getBodyPose(); + return MethodResult.of((double)rot.getX(), (double)rot.getY(), (double)rot.getZ()); + } + return MethodResult.of(0F, 0F, 0F); + } + + /** + * Returns the left arm rotation of the Animatronic. + * + * @return Left arm rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getAppliedLeftArmRot() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + Rotations rot = be.getLeftArmPose(); + return MethodResult.of((double)rot.getX(), (double)rot.getY(), (double)rot.getZ()); + } + return MethodResult.of(0F, 0F, 0F); + } + + /** + * Returns the right arm rotation of the Animatronic. + * + * @return Right arm rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getAppliedRightArmRot() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + Rotations rot = be.getRightArmPose(); + return MethodResult.of((double)rot.getX(), (double)rot.getY(), (double)rot.getZ()); + } + return MethodResult.of(0F, 0F, 0F); + } +} diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/RedRouterBlockPeripheral.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/RedRouterBlockPeripheral.java index ba6424c..72a5491 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/RedRouterBlockPeripheral.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/RedRouterBlockPeripheral.java @@ -3,36 +3,43 @@ import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.lua.LuaFunction; -import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.core.computer.ComputerSide; -import net.minecraft.util.math.Direction; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import net.minecraft.core.Direction; -public class RedRouterBlockPeripheral implements IPeripheral { - private final RedRouterBlockEntity redrouter_be; +import java.util.LinkedList; +import java.util.List; - public RedRouterBlockPeripheral(RedRouterBlockEntity redrouter_block_entity) { - this.redrouter_be = redrouter_block_entity; - } +/** + * This peripheral is used by the RedRouter. It works very similar to the Redstone API. + * + * @version 1.1 + */ +public class RedRouterBlockPeripheral extends TweakedPeripheral { + public static final String REDSTONE_EVENT = "redstone"; + private final List pcs = new LinkedList<>(); - @NotNull - @Override - public String getType() { - return "redrouter"; + public RedRouterBlockPeripheral(RedRouterBlockEntity blockentity) { + super("redrouter", blockentity); } public Direction getActualSide(ComputerSide side) { - Direction facing = redrouter_be.getFacing(); - return switch (side.getName()) { - case ("front") -> facing.getOpposite(); - case ("back") -> facing; - case ("left") -> facing.rotateYClockwise(); - case ("right") -> facing.rotateYCounterclockwise(); - case ("top") -> Direction.DOWN; - case ("bottom") -> Direction.UP; - default -> Direction.NORTH; - }; + RedRouterBlockEntity be = getTarget(); + + if (be != null) { + Direction facing = getTarget().getFacing(); + return switch (side.getName()) { + case ("front") -> facing.getOpposite(); + case ("back") -> facing; + case ("left") -> facing.getClockWise(); + case ("right") -> facing.getCounterClockWise(); + case ("top") -> Direction.DOWN; + case ("bottom") -> Direction.UP; + default -> Direction.NORTH; + }; + } + + return Direction.NORTH; } /** @@ -43,7 +50,9 @@ public Direction getActualSide(ComputerSide side) { */ @LuaFunction public final void setOutput(ComputerSide side, boolean on) { - redrouter_be.setPower(getActualSide(side).getName(), on ? 15 : 0); + RedRouterBlockEntity be = getTarget(); + if (be != null) + be.setPower(getActualSide(side).getName(), on ? 15 : 0); } /** @@ -55,7 +64,11 @@ public final void setOutput(ComputerSide side, boolean on) { */ @LuaFunction public final boolean getOutput(ComputerSide side) { - return redrouter_be.getPower(getActualSide(side)) > 0; + RedRouterBlockEntity be = getTarget(); + if (be != null) + return be.getPower(getActualSide(side)) > 0; + + return false; } /** @@ -66,7 +79,11 @@ public final boolean getOutput(ComputerSide side) { */ @LuaFunction public final boolean getInput(ComputerSide side) { - return redrouter_be.getRedstoneInput(getActualSide(side)) > 0; + RedRouterBlockEntity be = getTarget(); + if (be != null) + return be.getRedstoneInput(getActualSide(side)) > 0; + + return false; } /** @@ -79,7 +96,10 @@ public final boolean getInput(ComputerSide side) { @LuaFunction({"setAnalogOutput", "setAnalogueOutput"}) public final void setAnalogOutput(ComputerSide side, int value) throws LuaException { if (value < 0 || value > 15) throw new LuaException("Expected number in range 0-15"); - redrouter_be.setPower(getActualSide(side).getName(), value); + RedRouterBlockEntity be = getTarget(); + + if (be != null) + be.setPower(getActualSide(side).getName(), value); } /** @@ -91,7 +111,11 @@ public final void setAnalogOutput(ComputerSide side, int value) throws LuaExcept */ @LuaFunction({"getAnalogOutput", "getAnalogueOutput"}) public final int getAnalogOutput(ComputerSide side) { - return redrouter_be.getPower(getActualSide(side)); + RedRouterBlockEntity be = getTarget(); + if (be != null) + return be.getPower(getActualSide(side)); + + return 0; } /** @@ -102,11 +126,10 @@ public final int getAnalogOutput(ComputerSide side) { */ @LuaFunction({"getAnalogInput", "getAnalogueInput"}) public final int getAnalogInput(ComputerSide side) { - return redrouter_be.getRedstoneInput(getActualSide(side)); - } + RedRouterBlockEntity be = getTarget(); + if (be != null) + return be.getRedstoneInput(getActualSide(side)); - @Override - public boolean equals(@Nullable IPeripheral other) { - return this == other || other instanceof RedRouterBlockPeripheral redrouter && redrouter.redrouter_be == redrouter_be; + return 0; } } diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/ScrollerBlockPeripheral.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/ScrollerBlockPeripheral.java index 8aa173b..6ac0456 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/ScrollerBlockPeripheral.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/ScrollerBlockPeripheral.java @@ -1,52 +1,37 @@ package cc.tweaked_programs.cccbridge.peripherals; import cc.tweaked_programs.cccbridge.blockEntity.ScrollerBlockEntity; -import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; import dan200.computercraft.api.lua.LuaFunction; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; -import net.minecraft.state.property.Properties; -import net.minecraft.world.World; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import javax.annotation.Nonnull; -import java.util.LinkedList; -import java.util.List; - -public class ScrollerBlockPeripheral implements IPeripheral { - private final ScrollerBlockEntity scroller; - private final World level; - private final List pcs = new LinkedList<>(); - - public ScrollerBlockPeripheral(ScrollerBlockEntity block_entity, World level) { - this.scroller = block_entity; - this.level = level; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; + +/** + * This peripheral is used by the Scroller Pane. It allows to interact with its valued that the player can manipulate + * (as long as this peripheral allows though, as it call lock it for outside interactions) + * + * @version 2.0 + */ +public class ScrollerBlockPeripheral extends TweakedPeripheral { + + public ScrollerBlockPeripheral(ScrollerBlockEntity blockentity) { + super("scroller", blockentity); } - @Override - public void attach(@Nonnull IComputerAccess computer) { - pcs.add(computer); - } - - @Override - public void detach(@Nonnull IComputerAccess computer) { - pcs.removeIf(p -> (p.getID() == computer.getID())); - } - - public void newValue(int value) { - for (IComputerAccess pc : pcs) - pc.queueEvent("scroller_changed", pc.getAttachmentName(), (double)(value/10)); - } - - /** * Returns whether the Scroller Pane is locked or not. * @return The state */ @LuaFunction public final boolean isLocked() { - return level.getBlockState(scroller.getPos()).get(Properties.LOCKED); + ScrollerBlockEntity be = getTarget(); + if (be != null) { + Level level = getTarget().getLevel(); + + if (level != null) + return level.getBlockState(be.getBlockPos()).getValue(BlockStateProperties.LOCKED); + } + + return false; } /** @@ -54,45 +39,88 @@ public final boolean isLocked() { * @param state Sate for lock */ @LuaFunction - public final void setLock(boolean state) { scroller.setLock(state); } + public final void setLock(boolean state) { + ScrollerBlockEntity be = getTarget(); + if (be != null) + be.setLock(state); + } /** - * Returns the current value of the Scroller Pane. - * @return Value (-15.0 - 15.0) + * Returns the selected value of the Scroller Pane. + * + * @return The selected value. */ @LuaFunction - public final double getValue() { - ScrollValueBehaviour scrollValueBehaviour = scroller.getBehaviour(); - if (scrollValueBehaviour == null) return 0.0; + public final int getValue() { + ScrollerBlockEntity be = getTarget(); + if (be != null) + return be.getValue(); - return (double)scrollValueBehaviour.getValue()/10; + return 0; } /** - * Sets a new value for the Scroller Pane - * @param value The new value (Must be in between -15.0 - 15.0) + * Changes the selected value. + * @param value The new value to select. */ @LuaFunction - public final void setValue(double value) { - ScrollValueBehaviour scrollValueBehaviour = scroller.getBehaviour(); - if (scrollValueBehaviour == null) return; + public final void setValue(int value) { + ScrollerBlockEntity be = getTarget(); + if (be != null) + be.setValue(value); + } - if (value > 15) value = 15; - else if (value < -15) value = -15; + /** + * Returns the limit relative to zero. + * E.g. 15 for from 0 to 15. + * + * @return The limit. + */ + @LuaFunction + public final int getLimit() { + ScrollerBlockEntity be = getTarget(); + if (be != null) + return be.getLimit(); - scrollValueBehaviour.setValue((int)(value*10)); - scroller.playTickSound(); + return 0; } + /** + * Returns whenever the Scroller Pane has the minus spectrum enabled. + * + * @return true for when the minus spectrum is enabled, and false for the opposite. + */ + @LuaFunction + public final boolean hasMinusSpectrum() { + ScrollerBlockEntity be = getTarget(); + if (be != null) + return be.hasMinus(); + + return false; + } - @NotNull - @Override - public String getType() { - return "scroller"; + /** + * Enables or disables the minus spectrum. + * + * @param state true for enabled minus spectrum, false for the opposite. + */ + @LuaFunction + public final void toggleMinusSpectrum(boolean state) { + ScrollerBlockEntity be = getTarget(); + if (be != null) + be.toggleMinusSpectrum(state); } - @Override - public boolean equals(@Nullable IPeripheral other) { - return this == other || other instanceof ScrollerBlockPeripheral s && s.scroller == scroller; + /** + * Sets a new limit relative to zero. + * If minus spectrum enabled, the limit then gets mirrored to the minus spectrum too. + * + * @param limit The new limit. + */ + @LuaFunction + public final void setLimit(int limit) { + ScrollerBlockEntity be = getTarget(); + if (be != null) + be.setLimit(limit); } } diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SourceBlockPeripheral.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SourceBlockPeripheral.java index 33d073c..b7b66c3 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SourceBlockPeripheral.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SourceBlockPeripheral.java @@ -11,31 +11,21 @@ import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; +import javax.xml.transform.Source; import java.util.LinkedList; import java.util.List; -public class SourceBlockPeripheral implements IPeripheral { - private final SourceBlockEntity source_block_entity; +/** + * This peripheral is used by the Source Block. It is used to give some kind of Create Display Targets data. + * The peripheral acts similar to a normal Terminal, with some implementations from the Window API and other limitations like no control over the colors. + * + * @version 1.1 + */ +public class SourceBlockPeripheral extends TweakedPeripheral { private final Terminal term = new Terminal(4, 2); - private final List pcs = new LinkedList<>(); - public SourceBlockPeripheral(SourceBlockEntity source_block_entity) { - this.source_block_entity = source_block_entity; - } - - @Override - public void attach(@Nonnull IComputerAccess computer) { - pcs.add(computer); - } - - @Override - public void detach(@Nonnull IComputerAccess computer) { - pcs.removeIf(p -> (p.getID() == computer.getID())); - } - - public void resize() { - for (IComputerAccess pc : pcs) - pc.queueEvent("monitor_resize", pc.getAttachmentName()); + public SourceBlockPeripheral(SourceBlockEntity blockentity) { + super("create_source", blockentity); } public void setSize(int width, int height) { @@ -43,24 +33,14 @@ public void setSize(int width, int height) { int oldH = term.getHeight(); if (!(oldW != width || oldH != height)) return; term.resize(width, height); - resize(); + super.sendEvent("monitor_resize"); } public List getContent() { List content = new LinkedList<>(); - // Replace chars that exist in CC and can't be displayed in C: - for (int i = 0; i < term.getHeight(); i++) { - String line = term.getLine(i).toString(); - for (int j = 0; j < line.length(); j++) { - char ch = line.charAt(j); - - // Printable chars in byte range - if (ch < 32 || (ch > 126 && ch < 161)) - line = line.substring(0, j) + '?' + line.substring(j + 1); - } - content.add(line); - } + for (int i = 0; i < term.getHeight(); i++) + content.add( term.getLine(i).toString()); return content; } @@ -148,16 +128,4 @@ public final Object[] getCursorPos() { public final Object[] getSize() { return new Object[]{term.getWidth(), term.getHeight()}; } - - - @NotNull - @Override - public String getType() { - return "create_source"; - } - - @Override - public boolean equals(@Nullable IPeripheral other) { - return this == other || other instanceof SourceBlockPeripheral source && source.source_block_entity == source_block_entity; - } -} +} \ No newline at end of file diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TargetBlockPeripheral.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TargetBlockPeripheral.java index 209c49f..043713f 100644 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TargetBlockPeripheral.java +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TargetBlockPeripheral.java @@ -9,13 +9,16 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class TargetBlockPeripheral implements IPeripheral { - private final TargetBlockEntity target_block_entity; +/** + * This peripheral is used by the Target Block. It is used to get data from Create Display Sources. The data has to be synced by the BlockEntity. + * + * @version 1.1 + */ +public class TargetBlockPeripheral extends TweakedPeripheral { private final Terminal term = new Terminal(32, 24); - - public TargetBlockPeripheral(TargetBlockEntity target_block_entity) { - this.target_block_entity = target_block_entity; + public TargetBlockPeripheral(TargetBlockEntity blockentity) { + super("create_target", blockentity); } public void replaceLine(int y, String line) { @@ -30,6 +33,10 @@ public int getWidth() { return term.getWidth(); } + public int getHeight() { + return term.getHeight(); + } + /** * Sets the new width of the display. Cannot be larger than 164 chars. * @@ -42,10 +49,6 @@ public final void setWidth(int width) throws LuaException { term.resize(width, 16); } - public int getHeight() { - return term.getHeight(); - } - /** * Clears the whole screen. */ @@ -72,7 +75,7 @@ public final void clearLine(int y) { * * @param y The y position on the display. * @return The string from the given Y position. - * @throws LuaException When given number is not in range 1-[terminal height]. + * @throws LuaException When given number is not in range 1-[terminal height] */ @LuaFunction public final String getLine(int y) throws LuaException { @@ -91,15 +94,4 @@ public final String getLine(int y) throws LuaException { public final Object[] getSize() { return new Object[]{term.getWidth(), term.getHeight()}; } - - @NotNull - @Override - public String getType() { - return "create_target"; - } - - @Override - public boolean equals(@Nullable IPeripheral other) { - return this == other || other instanceof TargetBlockPeripheral target && target.target_block_entity == target_block_entity; - } -} +} \ No newline at end of file diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TrainPeripheral.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TrainPeripheral.java deleted file mode 100644 index 9a44946..0000000 --- a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TrainPeripheral.java +++ /dev/null @@ -1,193 +0,0 @@ -package cc.tweaked_programs.cccbridge.peripherals; - -import com.mojang.authlib.GameProfile; -import com.simibubi.create.Create; -import com.simibubi.create.content.logistics.trains.GraphLocation; -import com.simibubi.create.content.logistics.trains.entity.Train; -import com.simibubi.create.content.logistics.trains.management.edgePoint.station.GlobalStation; -import com.simibubi.create.content.logistics.trains.management.edgePoint.station.StationTileEntity; -import com.simibubi.create.content.logistics.trains.management.edgePoint.station.TrainEditPacket.TrainEditReturnPacket; -import com.simibubi.create.content.logistics.trains.management.schedule.Schedule; -import com.simibubi.create.foundation.networking.AllPackets; -import dan200.computercraft.api.lua.LuaFunction; -import dan200.computercraft.api.lua.MethodResult; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.text.Text; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.World; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.UUID; - -public class TrainPeripheral implements IPeripheral { - private static Schedule schedule; - private final World level; - private final StationTileEntity station; - - public TrainPeripheral(@NotNull BlockPos pos, World level) { - this.level = level; - station = (StationTileEntity) level.getBlockEntity(pos); - } - - - @NotNull - @Override - public String getType() { - return "train_station"; - } - - /** - * Assembles a train. - * - * @return Whether it was successful or not with a message. - */ - @LuaFunction - public final MethodResult assemble() { - if (station.getStation().getPresentTrain() != null) { - return MethodResult.of(false, "There is a assembled Train"); - } - if (station.tryEnterAssemblyMode()) { - station.assemble(UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5")); - station.tick(); - if (this.schedule == null) { - return MethodResult.of(false, "No Schedule saved"); - } - station.getStation().getPresentTrain().runtime.setSchedule(this.schedule, true); - this.schedule = null; - return MethodResult.of(true, "Train assembled"); - } - return MethodResult.of(false, "Can't assemble Train"); - } - - /** - * Disassembles a train. - * - * @return Whether it was successful or not with a message. - */ - @LuaFunction - public final MethodResult disassemble() { - if (station.getStation().getPresentTrain() == null) { - return MethodResult.of(false, "there is no Train"); - } - if (station.getStation().getPresentTrain().canDisassemble()) { - Direction direction = station.getAssemblyDirection(); - BlockPos position = station.edgePoint.getGlobalPosition().up(); - this.schedule = station.getStation().getPresentTrain().runtime.getSchedule(); - ServerPlayerEntity player = new ServerPlayerEntity(level.getServer(), level.getServer().getOverworld(), new GameProfile(UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"), "Notch")); - station.getStation().getPresentTrain().disassemble(player, direction, position); - return MethodResult.of(true, "Train disassembled"); - } - return MethodResult.of(false, "Can't disassemble Train"); - } - - /** - * Returns the current station name. - * - * @return Name of station. - */ - @LuaFunction - public String getStationName() { - return station.getStation().name; - } - - /** - * Returns the current trains name. - * - * @return Name of train. - */ - @LuaFunction - public String getTrainName() { - return Objects.requireNonNull(station.getStation().getPresentTrain()).name.getString(); - } - - /** - * Sets the stations name - * - * @param name The new name. - * @return Whether it was successful or not. - */ - @LuaFunction - public final boolean setStationName(@NotNull String name) { - GlobalStation station2 = station.getStation(); - GraphLocation graphLocation = station.edgePoint.determineGraphLocation(); - if (station2 != null && graphLocation != null) { - station2.name = name; - Create.RAILWAYS.sync.pointAdded(graphLocation.graph, station2); - Create.RAILWAYS.markTracksDirty(); - station.notifyUpdate(); - return true; - } - //AllPackets.channel.sendToServer(StationEditPacket.configure(station.getBlockPos(),false,name)); - return false; - } - - /** - * Sets the current trains name. - * - * @param name The new name. - * @return Whether it was successful or not with a message. - */ - @LuaFunction - public final MethodResult setTrainName(@NotNull String name) { - if (station.getStation().getPresentTrain() == null) { - return MethodResult.of(false, "There is no train to set the name of"); - } - Train train = station.getStation().getPresentTrain(); - Train Train = Create.RAILWAYS.sided(level).trains.get(train.id); - if (Train == null) { - return MethodResult.of(false, "Train not found"); - } - if (!name.isBlank()) { - Train.name = Text.of(name); - station.tick(); - AllPackets.channel.sendToClientsInServer(new TrainEditReturnPacket(train.id, name, Train.icon.getId()), level.getServer()); - return MethodResult.of(true, "Train name set to " + name); - } - //AllPackets.channel.sendToServer(new TrainEditPacket(train.id, name, train.icon.getId())); - return MethodResult.of(false, "Train name cannot be blank"); - } - - /** - * Gets the number of Bogeys attached to the current train. - * - * @return The number of Bogeys. - */ - @LuaFunction - public int getBogeys() { - if (station.getStation().getPresentTrain() == null) { - return 0; - } - return station.getStation().getPresentTrain().carriages.size(); - } - - /** - * Returns boolean whether a train os present or not. - * - * @return Whether it was successful or not. - */ - @LuaFunction - public boolean getPresentTrain() { - return station.getStation().getPresentTrain() != null; - } - - /** - * Clears the schedule saved in the station. - */ - @LuaFunction - public void clearSchedule() { - this.schedule = null; - } - - @Override - public boolean equals(@Nullable IPeripheral iPeripheral) { - return this == iPeripheral; - } -} \ No newline at end of file diff --git a/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TweakedPeripheral.java b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TweakedPeripheral.java new file mode 100644 index 0000000..258e453 --- /dev/null +++ b/fabric/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TweakedPeripheral.java @@ -0,0 +1,58 @@ +package cc.tweaked_programs.cccbridge.peripherals; + +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; +import net.minecraft.world.level.block.entity.BlockEntity; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.annotation.Nonnull; +import java.util.LinkedList; +import java.util.List; + +/** + * I did not steal the name from Create. I swear! + * No seriously! + */ +abstract class TweakedPeripheral implements IPeripheral { + private final String type; + private final BE blockEntity; + private final List computers = new LinkedList<>(); + + public TweakedPeripheral(String type, @Nullable BE blockEntity) { + this.type = type; + this.blockEntity = blockEntity; + } + + public void sendEvent(@Nonnull String event, @Nullable Object... arguments) { + for (IComputerAccess pc : computers) + pc.queueEvent(event, pc.getAttachmentName(), arguments); + } + + @Override + public void attach(@Nonnull IComputerAccess computer) { + computers.add(computer); + } + + @Override + public void detach(@Nonnull IComputerAccess computer) { + computers.removeIf(p -> (p.getID() == computer.getID())); + } + + @NotNull + @Override + public String getType() { + return type; + } + + @Nullable + @Override + public BE getTarget() { + return blockEntity; + } + + @Override + public boolean equals(@Nullable IPeripheral other) { + return other == this && other.getType().equals(type) && other.getTarget() == this.getTarget(); + } +} diff --git a/fabric/src/main/resources/assets/cccbridge/blockstates/animatronic_block.json b/fabric/src/main/resources/assets/cccbridge/blockstates/animatronic_block.json new file mode 100644 index 0000000..ca39b68 --- /dev/null +++ b/fabric/src/main/resources/assets/cccbridge/blockstates/animatronic_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "cccbridge:block/animatronic_block" } + } +} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/blockstates/redrouter_block.json b/fabric/src/main/resources/assets/cccbridge/blockstates/redrouter_block.json index 073fb2f..cab483b 100644 --- a/fabric/src/main/resources/assets/cccbridge/blockstates/redrouter_block.json +++ b/fabric/src/main/resources/assets/cccbridge/blockstates/redrouter_block.json @@ -1,76 +1,224 @@ { - "variants": { - "facing=north": [ - { "model": "cccbridge:block/redrouter_face/1", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/2", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/3", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/4", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/5", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/6", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/7", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/8", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/9", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/10", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/11", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/12", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/13", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/14", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/15", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/16", "uvlock": true } - ], - "facing=east": [ - { "model": "cccbridge:block/redrouter_face/1", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/2", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/3", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/4", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/5", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/6", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/7", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/8", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/9", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/10", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/11", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/12", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/13", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/14", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/15", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/16", "y": 90, "uvlock": true } - ], - "facing=south": [ - { "model": "cccbridge:block/redrouter_face/1", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/2", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/3", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/4", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/5", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/6", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/7", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/8", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/9", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/10", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/11", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/12", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/13", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/14", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/15", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/16", "y": 180, "uvlock": true } - ], - "facing=west": [ - { "model": "cccbridge:block/redrouter_face/1", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/2", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/3", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/4", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/5", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/6", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/7", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/8", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/9", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/10", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/11", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/12", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/13", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/14", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/15", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/16", "y": 270, "uvlock": true } - ] - } + "multipart": [ + { "when": { "facing": "north", "face": 0 }, + "apply": { "model": "cccbridge:block/redrouter_face/0", "uvlock": false } + }, + { "when": { "facing": "east", "face": 0 }, + "apply": { "model": "cccbridge:block/redrouter_face/0", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 0 }, + "apply": { "model": "cccbridge:block/redrouter_face/0", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 0 }, + "apply": { "model": "cccbridge:block/redrouter_face/0", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 1 }, + "apply": { "model": "cccbridge:block/redrouter_face/1", "uvlock": false } + }, + { "when": { "facing": "east", "face": 1 }, + "apply": { "model": "cccbridge:block/redrouter_face/1", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 1 }, + "apply": { "model": "cccbridge:block/redrouter_face/1", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 1 }, + "apply": { "model": "cccbridge:block/redrouter_face/1", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 2 }, + "apply": { "model": "cccbridge:block/redrouter_face/2", "uvlock": false } + }, + { "when": { "facing": "east", "face": 2 }, + "apply": { "model": "cccbridge:block/redrouter_face/2", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 2 }, + "apply": { "model": "cccbridge:block/redrouter_face/2", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 2 }, + "apply": { "model": "cccbridge:block/redrouter_face/2", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 3 }, + "apply": { "model": "cccbridge:block/redrouter_face/3", "uvlock": false } + }, + { "when": { "facing": "east", "face": 3 }, + "apply": { "model": "cccbridge:block/redrouter_face/3", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 3 }, + "apply": { "model": "cccbridge:block/redrouter_face/3", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 3 }, + "apply": { "model": "cccbridge:block/redrouter_face/3", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 4 }, + "apply": { "model": "cccbridge:block/redrouter_face/4", "uvlock": false } + }, + { "when": { "facing": "east", "face": 4 }, + "apply": { "model": "cccbridge:block/redrouter_face/4", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 4 }, + "apply": { "model": "cccbridge:block/redrouter_face/4", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 4 }, + "apply": { "model": "cccbridge:block/redrouter_face/4", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 5 }, + "apply": { "model": "cccbridge:block/redrouter_face/5", "uvlock": false } + }, + { "when": { "facing": "east", "face": 5 }, + "apply": { "model": "cccbridge:block/redrouter_face/5", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 5 }, + "apply": { "model": "cccbridge:block/redrouter_face/5", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 5 }, + "apply": { "model": "cccbridge:block/redrouter_face/5", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 6 }, + "apply": { "model": "cccbridge:block/redrouter_face/6", "uvlock": false } + }, + { "when": { "facing": "east", "face": 6 }, + "apply": { "model": "cccbridge:block/redrouter_face/6", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 6 }, + "apply": { "model": "cccbridge:block/redrouter_face/6", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 6 }, + "apply": { "model": "cccbridge:block/redrouter_face/6", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 7 }, + "apply": { "model": "cccbridge:block/redrouter_face/7", "uvlock": false } + }, + { "when": { "facing": "east", "face": 7 }, + "apply": { "model": "cccbridge:block/redrouter_face/7", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 7 }, + "apply": { "model": "cccbridge:block/redrouter_face/7", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 7 }, + "apply": { "model": "cccbridge:block/redrouter_face/7", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 8 }, + "apply": { "model": "cccbridge:block/redrouter_face/8", "uvlock": false } + }, + { "when": { "facing": "east", "face": 8 }, + "apply": { "model": "cccbridge:block/redrouter_face/8", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 8 }, + "apply": { "model": "cccbridge:block/redrouter_face/8", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 8 }, + "apply": { "model": "cccbridge:block/redrouter_face/8", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 9 }, + "apply": { "model": "cccbridge:block/redrouter_face/9", "uvlock": false } + }, + { "when": { "facing": "east", "face": 9 }, + "apply": { "model": "cccbridge:block/redrouter_face/9", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 9 }, + "apply": { "model": "cccbridge:block/redrouter_face/9", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 9 }, + "apply": { "model": "cccbridge:block/redrouter_face/9", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 10 }, + "apply": { "model": "cccbridge:block/redrouter_face/10", "uvlock": false } + }, + { "when": { "facing": "east", "face": 10 }, + "apply": { "model": "cccbridge:block/redrouter_face/10", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 10 }, + "apply": { "model": "cccbridge:block/redrouter_face/10", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 10 }, + "apply": { "model": "cccbridge:block/redrouter_face/10", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 11 }, + "apply": { "model": "cccbridge:block/redrouter_face/11", "uvlock": false } + }, + { "when": { "facing": "east", "face": 11 }, + "apply": { "model": "cccbridge:block/redrouter_face/11", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 11 }, + "apply": { "model": "cccbridge:block/redrouter_face/11", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 11 }, + "apply": { "model": "cccbridge:block/redrouter_face/11", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 12 }, + "apply": { "model": "cccbridge:block/redrouter_face/12", "uvlock": false } + }, + { "when": { "facing": "east", "face": 12 }, + "apply": { "model": "cccbridge:block/redrouter_face/12", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 12 }, + "apply": { "model": "cccbridge:block/redrouter_face/12", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 12 }, + "apply": { "model": "cccbridge:block/redrouter_face/12", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 13 }, + "apply": { "model": "cccbridge:block/redrouter_face/13", "uvlock": false } + }, + { "when": { "facing": "east", "face": 13 }, + "apply": { "model": "cccbridge:block/redrouter_face/13", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 13 }, + "apply": { "model": "cccbridge:block/redrouter_face/13", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 13 }, + "apply": { "model": "cccbridge:block/redrouter_face/13", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 14 }, + "apply": { "model": "cccbridge:block/redrouter_face/14", "uvlock": false } + }, + { "when": { "facing": "east", "face": 14 }, + "apply": { "model": "cccbridge:block/redrouter_face/14", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 14 }, + "apply": { "model": "cccbridge:block/redrouter_face/14", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 14 }, + "apply": { "model": "cccbridge:block/redrouter_face/14", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 15 }, + "apply": { "model": "cccbridge:block/redrouter_face/15", "uvlock": false } + }, + { "when": { "facing": "east", "face": 15 }, + "apply": { "model": "cccbridge:block/redrouter_face/15", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 15 }, + "apply": { "model": "cccbridge:block/redrouter_face/15", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 15 }, + "apply": { "model": "cccbridge:block/redrouter_face/15", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 16 }, + "apply": { "model": "cccbridge:block/redrouter_face/16", "uvlock": false } + }, + { "when": { "facing": "east", "face": 16 }, + "apply": { "model": "cccbridge:block/redrouter_face/16", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 16 }, + "apply": { "model": "cccbridge:block/redrouter_face/16", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 16 }, + "apply": { "model": "cccbridge:block/redrouter_face/16", "y": 270, "uvlock": false } + } + ] } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/blockstates/scroller_block.json b/fabric/src/main/resources/assets/cccbridge/blockstates/scroller_block.json index 7d729fa..ea82087 100644 --- a/fabric/src/main/resources/assets/cccbridge/blockstates/scroller_block.json +++ b/fabric/src/main/resources/assets/cccbridge/blockstates/scroller_block.json @@ -1,41 +1,41 @@ { "multipart": [ { "when": { "facing": "north", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "uvlock": false } }, { "when": { "facing": "east", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "y": 90, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "y": 90, "uvlock": false } }, { "when": { "facing": "south", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "y": 180, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "y": 180, "uvlock": false } }, { "when": { "facing": "west", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "y": 270, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "y": 270, "uvlock": false } }, { "when": { "facing": "up", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "x": -90, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "x": -90, "y": 180, "uvlock": false } }, { "when": { "facing": "down", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "x": 90, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "x": 90, "y": 180, "uvlock": false } }, { "when": { "facing": "north", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "uvlock": false } }, { "when": { "facing": "east", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 90, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 90, "uvlock": false } }, { "when": { "facing": "south", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 180, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 180, "uvlock": false } }, { "when": { "facing": "west", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 270, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 270, "uvlock": false } }, { "when": { "facing": "up", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "x": -90, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "x": -90, "uvlock": false } }, { "when": { "facing": "down", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "x": 90, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "x": 90, "uvlock": false } } ] } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/icon.png b/fabric/src/main/resources/assets/cccbridge/icon.png deleted file mode 100644 index 94d4e3e..0000000 Binary files a/fabric/src/main/resources/assets/cccbridge/icon.png and /dev/null differ diff --git a/fabric/src/main/resources/assets/cccbridge/iconHD.png b/fabric/src/main/resources/assets/cccbridge/iconHD.png deleted file mode 100644 index ef64978..0000000 Binary files a/fabric/src/main/resources/assets/cccbridge/iconHD.png and /dev/null differ diff --git a/fabric/src/main/resources/assets/cccbridge/lang/en_us.json b/fabric/src/main/resources/assets/cccbridge/lang/en_us.json index 33508b9..945fc94 100644 --- a/fabric/src/main/resources/assets/cccbridge/lang/en_us.json +++ b/fabric/src/main/resources/assets/cccbridge/lang/en_us.json @@ -3,10 +3,13 @@ "block.cccbridge.target_block": "Target Block", "block.cccbridge.redrouter_block": "RedRouter Block", "block.cccbridge.scroller_block": "Scroller Pane", + "block.cccbridge.animatronic_block": "Animatronic", "cccbridge.display_source.source_block_display_source": "Given data from computer", - "cccbridge.general.unit.scroller": "Small Lua Number", + "cccbridge.general.unit.scroller": "Lua Number", + "cccbridge.general.unit.scroller.positive": "Lua Num. +", + "cccbridge.general.unit.scroller.negative": "Lua Num. -", "subtitles.cccbridge.cage_lock": "Scroller locked", "subtitles.cccbridge.cage_unlock": "Scroller unlocked" diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/animatronic_block.json b/fabric/src/main/resources/assets/cccbridge/models/block/animatronic_block.json new file mode 100644 index 0000000..a1388d0 --- /dev/null +++ b/fabric/src/main/resources/assets/cccbridge/models/block/animatronic_block.json @@ -0,0 +1,83 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "cccbridge:block/animatronic_block", + "particle": "cccbridge:block/animatronic_block" + }, + "elements": [ + { + "name": "base", + "from": [7.5, 2, 7.5], + "to": [8.5, 16, 8.5], + "faces": { + "north": {"uv": [6, 4, 6.5, 11], "texture": "#0"}, + "east": {"uv": [6.5, 4, 7, 11], "texture": "#0"}, + "south": {"uv": [7, 4, 7.5, 11], "texture": "#0"}, + "west": {"uv": [7.5, 4, 8, 11], "texture": "#0"}, + "up": {"uv": [8.5, 4.5, 8, 4], "texture": "#0"}, + "down": {"uv": [8.5, 4.5, 8, 5], "texture": "#0"} + } + }, + { + "name": "stick", + "from": [2, 0, 2], + "to": [14, 2, 14], + "faces": { + "north": {"uv": [6, 0, 12, 1], "texture": "#0"}, + "east": {"uv": [6, 1, 12, 2], "texture": "#0"}, + "south": {"uv": [6, 2, 12, 3], "texture": "#0"}, + "west": {"uv": [6, 3, 12, 4], "texture": "#0"}, + "up": {"uv": [6, 6, 0, 0], "texture": "#0"}, + "down": {"uv": [6, 6, 0, 12], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [69, 0, 0], + "translation": [0, 0.75, 1.25], + "scale": [0.3, 0.3, 0.3] + }, + "thirdperson_lefthand": { + "rotation": [69, 0, 0], + "translation": [0, 0.75, 1.25], + "scale": [0.3, 0.3, 0.3] + }, + "firstperson_righthand": { + "rotation": [0, -180, 0], + "translation": [1, 1, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 89, 0], + "translation": [1, 1, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 4, 0], + "scale": [0.3, 0.3, 0.3] + }, + "gui": { + "rotation": [-175.21, -45.54, 179.37], + "translation": [0, -2, 0], + "scale": [0.6, 0.6, 0.6] + }, + "head": { + "rotation": [-150, 70, -3], + "translation": [-2.5, 8, 5.75] + }, + "fixed": { + "translation": [0, -3, 0], + "scale": [0.6, 0.6, 0.6] + } + }, + "groups": [ + { + "name": "VoxelShapes", + "origin": [0, 0, 0], + "color": 0, + "children": [0, 1] + } + ] +} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/base.json b/fabric/src/main/resources/assets/cccbridge/models/block/base.json deleted file mode 100644 index b970fb2..0000000 --- a/fabric/src/main/resources/assets/cccbridge/models/block/base.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "credit": "By Sammy.K via Blockbench", - "parent": "block/block", - "textures": { - "0": "cccbridge:block/st_block_top", - "particle": "cccbridge:block/st_block_top" - }, - "elements": [ - { - "name": "body", - "from": [1, 1, 1], - "to": [15, 15, 15], - "faces": { - "north": {"uv": [1, 1, 15, 15], "texture": "#0", "cullface": "north"}, - "east": {"uv": [1, 1, 15, 15], "texture": "#0", "cullface": "east"}, - "south": {"uv": [1, 1, 15, 15], "texture": "#0", "cullface": "south"}, - "west": {"uv": [1, 1, 15, 15], "texture": "#0", "cullface": "west"}, - "up": {"uv": [1, 1, 15, 15], "texture": "#0"}, - "down": {"uv": [1, 1, 15, 15], "texture": "#0"} - } - }, - { - "name": "vertical-ne", - "from": [15, 0, 0], - "to": [16, 16, 1], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#0"} - } - }, - { - "name": "vertical-es", - "from": [15, 0, 15], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "up": {"uv": [15, 15, 16, 16], "texture": "#0"}, - "down": {"uv": [0, 15, 1, 16], "texture": "#0"} - } - }, - { - "name": "vertical-sw", - "from": [0, 0, 15], - "to": [1, 16, 16], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "up": {"uv": [0, 15, 1, 16], "texture": "#0"}, - "down": {"uv": [15, 15, 16, 16], "texture": "#0"} - } - }, - { - "name": "vertical-wn", - "from": [0, 0, 0], - "to": [1, 16, 1], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#0"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#0"} - } - }, - { - "name": "side-upper-n", - "from": [1, 15, 0], - "to": [15, 16, 1], - "faces": { - "north": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#0"} - } - }, - { - "name": "side-upper-s", - "from": [1, 15, 15], - "to": [15, 16, 16], - "faces": { - "north": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} - } - }, - { - "name": "side-upper-w", - "from": [0, 15, 1], - "to": [1, 16, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "up": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "side-upper-e", - "from": [15, 15, 1], - "to": [16, 16, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#0"}, - "up": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#0"} - } - }, - { - "name": "side-lower-w", - "from": [0, 0, 1], - "to": [1, 1, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 90, "texture": "#0"}, - "down": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "side-lower-s", - "from": [1, 0, 15], - "to": [15, 1, 16], - "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "down": {"uv": [1, 15, 15, 16], "texture": "#0"} - } - }, - { - "name": "side-lower-e", - "from": [15, 0, 1], - "to": [16, 1, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 270, "texture": "#0"}, - "down": {"uv": [0, 1, 1, 15], "texture": "#0"} - } - }, - { - "name": "side-lower-n", - "from": [1, 0, 0], - "to": [15, 1, 1], - "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} - } - } - ], - "groups": [ - 0, - { - "name": "frame", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] - } - ] -} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/locked_scroller_block.json b/fabric/src/main/resources/assets/cccbridge/models/block/locked_scroller_block.json index 1d0f7fb..cc4bb2c 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/locked_scroller_block.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/locked_scroller_block.json @@ -1,6 +1,7 @@ { "credit": "By Sammy.K via Blockbench", "parent": "block/block", + "render_type": "cutout", "textures": { "0": "cccbridge:block/scroller/scroller_side", "1": "cccbridge:block/scroller/scroller_front", @@ -10,16 +11,35 @@ }, "elements": [ { - "name": "body", - "from": [0, 0, 15], - "to": [16, 16, 16], + "name": "cage", + "from": [4, 4, 15], + "to": [12, 12, 16], "faces": { - "north": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "north"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0", "cullface": "east"}, - "south": {"uv": [0, 0, 16, 16], "texture": "#0", "cullface": "south"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0", "cullface": "west"}, - "up": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 15, 16, 16], "texture": "#0"} + "north": {"uv": [3, 3, 13, 13], "texture": "#3"}, + "east": {"uv": [3, 3, 4, 13], "texture": "#3"}, + "west": {"uv": [12, 3, 13, 13], "texture": "#3"}, + "up": {"uv": [3, 3, 13, 4], "texture": "#3"}, + "down": {"uv": [3, 12, 13, 13], "texture": "#3"} + } + }, + { + "name": "interface", + "from": [3, 3, 15.95], + "to": [13, 13, 16], + "faces": { + "north": {"uv": [3, 3, 13, 13], "texture": "#2"}, + "south": {"uv": [3, 3, 13, 13], "texture": "#0"} + } + }, + { + "name": "side-upper-n", + "from": [1, 15, 14], + "to": [15, 16, 15], + "faces": { + "north": {"uv": [1, 0, 15, 1], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [15, 0, 1, 1], "texture": "#1"}, + "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#1"} } }, { @@ -27,11 +47,12 @@ "from": [15, 0, 14], "to": [16, 16, 15], "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#0"} + "north": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "east": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "up": {"uv": [0, 0, 1, 1], "texture": "#1"}, + "down": {"uv": [0, 15, 1, 16], "texture": "#1"} } }, { @@ -39,59 +60,71 @@ "from": [0, 0, 14], "to": [1, 16, 15], "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#0"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#0"} + "north": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "east": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "up": {"uv": [15, 0, 16, 1], "texture": "#1"}, + "down": {"uv": [15, 15, 16, 16], "texture": "#1"} } }, { - "name": "side-upper-n", - "from": [1, 15, 14], - "to": [15, 16, 15], + "name": "side-lower-n", + "from": [1, 0, 14], + "to": [15, 1, 15], "faces": { - "north": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#0"} + "north": {"uv": [1, 15, 15, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#1"}, + "down": {"uv": [15, 15, 1, 16], "texture": "#1"} } }, { - "name": "side-lower-n", - "from": [1, 0, 14], - "to": [15, 1, 15], + "name": "top", + "from": [0, 13, 15], + "to": [16, 16, 16], "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} + "north": {"uv": [0, 0, 16, 3], "texture": "#0"}, + "east": {"uv": [15, 0, 16, 3], "texture": "#0"}, + "south": {"uv": [0, 0, 16, 3], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "up": {"uv": [0, 0, 16, 1], "texture": "#0"}, + "down": {"uv": [0, 2, 16, 3], "texture": "#0"} } }, { - "name": "interface", - "from": [3, 3, 15.9], - "to": [13, 13, 14.91], + "name": "east", + "from": [13, 3, 15], + "to": [16, 13, 16], "faces": { - "north": {"uv": [3, 3, 13, 13], "texture": "#2"}, - "east": {"uv": [3, 3, 2, 13], "texture": "#2"}, - "west": {"uv": [13, 3, 14, 13], "texture": "#2"}, - "up": {"uv": [3, 2, 13, 3], "rotation": 180, "texture": "#2"}, - "down": {"uv": [3, 13, 13, 14], "texture": "#2"} + "north": {"uv": [0, 3, 3, 13], "texture": "#0"}, + "east": {"uv": [15, 3, 16, 13], "texture": "#0"}, + "south": {"uv": [13, 3, 16, 13], "texture": "#0"}, + "west": {"uv": [2, 3, 3, 13], "texture": "#0"} } }, { - "name": "cage", - "from": [4, 4, 15], - "to": [12, 12, 16], + "name": "bottom", + "from": [0, 0, 15], + "to": [16, 3, 16], "faces": { - "north": {"uv": [3, 3, 13, 13], "texture": "#3"}, - "east": {"uv": [3, 3, 4, 13], "texture": "#3"}, - "west": {"uv": [12, 3, 13, 13], "texture": "#3"}, - "up": {"uv": [3, 3, 13, 4], "texture": "#3"}, - "down": {"uv": [3, 12, 13, 13], "texture": "#3"} + "north": {"uv": [0, 13, 16, 16], "texture": "#0"}, + "east": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "south": {"uv": [0, 13, 16, 16], "texture": "#0"}, + "west": {"uv": [0, 13, 1, 16], "texture": "#0"}, + "up": {"uv": [0, 13, 16, 14], "texture": "#0"}, + "down": {"uv": [0, 15, 16, 16], "texture": "#0"} + } + }, + { + "name": "west", + "from": [0, 3, 15], + "to": [3, 13, 16], + "faces": { + "north": {"uv": [13, 3, 16, 13], "texture": "#0"}, + "east": {"uv": [13, 3, 14, 13], "texture": "#0"}, + "south": {"uv": [0, 3, 3, 13], "texture": "#0"}, + "west": {"uv": [0, 3, 1, 13], "texture": "#0"} } } ], @@ -108,13 +141,13 @@ }, "firstperson_righthand": { "rotation": [-13, 155, 0], - "translation": [-3, 2.5, 5.75], - "scale": [0.4, 0.4, 0.4] + "translation": [-3.75, 2.5, 5.75], + "scale": [0.3, 0.3, 0.3] }, "firstperson_lefthand": { "rotation": [-13, 155, 0], - "translation": [-3, 2.5, 5.75], - "scale": [0.4, 0.4, 0.4] + "translation": [-3.25, 2.5, 5.75], + "scale": [0.3, 0.3, 0.3] }, "ground": { "rotation": [90, 0, 0], @@ -136,15 +169,18 @@ }, "groups": [ 0, + 1, { "name": "frame", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [1, 2, 3, 4] + "children": [2, 3, 4, 5] }, - 5, - 6 + { + "name": "base", + "origin": [0, 0, 0], + "color": 0, + "children": [6, 7, 8, 9] + } ] } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_block.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_block.json index 34f3fd1..bf43356 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_block.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_block.json @@ -1,99 +1,20 @@ { "credit": "By Sammy.K via Blockbench", - "parent": "cccbridge:block/base", + "render_type": "cutout", "textures": { - "2": "cccbridge:block/redrouter/background", "3": "cccbridge:block/redrouter/redrouter_side", "4": "cccbridge:block/redrouter/redrouter_top", "5": "cccbridge:block/redrouter/redrouter_front", - "6": "cccbridge:block/redrouter/connector", - "particle": "cccbridge:block/redrouter/background", - "face": "cccbridge:block/redrouter/face/1" + "6": "cccbridge:block/redrouter/background", + "particle": "cccbridge:block/redrouter/background" }, "elements": [ - { - "name": "background", - "from": [2, 2, 2], - "to": [14, 14, 2], - "faces": { - "north": {"uv": [2, 2, 14, 14], "texture": "#2"} - } - }, - { - "name": "face", - "from": [0, 0, 1.9], - "to": [16, 16, 1.9], - "faces": { - "north": {"uv": [0, 0, 16, 16], "texture": "#face"} - } - }, - { - "name": "east", - "from": [15, 5, 5], - "to": [14.5, 11, 11], - "faces": { - "north": {"uv": [11, 5, 12, 11], "texture": "#6"}, - "east": {"uv": [5, 5, 11, 11], "texture": "#6"}, - "south": {"uv": [4, 5, 5, 11], "texture": "#6"}, - "up": {"uv": [5, 4, 11, 5], "rotation": 270, "texture": "#6"}, - "down": {"uv": [5, 11, 11, 12], "rotation": 90, "texture": "#6"} - } - }, - { - "name": "west", - "from": [1.5, 5, 5], - "to": [1, 11, 11], - "faces": { - "north": {"uv": [4, 5, 5, 11], "texture": "#6"}, - "south": {"uv": [11, 5, 12, 11], "texture": "#6"}, - "west": {"uv": [5, 5, 11, 11], "texture": "#6"}, - "up": {"uv": [5, 4, 11, 5], "rotation": 90, "texture": "#6"}, - "down": {"uv": [5, 11, 11, 12], "rotation": 270, "texture": "#6"} - } - }, - { - "name": "south", - "from": [5, 5, 15], - "to": [11, 11, 14.5], - "rotation": {"angle": 0, "axis": "y", "origin": [15, 8, 20]}, - "faces": { - "east": {"uv": [11, 5, 12, 11], "texture": "#6"}, - "south": {"uv": [5, 5, 11, 11], "texture": "#6"}, - "west": {"uv": [4, 5, 5, 11], "texture": "#6"}, - "up": {"uv": [5, 4, 11, 5], "texture": "#6"}, - "down": {"uv": [5, 11, 11, 12], "texture": "#6"} - } - }, - { - "name": "upper", - "from": [5, 15, 5], - "to": [11, 14.5, 11], - "faces": { - "north": {"uv": [5, 4, 11, 5], "rotation": 180, "texture": "#6"}, - "east": {"uv": [11, 5, 12, 11], "rotation": 90, "texture": "#6"}, - "south": {"uv": [5, 11, 11, 12], "texture": "#6"}, - "west": {"uv": [4, 5, 5, 11], "rotation": 270, "texture": "#6"}, - "up": {"uv": [5, 5, 11, 11], "texture": "#6"} - } - }, - { - "name": "lower", - "from": [5, 1.5, 5], - "to": [11, 1, 11], - "faces": { - "north": {"uv": [5, 11, 11, 12], "rotation": 180, "texture": "#6"}, - "east": {"uv": [11, 5, 12, 11], "rotation": 270, "texture": "#6"}, - "south": {"uv": [5, 4, 11, 5], "texture": "#6"}, - "west": {"uv": [4, 5, 5, 11], "rotation": 90, "texture": "#6"}, - "down": {"uv": [5, 5, 11, 11], "texture": "#6"} - } - }, { "name": "left", "from": [2, 4, 1], "to": [2, 12, 2], "faces": { - "east": {"uv": [14, 4, 15, 12], "texture": "#2"} + "east": {"uv": [14, 4, 15, 12], "texture": "#6"} } }, { @@ -101,7 +22,7 @@ "from": [14, 4, 1], "to": [14, 12, 2], "faces": { - "west": {"uv": [1, 4, 2, 12], "texture": "#2"} + "west": {"uv": [1, 4, 2, 12], "texture": "#6"} } }, { @@ -109,7 +30,7 @@ "from": [4, 2, 1], "to": [12, 2, 2], "faces": { - "up": {"uv": [4, 14, 12, 15], "texture": "#2"} + "up": {"uv": [4, 14, 12, 15], "texture": "#6"} } }, { @@ -117,7 +38,7 @@ "from": [4, 14, 1], "to": [12, 14, 2], "faces": { - "down": {"uv": [4, 1, 12, 2], "texture": "#2"} + "down": {"uv": [4, 1, 12, 2], "texture": "#6"} } }, { @@ -125,8 +46,8 @@ "from": [3, 13, 1], "to": [4, 14, 2], "faces": { - "east": {"uv": [12, 2, 13, 3], "texture": "#2"}, - "down": {"uv": [12, 2, 13, 3], "texture": "#2"} + "east": {"uv": [12, 2, 13, 3], "texture": "#6"}, + "down": {"uv": [12, 2, 13, 3], "texture": "#6"} } }, { @@ -134,8 +55,8 @@ "from": [12, 13, 1], "to": [13, 14, 2], "faces": { - "west": {"uv": [3, 2, 4, 3], "texture": "#2"}, - "down": {"uv": [3, 2, 4, 3], "texture": "#2"} + "west": {"uv": [3, 2, 4, 3], "texture": "#6"}, + "down": {"uv": [3, 2, 4, 3], "texture": "#6"} } }, { @@ -143,8 +64,8 @@ "from": [3, 2, 1], "to": [4, 3, 2], "faces": { - "east": {"uv": [12, 13, 13, 14], "texture": "#2"}, - "up": {"uv": [12, 13, 13, 14], "texture": "#2"} + "east": {"uv": [12, 13, 13, 14], "texture": "#6"}, + "up": {"uv": [12, 13, 13, 14], "texture": "#6"} } }, { @@ -152,8 +73,8 @@ "from": [12, 2, 1], "to": [13, 3, 2], "faces": { - "west": {"uv": [3, 13, 4, 14], "texture": "#2"}, - "up": {"uv": [3, 13, 4, 14], "texture": "#2"} + "west": {"uv": [3, 13, 4, 14], "texture": "#6"}, + "up": {"uv": [3, 13, 4, 14], "texture": "#6"} } }, { @@ -161,8 +82,8 @@ "from": [2, 3, 1], "to": [3, 4, 2], "faces": { - "east": {"uv": [13, 12, 14, 13], "texture": "#2"}, - "up": {"uv": [13, 12, 14, 13], "texture": "#2"} + "east": {"uv": [13, 12, 14, 13], "texture": "#6"}, + "up": {"uv": [13, 12, 14, 13], "texture": "#6"} } }, { @@ -170,8 +91,8 @@ "from": [13, 3, 1], "to": [14, 4, 2], "faces": { - "west": {"uv": [2, 12, 3, 13], "texture": "#2"}, - "up": {"uv": [2, 12, 3, 13], "texture": "#2"} + "west": {"uv": [2, 12, 3, 13], "texture": "#6"}, + "up": {"uv": [2, 12, 3, 13], "texture": "#6"} } }, { @@ -179,8 +100,8 @@ "from": [13, 12, 1], "to": [14, 13, 2], "faces": { - "west": {"uv": [3, 2, 4, 3], "texture": "#2"}, - "down": {"uv": [2, 3, 3, 4], "texture": "#2"} + "west": {"uv": [3, 2, 4, 3], "texture": "#6"}, + "down": {"uv": [2, 3, 3, 4], "texture": "#6"} } }, { @@ -188,216 +109,231 @@ "from": [2, 12, 1], "to": [3, 13, 2], "faces": { - "east": {"uv": [13, 3, 14, 4], "texture": "#2"}, - "down": {"uv": [13, 3, 14, 4], "texture": "#2"} + "east": {"uv": [13, 3, 14, 4], "texture": "#6"}, + "down": {"uv": [13, 3, 14, 4], "texture": "#6"} } }, { "name": "body", - "from": [1, 1, 1], - "to": [15, 15, 15], + "from": [0, 0, 2], + "to": [16, 16, 16], "faces": { - "north": {"uv": [1, 1, 15, 15], "texture": "#5", "cullface": "north"}, - "east": {"uv": [1, 1, 15, 15], "texture": "#3", "cullface": "east"}, - "south": {"uv": [1, 1, 15, 15], "texture": "#3", "cullface": "south"}, - "west": {"uv": [1, 1, 15, 15], "texture": "#3", "cullface": "west"}, - "up": {"uv": [1, 1, 15, 15], "texture": "#4"}, - "down": {"uv": [1, 1, 15, 15], "texture": "#4"} + "east": {"uv": [0, 0, 15, 16], "texture": "#3", "cullface": "east"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#3", "cullface": "south"}, + "west": {"uv": [1, 0, 16, 16], "texture": "#3", "cullface": "west"}, + "up": {"uv": [0, 1, 16, 16], "texture": "#4"}, + "down": {"uv": [0, 0, 16, 15], "texture": "#4"} } }, { "name": "vertical-ne", "from": [15, 0, 0], - "to": [16, 16, 1], + "to": [16, 16, 2], "faces": { "north": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#3"}, + "east": {"uv": [14, 0, 16, 16], "texture": "#3"}, "south": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#3"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#3"} - } - }, - { - "name": "vertical-es", - "from": [15, 0, 15], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "up": {"uv": [15, 15, 16, 16], "texture": "#3"}, - "down": {"uv": [0, 15, 1, 16], "texture": "#3"} - } - }, - { - "name": "vertical-sw", - "from": [0, 0, 15], - "to": [1, 16, 16], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "up": {"uv": [0, 15, 1, 16], "texture": "#3"}, - "down": {"uv": [15, 15, 16, 16], "texture": "#3"} + "west": {"uv": [0, 0, 2, 16], "texture": "#3"}, + "up": {"uv": [15, 0, 16, 2], "texture": "#3"}, + "down": {"uv": [0, 0, 1, 2], "texture": "#3"} } }, { "name": "vertical-wn", "from": [0, 0, 0], - "to": [1, 16, 1], + "to": [1, 16, 2], "faces": { "north": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#3"}, + "east": {"uv": [14, 0, 16, 16], "texture": "#3"}, "south": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#3"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#3"} + "west": {"uv": [0, 0, 2, 16], "texture": "#3"}, + "up": {"uv": [0, 0, 1, 2], "texture": "#3"}, + "down": {"uv": [15, 0, 16, 2], "texture": "#3"} } }, { "name": "side-upper-n", "from": [1, 15, 0], - "to": [15, 16, 1], + "to": [15, 16, 2], "faces": { "north": {"uv": [1, 0, 15, 1], "texture": "#3"}, "east": {"uv": [0, 0, 0, 0], "texture": "#3"}, "south": {"uv": [1, 0, 15, 1], "texture": "#3"}, "west": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#3"} + "up": {"uv": [1, 0, 15, 2], "texture": "#3"}, + "down": {"uv": [1, 0, 15, 2], "rotation": 180, "texture": "#3"} } }, { - "name": "side-upper-s", - "from": [1, 15, 15], - "to": [15, 16, 16], + "name": "side-lower-n", + "from": [1, 0, 0], + "to": [15, 1, 2], "faces": { - "north": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#3"}, + "north": {"uv": [1, 15, 15, 16], "texture": "#3"}, "east": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#3"}, + "south": {"uv": [1, 15, 15, 16], "texture": "#3"}, "west": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#3"} + "up": {"uv": [1, 14, 15, 16], "rotation": 180, "texture": "#3"}, + "down": {"uv": [1, 2, 15, 0], "texture": "#3"} } }, { - "name": "side-upper-w", - "from": [0, 15, 1], - "to": [1, 16, 15], + "name": "bottom", + "from": [1, 1, 1], + "to": [15, 2, 1], "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "east": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#3"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "west": {"uv": [1, 0, 15, 1], "texture": "#3"}, - "up": {"uv": [0, 1, 1, 15], "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#3"} + "north": {"uv": [1, 14, 15, 15], "texture": "#5"} } }, { - "name": "side-upper-e", - "from": [15, 15, 1], - "to": [16, 16, 15], + "name": "bottom3", + "from": [12, 2, 1], + "to": [15, 3, 1], "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "east": {"uv": [1, 0, 15, 1], "texture": "#3"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "west": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#3"}, - "up": {"uv": [15, 1, 16, 15], "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#3"} + "north": {"uv": [1, 13, 4, 14], "texture": "#5"} } }, { - "name": "side-lower-w", - "from": [0, 0, 1], - "to": [1, 1, 15], + "name": "bottom4", + "from": [1, 2, 1], + "to": [4, 3, 1], "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "east": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#3"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "west": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 90, "texture": "#3"}, - "down": {"uv": [15, 1, 16, 15], "texture": "#3"} + "north": {"uv": [12, 13, 15, 14], "texture": "#5"} } }, { - "name": "side-lower-s", - "from": [1, 0, 15], - "to": [15, 1, 16], + "name": "bottom2", + "from": [1, 3, 1], + "to": [3, 4, 1], "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "down": {"uv": [1, 15, 15, 16], "texture": "#3"} + "north": {"uv": [13, 12, 15, 13], "texture": "#5"} } }, { - "name": "side-lower-e", - "from": [15, 0, 1], - "to": [16, 1, 15], + "name": "bottom1", + "from": [13, 3, 1], + "to": [15, 4, 1], "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "east": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "west": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 270, "texture": "#3"}, - "down": {"uv": [0, 1, 1, 15], "texture": "#3"} + "north": {"uv": [1, 12, 3, 13], "texture": "#5"} } }, { - "name": "side-lower-n", - "from": [1, 0, 0], - "to": [15, 1, 1], + "name": "top5", + "from": [1, 12, 1], + "to": [3, 13, 1], "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#3"} + "north": {"uv": [13, 3, 15, 4], "texture": "#5"} + } + }, + { + "name": "top4", + "from": [13, 12, 1], + "to": [15, 13, 1], + "faces": { + "north": {"uv": [1, 3, 3, 4], "texture": "#5"} + } + }, + { + "name": "left", + "from": [14, 4, 1], + "to": [15, 12, 1], + "faces": { + "north": {"uv": [1, 4, 2, 12], "texture": "#5"} + } + }, + { + "name": "right", + "from": [1, 4, 1], + "to": [2, 12, 1], + "faces": { + "north": {"uv": [14, 4, 15, 12], "texture": "#5"} + } + }, + { + "name": "top1", + "from": [12, 13, 1], + "to": [15, 14, 1], + "faces": { + "north": {"uv": [1, 2, 4, 3], "texture": "#5"} + } + }, + { + "name": "top", + "from": [1, 14, 1], + "to": [15, 15, 1], + "faces": { + "north": {"uv": [1, 1, 15, 2], "texture": "#5"} + } + }, + { + "name": "top2", + "from": [1, 13, 1], + "to": [4, 14, 1], + "faces": { + "north": {"uv": [12, 2, 15, 3], "texture": "#5"} + } + }, + { + "name": "face", + "from": [2, 2, 1.9], + "to": [14, 14, 2.9], + "faces": { + "north": {"uv": [2, 2, 14, 14], "texture": "#6"} } } ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + }, "groups": [ - 0, - 1, - { - "name": "connector", - "origin": [8, 8, 8], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [2, 3, 4, 5, 6] - }, { "name": "screen", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] }, { "name": "base", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, "children": [ - 19, + 12, { "name": "frame", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31] + "children": [13, 14, 15, 16] } ] + }, + { + "name": "face", + "origin": [0, 0, 0], + "color": 0, + "children": [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] } ] } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/0.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/0.json new file mode 100644 index 0000000..cc7cd95 --- /dev/null +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/0.json @@ -0,0 +1,6 @@ +{ + "parent": "cccbridge:block/redrouter_block", + "textures": { + "6": "cccbridge:block/redrouter/face/0" + } +} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/1.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/1.json index d1c714c..ed11a1e 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/1.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/1.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/1" + "6": "cccbridge:block/redrouter/face/1" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/10.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/10.json index 6aae1ef..b7b9686 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/10.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/10.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/10" + "6": "cccbridge:block/redrouter/face/10" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/11.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/11.json index 08591ae..f0858c8 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/11.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/11.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/11" + "6": "cccbridge:block/redrouter/face/11" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/12.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/12.json index 05437ec..fceec2f 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/12.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/12.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/12" + "6": "cccbridge:block/redrouter/face/12" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/13.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/13.json index 465f705..a0de071 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/13.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/13.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/13" + "6": "cccbridge:block/redrouter/face/13" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/14.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/14.json index 2db3c16..5440d8d 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/14.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/14.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/14" + "6": "cccbridge:block/redrouter/face/14" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/15.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/15.json index e4ef49d..39e51fd 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/15.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/15.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/15" + "6": "cccbridge:block/redrouter/face/15" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/16.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/16.json index d527088..88ab691 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/16.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/16.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/16" + "6": "cccbridge:block/redrouter/face/16" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/17.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/17.json new file mode 100644 index 0000000..b2a180c --- /dev/null +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/17.json @@ -0,0 +1,6 @@ +{ + "parent": "cccbridge:block/redrouter_block", + "textures": { + "6": "cccbridge:block/redrouter/face/17" + } +} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/2.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/2.json index ea94735..f77b43c 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/2.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/2.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/2" + "6": "cccbridge:block/redrouter/face/2" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/3.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/3.json index 9f96761..fb6c51c 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/3.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/3.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/3" + "6": "cccbridge:block/redrouter/face/3" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/4.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/4.json index eed2224..21b0148 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/4.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/4.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/4" + "6": "cccbridge:block/redrouter/face/4" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/5.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/5.json index ccfd448..44bb23d 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/5.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/5.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/5" + "6": "cccbridge:block/redrouter/face/5" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/6.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/6.json index d81e5d8..fa5cabc 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/6.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/6.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/6" + "6": "cccbridge:block/redrouter/face/6" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/7.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/7.json index 0ec8f5f..1b371f5 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/7.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/7.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/7" + "6": "cccbridge:block/redrouter/face/7" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/8.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/8.json index 44d429b..f6097be 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/8.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/8.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/8" + "6": "cccbridge:block/redrouter/face/8" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/9.json b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/9.json index d8b508d..d67b7ed 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/9.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/redrouter_face/9.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/9" + "6": "cccbridge:block/redrouter/face/9" } } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/scroller_block.json b/fabric/src/main/resources/assets/cccbridge/models/block/scroller_block.json index ee6ec66..cc01eef 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/scroller_block.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/scroller_block.json @@ -1,6 +1,7 @@ { "credit": "By Sammy.K via Blockbench", "parent": "block/block", + "render_type": "cutout", "textures": { "0": "cccbridge:block/scroller/scroller_side", "1": "cccbridge:block/scroller/scroller_front", @@ -8,29 +9,17 @@ "particle": "cccbridge:block/scroller/scroller_side" }, "elements": [ - { - "name": "body", - "from": [0, 0, 15], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "north"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0", "cullface": "east"}, - "south": {"uv": [0, 0, 16, 16], "texture": "#0", "cullface": "south"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0", "cullface": "west"}, - "up": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 15, 16, 16], "texture": "#0"} - } - }, { "name": "vertical-ne", "from": [15, 0, 14], "to": [16, 16, 15], "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#0"} + "north": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "east": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "up": {"uv": [0, 0, 1, 1], "texture": "#1"}, + "down": {"uv": [0, 15, 1, 16], "texture": "#1"} } }, { @@ -38,11 +27,12 @@ "from": [0, 0, 14], "to": [1, 16, 15], "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#0"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#0"} + "north": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "east": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "up": {"uv": [15, 0, 16, 1], "texture": "#1"}, + "down": {"uv": [15, 15, 16, 16], "texture": "#1"} } }, { @@ -50,11 +40,12 @@ "from": [1, 15, 14], "to": [15, 16, 15], "faces": { - "north": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#0"} + "north": {"uv": [1, 0, 15, 1], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [15, 0, 1, 1], "texture": "#1"}, + "down": {"uv": [15, 0, 1, 1], "texture": "#1"} } }, { @@ -62,24 +53,74 @@ "from": [1, 0, 14], "to": [15, 1, 15], "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} + "north": {"uv": [1, 15, 15, 16], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [15, 15, 1, 16], "texture": "#1"}, + "down": {"uv": [15, 15, 1, 16], "texture": "#1"} } }, { "name": "interface", - "from": [3, 3, 15.9], - "to": [13, 13, 14.91], + "from": [3, 3, 15.95], + "to": [13, 13, 16], "faces": { "north": {"uv": [3, 3, 13, 13], "texture": "#2"}, "east": {"uv": [3, 3, 2, 13], "texture": "#2"}, + "south": {"uv": [3, 3, 13, 13], "texture": "#0"}, "west": {"uv": [13, 3, 14, 13], "texture": "#2"}, "up": {"uv": [3, 2, 13, 3], "rotation": 180, "texture": "#2"}, "down": {"uv": [3, 13, 13, 14], "texture": "#2"} } + }, + { + "name": "bottom", + "from": [0, 0, 15], + "to": [16, 3, 16], + "faces": { + "north": {"uv": [0, 13, 16, 16], "texture": "#1"}, + "east": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "south": {"uv": [0, 13, 16, 16], "texture": "#0"}, + "west": {"uv": [0, 13, 1, 16], "texture": "#0"}, + "up": {"uv": [0, 13, 16, 14], "texture": "#2"}, + "down": {"uv": [0, 15, 16, 16], "texture": "#0"} + } + }, + { + "name": "top", + "from": [0, 13, 15], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 16, 3], "texture": "#1"}, + "east": {"uv": [15, 0, 16, 3], "texture": "#0"}, + "south": {"uv": [0, 0, 16, 3], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "up": {"uv": [0, 0, 16, 1], "texture": "#0"}, + "down": {"uv": [0, 2, 16, 3], "texture": "#2"} + } + }, + { + "name": "east", + "from": [13, 3, 15], + "to": [16, 13, 16], + "faces": { + "north": {"uv": [0, 3, 3, 13], "texture": "#1"}, + "east": {"uv": [15, 3, 16, 13], "texture": "#0"}, + "south": {"uv": [13, 3, 16, 13], "texture": "#0"}, + "west": {"uv": [2, 3, 3, 13], "texture": "#2"} + } + }, + { + "name": "west", + "from": [0, 3, 15], + "to": [3, 13, 16], + "faces": { + "north": {"uv": [13, 3, 16, 13], "texture": "#1"}, + "east": {"uv": [13, 3, 14, 13], "texture": "#2"}, + "south": {"uv": [0, 3, 3, 13], "texture": "#0"}, + "west": {"uv": [0, 3, 1, 13], "texture": "#0"} + } } ], "display": { @@ -95,13 +136,13 @@ }, "firstperson_righthand": { "rotation": [-13, 155, 0], - "translation": [-3, 2.5, 5.75], - "scale": [0.4, 0.4, 0.4] + "translation": [-3.25, 2.5, 5.75], + "scale": [0.3, 0.3, 0.3] }, "firstperson_lefthand": { "rotation": [-13, 155, 0], - "translation": [-3, 2.5, 5.75], - "scale": [0.4, 0.4, 0.4] + "translation": [-3.25, 2.5, 5.75], + "scale": [0.3, 0.3, 0.3] }, "ground": { "rotation": [90, 0, 0], @@ -122,15 +163,18 @@ } }, "groups": [ - 0, { "name": "frame", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [1, 2, 3, 4] + "children": [0, 1, 2, 3] }, - 5 + 4, + { + "name": "base", + "origin": [0, 0, 0], + "color": 0, + "children": [5, 6, 7, 8] + } ] } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/source_block.json b/fabric/src/main/resources/assets/cccbridge/models/block/source_block.json index c561ed7..e079d00 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/source_block.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/source_block.json @@ -1,161 +1,12 @@ { - "credit": "By Sammy.K via Blockbench", - "parent": "minecraft:block/block", + "parent": "minecraft:block/cube", "textures": { - "0": "cccbridge:block/source_block_side", - "1": "cccbridge:block/st_block_top", - "particle": "cccbridge:block/source_block_side" - }, - "elements": [ - { - "name": "base", - "from": [1, 1, 1], - "to": [15, 15, 15], - "faces": { - "north": {"uv": [1, 1, 15, 15], "texture": "#0"}, - "east": {"uv": [1, 1, 15, 15], "texture": "#0"}, - "south": {"uv": [1, 1, 15, 15], "texture": "#0"}, - "west": {"uv": [1, 1, 15, 15], "texture": "#0"} - } - }, - { - "name": "sw", - "from": [0, 1, 15], - "to": [1, 15, 16], - "faces": { - "north": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "south": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "ew", - "from": [15, 1, 15], - "to": [16, 15, 16], - "faces": { - "north": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "south": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "wn", - "from": [0, 1, 0], - "to": [1, 15, 1], - "faces": { - "north": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 14], "texture": "#0"}, - "south": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "ne", - "from": [15, 1, 0], - "to": [16, 15, 1], - "faces": { - "north": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "east": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "south": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "west": {"uv": [0, 1, 1, 15], "texture": "#0"} - } - }, - { - "name": "top", - "from": [0, 15, 0], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "south": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#0"} - } - }, - { - "name": "bottom", - "from": [0, 0, 0], - "to": [16, 1, 16], - "faces": { - "north": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "east": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "south": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#0"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#1"} - } - }, - { - "name": "west", - "from": [0, 4, 4], - "to": [1, 12, 12], - "faces": { - "north": {"uv": [4, 4, 5, 12], "texture": "#0"}, - "south": {"uv": [11, 4, 12, 12], "texture": "#0"}, - "west": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "up": {"uv": [4, 4, 12, 5], "rotation": 90, "texture": "#0"}, - "down": {"uv": [4, 11, 12, 12], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "north", - "from": [4, 4, 0], - "to": [12, 12, 1], - "faces": { - "north": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "east": {"uv": [4, 4, 5, 12], "texture": "#0"}, - "west": {"uv": [11, 4, 12, 12], "texture": "#0"}, - "up": {"uv": [4, 4, 12, 5], "rotation": 180, "texture": "#0"}, - "down": {"uv": [4, 11, 12, 12], "rotation": 180, "texture": "#0"} - } - }, - { - "name": "east", - "from": [15, 4, 4], - "to": [16, 12, 12], - "faces": { - "north": {"uv": [11, 4, 12, 12], "texture": "#0"}, - "east": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "south": {"uv": [4, 4, 5, 12], "texture": "#0"}, - "up": {"uv": [4, 4, 12, 5], "rotation": 270, "texture": "#0"}, - "down": {"uv": [4, 11, 12, 12], "rotation": 90, "texture": "#0"} - } - }, - { - "name": "south", - "from": [4, 4, 15], - "to": [12, 12, 16], - "faces": { - "east": {"uv": [11, 4, 12, 12], "texture": "#0"}, - "south": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "west": {"uv": [4, 4, 5, 12], "texture": "#0"}, - "up": {"uv": [4, 4, 12, 5], "texture": "#0"}, - "down": {"uv": [4, 11, 12, 12], "texture": "#0"} - } - } - ], - "groups": [ - 0, - { - "name": "frame", - "origin": [0, 0, 0], - "color": 0, - "children": [1, 2, 3, 4] - }, - { - "name": "plates", - "origin": [0, 0, 0], - "color": 0, - "children": [5, 6] - }, - { - "name": "connections", - "origin": [0, 0, 0], - "color": 0, - "children": [7, 8, 9, 10] - } - ] -} \ No newline at end of file + "down": "cccbridge:block/source_target_block_vertical", + "east": "cccbridge:block/source_block_horizontal", + "north": "cccbridge:block/source_block_horizontal", + "particle": "cccbridge:block/source_block_horizontal", + "south": "cccbridge:block/source_block_horizontal", + "up": "cccbridge:block/source_target_block_vertical", + "west": "cccbridge:block/source_block_horizontal" + } + } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/target_block.json b/fabric/src/main/resources/assets/cccbridge/models/block/target_block.json index 23b3944..6986e88 100644 --- a/fabric/src/main/resources/assets/cccbridge/models/block/target_block.json +++ b/fabric/src/main/resources/assets/cccbridge/models/block/target_block.json @@ -1,221 +1,12 @@ { - "credit": "By Sammy.K via Blockbench", - "parent": "minecraft:block/block", + "parent": "minecraft:block/cube", "textures": { - "0": "cccbridge:block/target_block_side", - "1": "cccbridge:block/st_block_top", - "particle": "cccbridge:block/target_block_side" - }, - "elements": [ - { - "name": "sw", - "from": [0, 1, 15], - "to": [1, 15, 16], - "faces": { - "north": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "south": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "ew", - "from": [15, 1, 15], - "to": [16, 15, 16], - "faces": { - "north": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "south": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "wn", - "from": [0, 1, 0], - "to": [1, 15, 1], - "faces": { - "north": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 14], "texture": "#0"}, - "south": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "ne", - "from": [15, 1, 0], - "to": [16, 15, 1], - "faces": { - "north": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "east": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "south": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "west": {"uv": [0, 1, 1, 15], "texture": "#0"} - } - }, - { - "name": "top", - "from": [0, 15, 0], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "south": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#0"} - } - }, - { - "name": "bottom", - "from": [0, 0, 0], - "to": [16, 1, 16], - "faces": { - "north": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "east": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "south": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#0"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#1"} - } - }, - { - "name": "west", - "from": [2, 12, 12], - "to": [1, 4, 4], - "faces": { - "north": {"uv": [3, 4, 4, 12], "texture": "#0"}, - "south": {"uv": [12, 4, 13, 12], "texture": "#0"}, - "west": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "up": {"uv": [4, 3, 12, 4], "rotation": 90, "texture": "#0"}, - "down": {"uv": [4, 12, 12, 13], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "north", - "from": [12, 12, 2], - "to": [4, 4, 1], - "faces": { - "north": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "east": {"uv": [3, 4, 4, 12], "texture": "#0"}, - "west": {"uv": [12, 4, 13, 12], "texture": "#0"}, - "up": {"uv": [4, 3, 12, 4], "rotation": 180, "texture": "#0"}, - "down": {"uv": [4, 12, 12, 13], "rotation": 180, "texture": "#0"} - } - }, - { - "name": "east", - "from": [15, 12, 12], - "to": [14, 4, 4], - "faces": { - "north": {"uv": [12, 4, 13, 12], "texture": "#0"}, - "east": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "south": {"uv": [3, 4, 4, 12], "texture": "#0"}, - "up": {"uv": [4, 3, 12, 4], "rotation": 270, "texture": "#0"}, - "down": {"uv": [4, 12, 12, 13], "rotation": 90, "texture": "#0"} - } - }, - { - "name": "south", - "from": [12, 12, 15], - "to": [4, 4, 14], - "faces": { - "east": {"uv": [12, 4, 13, 12], "texture": "#0"}, - "south": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "west": {"uv": [3, 4, 4, 12], "texture": "#0"}, - "up": {"uv": [4, 3, 12, 4], "texture": "#0"}, - "down": {"uv": [4, 12, 12, 13], "texture": "#0"} - } - }, - { - "name": "bottom", - "from": [1, 1, 1], - "to": [15, 4, 15], - "faces": { - "north": {"uv": [1, 12, 15, 15], "texture": "#0"}, - "east": {"uv": [1, 12, 15, 15], "texture": "#0"}, - "south": {"uv": [1, 12, 15, 15], "texture": "#0"}, - "west": {"uv": [1, 12, 15, 15], "texture": "#0"} - } - }, - { - "name": "top", - "from": [1, 12, 1], - "to": [15, 15, 15], - "faces": { - "north": {"uv": [1, 1, 15, 4], "texture": "#0"}, - "east": {"uv": [1, 1, 15, 4], "texture": "#0"}, - "south": {"uv": [1, 1, 15, 4], "texture": "#0"}, - "west": {"uv": [1, 1, 15, 4], "texture": "#0"} - } - }, - { - "name": "wn", - "from": [1, 4, 1], - "to": [4, 12, 4], - "faces": { - "north": {"uv": [12, 4, 15, 12], "texture": "#0"}, - "west": {"uv": [1, 4, 4, 12], "texture": "#0"} - } - }, - { - "name": "ne", - "from": [12, 4, 1], - "to": [15, 12, 4], - "faces": { - "north": {"uv": [1, 4, 4, 12], "texture": "#0"}, - "east": {"uv": [12, 4, 15, 12], "texture": "#0"} - } - }, - { - "name": "es", - "from": [12, 4, 12], - "to": [15, 12, 15], - "faces": { - "east": {"uv": [1, 4, 4, 12], "texture": "#0"}, - "south": {"uv": [12, 4, 15, 12], "texture": "#0"} - } - }, - { - "name": "sw", - "from": [1, 4, 12], - "to": [4, 12, 15], - "faces": { - "south": {"uv": [1, 4, 4, 12], "texture": "#0"}, - "west": {"uv": [12, 4, 15, 12], "texture": "#0"} - } - } - ], - "groups": [ - { - "name": "frame", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [0, 1, 2, 3] - }, - { - "name": "plates", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [4, 5] - }, - { - "name": "connections", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [6, 7, 8, 9] - }, - { - "name": "group", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [10, 11, 12, 13, 14, 15] - } - ] -} \ No newline at end of file + "down": "cccbridge:block/source_target_block_vertical", + "east": "cccbridge:block/target_block_horizontal", + "north": "cccbridge:block/target_block_horizontal", + "particle": "cccbridge:block/target_block_horizontal", + "south": "cccbridge:block/target_block_horizontal", + "up": "cccbridge:block/source_target_block_vertical", + "west": "cccbridge:block/target_block_horizontal" + } + } \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/wanze/base.json b/fabric/src/main/resources/assets/cccbridge/models/block/wanze/base.json deleted file mode 100644 index 02d9f53..0000000 --- a/fabric/src/main/resources/assets/cccbridge/models/block/wanze/base.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "credit": "By Sammy.K via Blockbench", - "textures": { - "0": "cccbridge:block/wanze/wanze_side", - "4": "cccbridge:block/wanze/wanze_top", - "particle": "cccbridge:block/wanze/wanze_side" - }, - "elements": [ - { - "name": "lower", - "from": [1, 1, 1], - "to": [15, 5, 15], - "faces": { - "north": {"uv": [1, 11, 15, 15], "texture": "#0"}, - "east": {"uv": [1, 11, 15, 15], "texture": "#0"}, - "south": {"uv": [1, 11, 15, 15], "texture": "#0"}, - "west": {"uv": [1, 11, 15, 15], "texture": "#0"}, - "up": {"uv": [1, 1, 15, 15], "texture": "#4"}, - "down": {"uv": [1, 1, 15, 15], "texture": "#4"} - } - }, - { - "name": "upper", - "from": [1, 11, 1], - "to": [15, 15, 15], - "faces": { - "north": {"uv": [1, 1, 15, 5], "texture": "#0"}, - "east": {"uv": [1, 1, 15, 5], "texture": "#0"}, - "south": {"uv": [1, 1, 15, 5], "texture": "#0"}, - "west": {"uv": [1, 1, 15, 5], "texture": "#0"}, - "up": {"uv": [1, 1, 15, 15], "texture": "#4"}, - "down": {"uv": [1, 1, 15, 15], "texture": "#4"} - } - }, - { - "name": "vertical-ne", - "from": [15, 0, 0], - "to": [16, 16, 1], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#0"} - } - }, - { - "name": "vertical-es", - "from": [15, 0, 15], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "up": {"uv": [15, 15, 16, 16], "texture": "#0"}, - "down": {"uv": [0, 15, 1, 16], "texture": "#0"} - } - }, - { - "name": "vertical-sw", - "from": [0, 0, 15], - "to": [1, 16, 16], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "up": {"uv": [0, 15, 1, 16], "texture": "#0"}, - "down": {"uv": [15, 15, 16, 16], "texture": "#0"} - } - }, - { - "name": "vertical-wn", - "from": [0, 0, 0], - "to": [1, 16, 1], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#0"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#0"} - } - }, - { - "name": "side-upper-n", - "from": [1, 15, 0], - "to": [15, 16, 1], - "faces": { - "north": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#0"} - } - }, - { - "name": "side-upper-s", - "from": [1, 15, 15], - "to": [15, 16, 16], - "faces": { - "north": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} - } - }, - { - "name": "side-upper-w", - "from": [0, 15, 1], - "to": [1, 16, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "up": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "side-upper-e", - "from": [15, 15, 1], - "to": [16, 16, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#0"}, - "up": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#0"} - } - }, - { - "name": "side-lower-w", - "from": [0, 0, 1], - "to": [1, 1, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 90, "texture": "#0"}, - "down": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "side-lower-s", - "from": [1, 0, 15], - "to": [15, 1, 16], - "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "down": {"uv": [1, 15, 15, 16], "texture": "#0"} - } - }, - { - "name": "side-lower-e", - "from": [15, 0, 1], - "to": [16, 1, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 270, "texture": "#0"}, - "down": {"uv": [0, 1, 1, 15], "texture": "#0"} - } - }, - { - "name": "side-lower-n", - "from": [1, 0, 0], - "to": [15, 1, 1], - "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} - } - } - ], - "groups": [ - { - "name": "gear", - "origin": [8, 8, 8], - "color": 0, - "children": [] - }, - 0, - 1, - { - "name": "frame", - "origin": [0, 0, 0], - "color": 0, - "children": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] - } - ] -} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/wanze/gear.json b/fabric/src/main/resources/assets/cccbridge/models/block/wanze/gear.json deleted file mode 100644 index a341e0d..0000000 --- a/fabric/src/main/resources/assets/cccbridge/models/block/wanze/gear.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "credit": "By Sammy.K via Blockbench", - "textures": { - "1": "cccbridge:block/advanced_wheel", - "2": "create:block/axis", - "3": "create:block/axis_top", - "particle": "cccbridge:block/wanze/wanze_side" - }, - "elements": [ - { - "name": "shaft", - "from": [6, 0, 6], - "to": [10, 16, 10], - "faces": { - "north": {"uv": [6, 0, 10, 16], "texture": "#2"}, - "east": {"uv": [6, 0, 10, 16], "texture": "#2"}, - "south": {"uv": [6, 0, 10, 16], "texture": "#2"}, - "west": {"uv": [6, 0, 10, 16], "texture": "#2"}, - "up": {"uv": [6, 6, 10, 10], "texture": "#3"}, - "down": {"uv": [6, 6, 10, 10], "texture": "#3"} - } - }, - { - "name": "ne-sw", - "from": [-1, 6.5, 6.5], - "to": [17, 9.5, 9.5], - "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "east": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "south": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "west": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "up": {"uv": [6, 3, 15, 4.5], "texture": "#1"}, - "down": {"uv": [6, 3, 15, 4.5], "rotation": 180, "texture": "#1"} - } - }, - { - "name": "ow", - "from": [-1, 6.5, 6.5], - "to": [17, 9.5, 9.5], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "east": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "south": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "west": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "up": {"uv": [6, 3, 15, 4.5], "texture": "#1"}, - "down": {"uv": [6, 3, 15, 4.5], "rotation": 180, "texture": "#1"} - } - }, - { - "name": "nw-se", - "from": [-1, 6.5, 6.5], - "to": [17, 9.5, 9.5], - "rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "east": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "south": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "west": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "up": {"uv": [6, 3, 15, 4.5], "texture": "#1"}, - "down": {"uv": [6, 3, 15, 4.5], "rotation": 180, "texture": "#1"} - } - }, - { - "name": "ns", - "from": [6.5, 6.5, -1], - "to": [9.5, 9.5, 17], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "east": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "south": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "west": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "up": {"uv": [6, 3, 15, 4.5], "rotation": 90, "texture": "#1"}, - "down": {"uv": [6, 3, 15, 4.5], "rotation": 90, "texture": "#1"} - } - }, - { - "name": "inner", - "from": [2, 6.75, 2], - "to": [14, 9.25, 14], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 6.5, 6, 8], "texture": "#1"}, - "east": {"uv": [0, 6.5, 6, 8], "texture": "#1"}, - "south": {"uv": [0, 6.5, 6, 8], "texture": "#1"}, - "west": {"uv": [0, 6.5, 6, 8], "texture": "#1"}, - "up": {"uv": [0, 0, 6, 6], "texture": "#1"}, - "down": {"uv": [0, 0, 6, 6], "texture": "#1"} - } - }, - { - "name": "outer", - "from": [4, 6, 4], - "to": [12, 10, 12], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 6, 6, 6.5], "texture": "#1"}, - "east": {"uv": [0, 6, 6, 6.5], "texture": "#1"}, - "south": {"uv": [0, 6, 6, 6.5], "texture": "#1"}, - "west": {"uv": [0, 6, 6, 6.5], "texture": "#1"}, - "up": {"uv": [1, 1, 5, 5], "texture": "#1"}, - "down": {"uv": [1, 1, 5, 5], "texture": "#1"} - } - } - ], - "groups": [ - 0, - { - "name": "gear", - "origin": [8, 8, 8], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [1, 2, 3, 4, 5, 6] - } - ] -} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/block/wanze/preview.json b/fabric/src/main/resources/assets/cccbridge/models/block/wanze/preview.json deleted file mode 100644 index 3552660..0000000 --- a/fabric/src/main/resources/assets/cccbridge/models/block/wanze/preview.json +++ /dev/null @@ -1,313 +0,0 @@ -{ - "credit": "By Sammy.K via Blockbench", - "textures": { - "0": "cccbridge:block/wanze/wanze_side", - "1": "cccbridge:block/advanced_wheel", - "2": "create:block/axis", - "3": "create:block/axis_top", - "4": "cccbridge:block/wanze/wanze_top", - "particle": "cccbridge:block/wanze/wanze_side" - }, - "elements": [ - { - "name": "shaft", - "from": [6, 0, 6], - "to": [10, 16, 10], - "faces": { - "north": {"uv": [6, 0, 10, 16], "texture": "#2"}, - "east": {"uv": [6, 0, 10, 16], "texture": "#2"}, - "south": {"uv": [6, 0, 10, 16], "texture": "#2"}, - "west": {"uv": [6, 0, 10, 16], "texture": "#2"}, - "up": {"uv": [6, 6, 10, 10], "texture": "#3"}, - "down": {"uv": [6, 6, 10, 10], "texture": "#3"} - } - }, - { - "name": "ne-sw", - "from": [-1, 6.5, 6.5], - "to": [17, 9.5, 9.5], - "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "east": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "south": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "west": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "up": {"uv": [6, 3, 15, 4.5], "texture": "#1"}, - "down": {"uv": [6, 3, 15, 4.5], "rotation": 180, "texture": "#1"} - } - }, - { - "name": "ow", - "from": [-1, 6.5, 6.5], - "to": [17, 9.5, 9.5], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "east": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "south": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "west": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "up": {"uv": [6, 3, 15, 4.5], "texture": "#1"}, - "down": {"uv": [6, 3, 15, 4.5], "rotation": 180, "texture": "#1"} - } - }, - { - "name": "nw-se", - "from": [-1, 6.5, 6.5], - "to": [17, 9.5, 9.5], - "rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "east": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "south": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "west": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "up": {"uv": [6, 3, 15, 4.5], "texture": "#1"}, - "down": {"uv": [6, 3, 15, 4.5], "rotation": 180, "texture": "#1"} - } - }, - { - "name": "ns", - "from": [6.5, 6.5, -1], - "to": [9.5, 9.5, 17], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "east": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "south": {"uv": [9, 10, 10.5, 11.5], "texture": "#1"}, - "west": {"uv": [0, 10, 9, 11.5], "texture": "#1"}, - "up": {"uv": [6, 3, 15, 4.5], "rotation": 90, "texture": "#1"}, - "down": {"uv": [6, 3, 15, 4.5], "rotation": 90, "texture": "#1"} - } - }, - { - "name": "inner", - "from": [2, 6.75, 2], - "to": [14, 9.25, 14], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 6.5, 6, 8], "texture": "#1"}, - "east": {"uv": [0, 6.5, 6, 8], "texture": "#1"}, - "south": {"uv": [0, 6.5, 6, 8], "texture": "#1"}, - "west": {"uv": [0, 6.5, 6, 8], "texture": "#1"}, - "up": {"uv": [0, 0, 6, 6], "texture": "#1"}, - "down": {"uv": [0, 0, 6, 6], "texture": "#1"} - } - }, - { - "name": "outer", - "from": [4, 6, 4], - "to": [12, 10, 12], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 6, 6, 6.5], "texture": "#1"}, - "east": {"uv": [0, 6, 6, 6.5], "texture": "#1"}, - "south": {"uv": [0, 6, 6, 6.5], "texture": "#1"}, - "west": {"uv": [0, 6, 6, 6.5], "texture": "#1"}, - "up": {"uv": [1, 1, 5, 5], "texture": "#1"}, - "down": {"uv": [1, 1, 5, 5], "texture": "#1"} - } - }, - { - "name": "lower", - "from": [1, 1, 1], - "to": [15, 5, 15], - "faces": { - "north": {"uv": [1, 11, 15, 15], "texture": "#0"}, - "east": {"uv": [1, 11, 15, 15], "texture": "#0"}, - "south": {"uv": [1, 11, 15, 15], "texture": "#0"}, - "west": {"uv": [1, 11, 15, 15], "texture": "#0"}, - "up": {"uv": [1, 1, 15, 15], "texture": "#4"}, - "down": {"uv": [1, 1, 15, 15], "texture": "#4"} - } - }, - { - "name": "upper", - "from": [1, 11, 1], - "to": [15, 15, 15], - "faces": { - "north": {"uv": [1, 1, 15, 5], "texture": "#0"}, - "east": {"uv": [1, 1, 15, 5], "texture": "#0"}, - "south": {"uv": [1, 1, 15, 5], "texture": "#0"}, - "west": {"uv": [1, 1, 15, 5], "texture": "#0"}, - "up": {"uv": [1, 1, 15, 15], "texture": "#4"}, - "down": {"uv": [1, 1, 15, 15], "texture": "#4"} - } - }, - { - "name": "vertical-ne", - "from": [15, 0, 0], - "to": [16, 16, 1], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#0"} - } - }, - { - "name": "vertical-es", - "from": [15, 0, 15], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "up": {"uv": [15, 15, 16, 16], "texture": "#0"}, - "down": {"uv": [0, 15, 1, 16], "texture": "#0"} - } - }, - { - "name": "vertical-sw", - "from": [0, 0, 15], - "to": [1, 16, 16], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "up": {"uv": [0, 15, 1, 16], "texture": "#0"}, - "down": {"uv": [15, 15, 16, 16], "texture": "#0"} - } - }, - { - "name": "vertical-wn", - "from": [0, 0, 0], - "to": [1, 16, 1], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#0"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#0"} - } - }, - { - "name": "side-upper-n", - "from": [1, 15, 0], - "to": [15, 16, 1], - "faces": { - "north": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#0"} - } - }, - { - "name": "side-upper-s", - "from": [1, 15, 15], - "to": [15, 16, 16], - "faces": { - "north": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} - } - }, - { - "name": "side-upper-w", - "from": [0, 15, 1], - "to": [1, 16, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "up": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "side-upper-e", - "from": [15, 15, 1], - "to": [16, 16, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#0"}, - "up": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#0"} - } - }, - { - "name": "side-lower-w", - "from": [0, 0, 1], - "to": [1, 1, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 90, "texture": "#0"}, - "down": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "side-lower-s", - "from": [1, 0, 15], - "to": [15, 1, 16], - "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "down": {"uv": [1, 15, 15, 16], "texture": "#0"} - } - }, - { - "name": "side-lower-e", - "from": [15, 0, 1], - "to": [16, 1, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 270, "texture": "#0"}, - "down": {"uv": [0, 1, 1, 15], "texture": "#0"} - } - }, - { - "name": "side-lower-n", - "from": [1, 0, 0], - "to": [15, 1, 1], - "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} - } - } - ], - "groups": [ - 0, - { - "name": "gear", - "origin": [8, 8, 8], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [1, 2, 3, 4, 5, 6] - }, - 7, - 8, - { - "name": "frame", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] - } - ] -} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/entity/animatronic.bbmodel b/fabric/src/main/resources/assets/cccbridge/models/entity/animatronic.bbmodel new file mode 100644 index 0000000..0536de5 --- /dev/null +++ b/fabric/src/main/resources/assets/cccbridge/models/entity/animatronic.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.5","model_format":"modded_entity","box_uv":true},"name":"animatronic","model_identifier":"animatronic","modded_entity_version":"1.17","modded_entity_flip_y":true,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":64,"height":64},"elements":[{"name":"head","box_uv":true,"rescale":false,"locked":false,"from":[-5,19,-7.500000000000002],"to":[5,29,2.5000000000000004],"autouv":0,"color":0,"origin":[0,6,-2.4999999999999996],"faces":{"north":{"uv":[10.000000000000002,10.000000000000002,20,20],"texture":0},"east":{"uv":[0,10.000000000000002,10.000000000000002,20],"texture":0},"south":{"uv":[30.000000000000004,10.000000000000002,40,20],"texture":0},"west":{"uv":[20,10.000000000000002,30,20],"texture":0},"up":{"uv":[20,10.000000000000002,10,0],"texture":0},"down":{"uv":[30,0,20,10.000000000000002],"texture":0}},"type":"cube","uuid":"983326be-c52f-6d62-e8f9-2fc169cb7792"},{"name":"body","box_uv":true,"rescale":false,"locked":false,"from":[-3,10,-4.500000000000002],"to":[3,18,-0.5],"autouv":0,"color":9,"origin":[0,6,-2.4999999999999996],"uv_offset":[0,20],"faces":{"north":{"uv":[4.000000000000002,24,10.000000000000002,32],"texture":0},"east":{"uv":[0,24,4.000000000000002,32],"texture":0},"south":{"uv":[14.000000000000004,24,20.000000000000004,32],"texture":0},"west":{"uv":[10.000000000000002,24,14.000000000000004,32],"texture":0},"up":{"uv":[10.000000000000002,24,4.000000000000002,20],"texture":0},"down":{"uv":[16,20,10,24],"texture":0}},"type":"cube","uuid":"53b35782-90ec-ae42-69f9-03af3c6eee02"},{"name":"shoulder","box_uv":true,"rescale":false,"locked":false,"from":[-6,15.5,-2.9999999999999996],"to":[6,16.5,-1.9999999999999996],"autouv":0,"color":4,"origin":[0,6,-2.4999999999999996],"uv_offset":[26,20],"faces":{"north":{"uv":[27,21,39,22],"texture":0},"east":{"uv":[26,21,27,22],"texture":0},"south":{"uv":[40,21,52,22],"texture":0},"west":{"uv":[39,21,40,22],"texture":0},"up":{"uv":[39,21,27,20],"texture":0},"down":{"uv":[51,20,39,21],"texture":0}},"type":"cube","uuid":"68f5c928-414f-4de7-09b2-46ea4d076351"},{"name":"right","box_uv":true,"rescale":false,"locked":false,"from":[5,6,-3.4999999999999996],"to":[7,18,-1.4999999999999996],"autouv":0,"color":4,"origin":[0,6,-2.4999999999999996],"uv_offset":[0,32],"faces":{"north":{"uv":[2,34,4,46],"texture":0},"east":{"uv":[0,34,2,46],"texture":0},"south":{"uv":[6,34,8,46],"texture":0},"west":{"uv":[4,34,6,46],"texture":0},"up":{"uv":[4,34,2,32],"texture":0},"down":{"uv":[6,32,4,34],"texture":0}},"type":"cube","uuid":"d43891b0-0785-c032-0498-f7f5719adaf6"},{"name":"left","box_uv":true,"rescale":false,"locked":false,"from":[-7,6,-3.4999999999999996],"to":[-5,18,-1.4999999999999996],"autouv":0,"color":4,"origin":[0,6,-2.4999999999999996],"uv_offset":[20,20],"faces":{"north":{"uv":[22,22,24,34],"texture":0},"east":{"uv":[20,22,22,34],"texture":0},"south":{"uv":[26,22,28,34],"texture":0},"west":{"uv":[24,22,26,34],"texture":0},"up":{"uv":[24,22,22,20],"texture":0},"down":{"uv":[26,20,24,22],"texture":0}},"type":"cube","uuid":"3545fcdc-da31-0c11-27f1-bd071718f1c2"},{"name":"neck","box_uv":true,"rescale":false,"locked":false,"from":[-1,18,-3.4999999999999996],"to":[1,20,-1.4999999999999996],"autouv":0,"color":4,"origin":[0,6,-2.4999999999999996],"uv_offset":[8,32],"faces":{"north":{"uv":[10,34,12,36],"texture":0},"east":{"uv":[8,34,10,36],"texture":0},"south":{"uv":[14,34,16,36],"texture":0},"west":{"uv":[12,34,14,36],"texture":0},"up":{"uv":[12,34,10,32],"texture":0},"down":{"uv":[14,32,12,34],"texture":0}},"type":"cube","uuid":"58c87944-0655-3c67-4c79-e25cf0ecc2aa"}],"outliner":[{"name":"root","origin":[0,14,0],"color":0,"uuid":"138ba760-ee55-83ad-2ae1-86dc0f45a078","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":[{"name":"head","origin":[0,20,-2.4999999999999996],"color":0,"uuid":"b63c1834-bb3b-e14d-d441-411f4061f7bd","export":true,"mirror_uv":false,"isOpen":false,"locked":false,"visibility":true,"autouv":0,"children":["983326be-c52f-6d62-e8f9-2fc169cb7792"]},"58c87944-0655-3c67-4c79-e25cf0ecc2aa","53b35782-90ec-ae42-69f9-03af3c6eee02","68f5c928-414f-4de7-09b2-46ea4d076351",{"name":"rightarm","origin":[6,16,-2.4999999999999996],"color":0,"uuid":"b96240a4-e136-4252-e14e-8a9e40a7912a","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["d43891b0-0785-c032-0498-f7f5719adaf6"]},{"name":"leftarm","origin":[-6,16,-2.4999999999999996],"color":0,"uuid":"651fbc5b-c499-0db1-89a2-b7c8b2a63a0d","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["3545fcdc-da31-0c11-27f1-bd071718f1c2"]}]}],"textures":[{"path":"C:\\Users\\Sammy\\Documents\\GitHub\\cccbridge\\forge\\src\\main\\resources\\assets\\cccbridge\\textures\\entity\\animatronic\\body.png","name":"body.png","folder":"block","namespace":"","id":"0","particle":false,"render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"ce0d31b2-e9e8-fdac-090c-6229a474c760","relative_path":"../../../textures/entity/animatronic/body.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABJZJREFUeF7tWU1IVFEUvlNmKqipOWr0RxJm1sIiN4kgYgSRi1ZREC1bBCIU7SLaBVEIFbSJaBFtatHPKtpYbYxwUaYShmSgjqmlMFlJE9+VM5y5c9+8e8eZ4c2bdzfPO++89875znfO+d4zJAxX2+GTMZgWl22WV1TX7pTH+dkJefwT/Z5wJze7wbePQoaPzqqZsRMAAEEh8H8VvxOcWre4UQJBIJjY5R0A7d3nY7rgCQkCgdihgqTavXl5yxj8bFLA2AkAsKmxQfpSX1Qvplem40dy8Mf4lPyT7Jwch13eAdBz6nqMZ1UHAliA5ZR9zoKnDy8Yg+8JBqgA6JzyNQC8BJzKwNclwJugE/1pJJo0y7zrAQU/Bn0rhDIdGDVHNyVoapdtwRTKNLVJLueLYgzpFB41OQRjq/BUJcjv5XQ/taliH5lfkPI6281SAsCVm67D24w3rgRNFKMKEN/nQjGGdAJHdVwVONxJlS2kBJ2CJxZwxaiCkEvFqAWACx3u8OXhBXGwcUUcD1ckCMFnkUXxfrxIXG2pSpDCqQLzimSOl4CTs3CUSmBPU6sMEC9CfOFarNGxoZQvQ/QMXUk5lV5OegB1bB0Ia22CBBTdW3e/VMoy6wCkMwbD1VVxFvCObfNBxHRc5kQHkDM0wnB0+9RF5UC0t/0k5hkhpL7W7qjbEivZUCmW//4U/BguLxeRpSWhHse+jWjf6z/374t9/TIntu+qEXUdx0RF67XQq96GGPZY+G1m4IWAzc9lISpLhDh09ow8R7/jbxv7rv4p628MSRc0bW2OqcHTXgfC65FB7UMXhy7Jj6jv7j+QQSBQ24AoOQQi3Y8Ao98BGBaeYQtCkvNrZQAyj+zyBRAo+N29H62zpLI0k/uMMyDvAADldYiOtvVIcXN67okV4M8vro/bExOIojjhOQZQzcM5NL2WurCYjf4SA82dIvq4TxzY1hlvfOgFZId+oFtXjkzGG5d6Pp0atUI/DeNQKgAmbvSJo+3OANSWlUqw6Ijn3zsXTWp4Hz6tNsD9e2u8yQAOHDHgZnG3pD/tMQL5IgaoIPR1TMqRxjs+XQcgTty1H1VpJNb4EskAGm+4CgFjDc9E5PF2R7m4M1Ya3/NR6MQAejr1AE9PAWqCamAAgMAAzbkIQoBODND1ACoBMMN2ThunMk3DBAYgKMoqAqbsAwAsVQnqGMABIPHDffMkAGptIzBiAA9e1wNU4AEALZKxtPfkFCDnoNPpb2hyaHclOFUvOL4DqD2A9tADntMB5By0u4umNgZAp/vxHE8CgMzztzA4ymu3q3/1X94plqe0vZuz6vmkV1TKFAHhewB0Ly9e1u62GXazD3EAeOB0odealltAtudlCVAP4IqNlUBe17gbIAk9QDX24tx2C8j2fAIA6vgqGAAINXxr48uL2t02w272kgFq4HRRwQCgokQaviBKAGNQ1/zwG4AoiDHIM47A+Vj02uurW03bnvf1jDcBIwDABCU/2wQM8HN2TWILGGCCkp9tAgb4ObsmsQUMMEHJzzYBA/ycXZPYAgaYoORnm4ABfs6uSWwFz4D/tfP8bichFEQAAAAASUVORK5CYII="}]} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/item/animatronic_block.json b/fabric/src/main/resources/assets/cccbridge/models/item/animatronic_block.json new file mode 100644 index 0000000..b29148c --- /dev/null +++ b/fabric/src/main/resources/assets/cccbridge/models/item/animatronic_block.json @@ -0,0 +1,168 @@ +{ + "credit": "Made with Blockbench", + "parent": "cccbridge:block/animatronic_block", + "texture_size": [64, 64], + "textures": { + "0": "cccbridge:block/animatronic_block", + "1": "cccbridge:entity/animatronic/body", + "2": "cccbridge:entity/animatronic/face_happy", + "particle": "cccbridge:block/animatronic_block" + }, + "elements": [ + { + "name": "base", + "from": [7.5, 2, 7.5], + "to": [8.5, 10, 8.5], + "faces": { + "north": {"uv": [6, 7, 6.5, 11], "texture": "#0"}, + "east": {"uv": [6.5, 7, 7, 11], "texture": "#0"}, + "south": {"uv": [7, 7, 7.5, 11], "texture": "#0"}, + "west": {"uv": [7.5, 7, 8, 11], "texture": "#0"}, + "up": {"uv": [8.5, 4.5, 8, 4], "texture": "#0"}, + "down": {"uv": [8.5, 4.5, 8, 5], "texture": "#0"} + } + }, + { + "name": "stick", + "from": [2, 0, 2], + "to": [14, 2, 14], + "faces": { + "north": {"uv": [6, 0, 12, 1], "texture": "#0"}, + "east": {"uv": [6, 1, 12, 2], "texture": "#0"}, + "south": {"uv": [6, 2, 12, 3], "texture": "#0"}, + "west": {"uv": [6, 3, 12, 4], "texture": "#0"}, + "up": {"uv": [6, 6, 0, 0], "texture": "#0"}, + "down": {"uv": [6, 6, 0, 12], "texture": "#0"} + } + }, + { + "name": "head", + "from": [3, 14, 0.5], + "to": [13, 24, 10.5], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 14, 5.5]}, + "faces": { + "north": {"uv": [5, 2.5, 7.5, 5], "texture": "#1"}, + "east": {"uv": [2.5, 2.5, 5, 5], "texture": "#1"}, + "south": {"uv": [0, 2.5, 2.5, 5], "texture": "#1"}, + "west": {"uv": [7.5, 2.5, 10, 5], "texture": "#1"}, + "up": {"uv": [5, 2.5, 2.5, 0], "rotation": 90, "texture": "#1"}, + "down": {"uv": [7.5, 0, 5, 2.5], "rotation": 270, "texture": "#1"} + } + }, + { + "name": "face", + "from": [13.23223, 14, 0.45406], + "to": [13.23223, 24, 10.45406], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 14, 5.5]}, + "faces": { + "east": {"uv": [2.5, 2.5, 5, 5], "texture": "#2"} + } + }, + { + "name": "neck", + "from": [7, 13, 4.5], + "to": [9, 15, 6.5], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, -2.5]}, + "faces": { + "north": {"uv": [2.5, 8.5, 3, 9], "texture": "#1"}, + "east": {"uv": [2, 8.5, 2.5, 9], "texture": "#1"}, + "south": {"uv": [3.5, 8.5, 4, 9], "texture": "#1"}, + "west": {"uv": [3, 8.5, 3.5, 9], "texture": "#1"}, + "up": {"uv": [3, 8.5, 2.5, 8], "texture": "#1"}, + "down": {"uv": [3.5, 8, 3, 8.5], "texture": "#1"} + } + }, + { + "name": "body", + "from": [5, 5, 3.5], + "to": [11, 13, 7.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 10, 7.5]}, + "faces": { + "north": {"uv": [1, 6, 2.5, 8], "texture": "#1"}, + "east": {"uv": [0, 6, 1, 8], "texture": "#1"}, + "south": {"uv": [3.5, 6, 5, 8], "texture": "#1"}, + "west": {"uv": [2.5, 6, 3.5, 8], "texture": "#1"}, + "up": {"uv": [2.5, 6, 1, 5], "texture": "#1"}, + "down": {"uv": [4, 5, 2.5, 6], "texture": "#1"} + } + }, + { + "name": "shoulder", + "from": [2, 10.5, 5], + "to": [14, 11.5, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, -2.5]}, + "faces": { + "north": {"uv": [6.75, 5.25, 9.75, 5.5], "texture": "#1"}, + "east": {"uv": [6.5, 5.25, 6.75, 5.5], "texture": "#1"}, + "south": {"uv": [10, 5.25, 13, 5.5], "texture": "#1"}, + "west": {"uv": [9.75, 5.25, 10, 5.5], "texture": "#1"}, + "up": {"uv": [9.75, 5.25, 6.75, 5], "texture": "#1"}, + "down": {"uv": [12.75, 5, 9.75, 5.25], "texture": "#1"} + } + }, + { + "name": "right", + "from": [13, 1, 4.5], + "to": [15, 13, 6.5], + "rotation": {"angle": 22.5, "axis": "z", "origin": [13, 11, 5.5]}, + "faces": { + "north": {"uv": [0.5, 8.5, 1, 11.5], "texture": "#1"}, + "east": {"uv": [0, 8.5, 0.5, 11.5], "texture": "#1"}, + "south": {"uv": [1.5, 8.5, 2, 11.5], "texture": "#1"}, + "west": {"uv": [1, 8.5, 1.5, 11.5], "texture": "#1"}, + "up": {"uv": [1, 8.5, 0.5, 8], "texture": "#1"}, + "down": {"uv": [1.5, 8, 1, 8.5], "texture": "#1"} + } + }, + { + "name": "left", + "from": [1, 1, 4.5], + "to": [3, 13, 6.5], + "rotation": {"angle": 45, "axis": "x", "origin": [3, 11, 5.5]}, + "faces": { + "north": {"uv": [5.5, 5.5, 6, 8.5], "texture": "#1"}, + "east": {"uv": [5, 5.5, 5.5, 8.5], "texture": "#1"}, + "south": {"uv": [6.5, 5.5, 7, 8.5], "texture": "#1"}, + "west": {"uv": [6, 5.5, 6.5, 8.5], "texture": "#1"}, + "up": {"uv": [6, 5.5, 5.5, 5], "texture": "#1"}, + "down": {"uv": [6.5, 5, 6, 5.5], "texture": "#1"} + } + } + ], + "groups": [ + { + "name": "VoxelShapes", + "origin": [0, 0, 0], + "color": 0, + "children": [0, 1] + }, + { + "name": "root", + "origin": [0, 14, 0], + "color": 0, + "children": [ + { + "name": "head", + "origin": [0, 20, -2.5], + "color": 0, + "children": [2, 3] + }, + 4, + 5, + 6, + { + "name": "rightarm", + "origin": [6, 16, -2.5], + "color": 0, + "children": [7] + }, + { + "name": "leftarm", + "origin": [-6, 16, -2.5], + "color": 0, + "children": [8] + } + ] + } + ] +} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/models/item/wanze.json b/fabric/src/main/resources/assets/cccbridge/models/item/wanze.json deleted file mode 100644 index f4a3c19..0000000 --- a/fabric/src/main/resources/assets/cccbridge/models/item/wanze.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "cccbridge:block/wanze/preview" -} \ No newline at end of file diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/advanced_wheel.png b/fabric/src/main/resources/assets/cccbridge/textures/block/advanced_wheel.png deleted file mode 100644 index ba91e10..0000000 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/advanced_wheel.png and /dev/null differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/animatronic_block.png b/fabric/src/main/resources/assets/cccbridge/textures/block/animatronic_block.png new file mode 100644 index 0000000..0f49242 Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/block/animatronic_block.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/background.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/background.png index 0190758..5fd2852 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/background.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/background.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/connector.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/connector.png deleted file mode 100644 index e03a70f..0000000 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/connector.png and /dev/null differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/0.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/0.png new file mode 100644 index 0000000..1659e4a Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/0.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/1.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/1.png index 1352829..c4bc77f 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/1.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/1.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/10.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/10.png index 6cc6c9f..5af035d 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/10.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/10.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/11.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/11.png index 46ab109..0749a26 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/11.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/11.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/12.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/12.png index 8e34b43..f2d77e8 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/12.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/12.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/13.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/13.png index 778bae2..714be72 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/13.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/13.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/14.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/14.png index ee66cec..7bd8c3a 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/14.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/14.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/15.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/15.png index 987ce11..04718aa 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/15.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/15.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/16.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/16.png index 80a0ba3..b1f477b 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/16.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/16.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/2.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/2.png index 952f152..461eef4 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/2.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/2.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/3.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/3.png index 1c9e812..54ab01d 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/3.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/3.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/4.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/4.png index b34f489..30b66b4 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/4.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/4.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/5.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/5.png index b352807..b9dcb9b 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/5.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/5.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/6.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/6.png index 48d9b32..f8df71d 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/6.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/6.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/7.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/7.png index fa74d68..f4934d3 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/7.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/7.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/8.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/8.png index 721b56b..2045d2e 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/8.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/8.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/9.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/9.png index 8c7c65f..e91ce35 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/9.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/face/9.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_front.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_front.png index e46f886..4749d17 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_front.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_front.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_side.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_side.png index 7b53360..112891a 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_side.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_side.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_top.png b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_top.png index 66e09d7..95a46cb 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_top.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_top.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/cage.png b/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/cage.png index 0aa9553..6d0ea5e 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/cage.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/cage.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/interface.png b/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/interface.png index 92f988d..9272c13 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/interface.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/interface.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_front.png b/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_front.png index fccbab9..c97a359 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_front.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_front.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_side.png b/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_side.png index fe1df09..bcc8c24 100644 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_side.png and b/fabric/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_side.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png b/fabric/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png new file mode 100644 index 0000000..df14c26 Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png.mcmeta b/fabric/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png.mcmeta new file mode 100644 index 0000000..df5ea39 --- /dev/null +++ b/fabric/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": true, + "frametime": 32 + } +} diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/source_block_side.png b/fabric/src/main/resources/assets/cccbridge/textures/block/source_block_side.png deleted file mode 100644 index a2d8621..0000000 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/source_block_side.png and /dev/null differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/source_target_block_vertical.png b/fabric/src/main/resources/assets/cccbridge/textures/block/source_target_block_vertical.png new file mode 100644 index 0000000..63aecd8 Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/block/source_target_block_vertical.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/st_block_top.png b/fabric/src/main/resources/assets/cccbridge/textures/block/st_block_top.png deleted file mode 100644 index 588647a..0000000 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/st_block_top.png and /dev/null differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/target_block_horizontal.png b/fabric/src/main/resources/assets/cccbridge/textures/block/target_block_horizontal.png new file mode 100644 index 0000000..8da7ee6 Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/block/target_block_horizontal.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/target_block_side.png b/fabric/src/main/resources/assets/cccbridge/textures/block/target_block_side.png deleted file mode 100644 index f84c5b1..0000000 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/target_block_side.png and /dev/null differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/wanze/wanze_side.png b/fabric/src/main/resources/assets/cccbridge/textures/block/wanze/wanze_side.png deleted file mode 100644 index a8d4a94..0000000 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/wanze/wanze_side.png and /dev/null differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/block/wanze/wanze_top.png b/fabric/src/main/resources/assets/cccbridge/textures/block/wanze/wanze_top.png deleted file mode 100644 index 8f3e245..0000000 Binary files a/fabric/src/main/resources/assets/cccbridge/textures/block/wanze/wanze_top.png and /dev/null differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/body.png b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/body.png new file mode 100644 index 0000000..9ede837 Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/body.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_creepy.png b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_creepy.png new file mode 100644 index 0000000..e0a1621 Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_creepy.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_happy.png b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_happy.png new file mode 100644 index 0000000..3bb8a80 Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_happy.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_normal.png b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_normal.png new file mode 100644 index 0000000..db0d54d Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_normal.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_question.png b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_question.png new file mode 100644 index 0000000..a38034d Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_question.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_sad.png b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_sad.png new file mode 100644 index 0000000..5287c06 Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_sad.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/gui/advancements/backgrounds/luarocks.png b/fabric/src/main/resources/assets/cccbridge/textures/gui/advancements/backgrounds/luarocks.png new file mode 100644 index 0000000..aafd6fb Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/gui/advancements/backgrounds/luarocks.png differ diff --git a/fabric/src/main/resources/assets/cccbridge/textures/painting/funny_redrouters.png b/fabric/src/main/resources/assets/cccbridge/textures/painting/funny_redrouters.png new file mode 100644 index 0000000..4f8c020 Binary files /dev/null and b/fabric/src/main/resources/assets/cccbridge/textures/painting/funny_redrouters.png differ diff --git a/fabric/src/main/resources/data/cccbridge/advancements/place_animatronic.json b/fabric/src/main/resources/data/cccbridge/advancements/place_animatronic.json new file mode 100644 index 0000000..6ba83a0 --- /dev/null +++ b/fabric/src/main/resources/data/cccbridge/advancements/place_animatronic.json @@ -0,0 +1,21 @@ +{ + "display": { + "title": "Five Nights in Minecraft", + "description": "A very normal Animatronic, what could go wrong!", + "icon": { "item": "cccbridge:animatronic_block" }, + "frame": "task", + "show_toast": false, + "announce_to_chat": true, + "hidden": false, + "background": "cccbridge:textures/gui/advancements/backgrounds/luarocks.png" + }, + "criteria": { + "placed_animatronic": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "cccbridge:animatronic_block" + } + } + }, + "parent": "cccbridge:place_redrouter" +} \ No newline at end of file diff --git a/fabric/src/main/resources/data/cccbridge/advancements/place_redrouter.json b/fabric/src/main/resources/data/cccbridge/advancements/place_redrouter.json index c350da6..e64ae8a 100644 --- a/fabric/src/main/resources/data/cccbridge/advancements/place_redrouter.json +++ b/fabric/src/main/resources/data/cccbridge/advancements/place_redrouter.json @@ -6,11 +6,11 @@ "frame": "task", "show_toast": false, "announce_to_chat": true, - "hidden": true, - "background": "minecraft:textures/gui/advancements/backgrounds/stone.png" + "hidden": false, + "background": "cccbridge:textures/gui/advancements/backgrounds/luarocks.png" }, "criteria": { - "c1": { + "placed_redrouter": { "trigger": "minecraft:placed_block", "conditions": { "block": "cccbridge:redrouter_block" diff --git a/fabric/src/main/resources/data/cccbridge/loot_tables/blocks/animatronic_block.json b/fabric/src/main/resources/data/cccbridge/loot_tables/blocks/animatronic_block.json new file mode 100644 index 0000000..c7bfd1f --- /dev/null +++ b/fabric/src/main/resources/data/cccbridge/loot_tables/blocks/animatronic_block.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "cccbridge:animatronic_block" + } + ] + } + ] +} \ No newline at end of file diff --git a/fabric/src/main/resources/data/cccbridge/recipes/animatronic_block.json b/fabric/src/main/resources/data/cccbridge/recipes/animatronic_block.json new file mode 100644 index 0000000..4666e68 --- /dev/null +++ b/fabric/src/main/resources/data/cccbridge/recipes/animatronic_block.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " M ", + "HTH", + " R " + ], + "key": { + "M": { + "item": "computercraft:monitor_normal" + }, + "T": { + "item": "minecraft:leather_chestplate" + }, + "R": { + "item": "minecraft:redstone" + }, + "H": { + "item": "create:brass_hand" + } + }, + "result": { + "item": "cccbridge:animatronic_block", + "count": 1 + } +} \ No newline at end of file diff --git a/fabric/src/main/resources/data/cccbridge/recipes/scroller_block.json b/fabric/src/main/resources/data/cccbridge/recipes/scroller_block.json index 2c56350..0f45d9c 100644 --- a/fabric/src/main/resources/data/cccbridge/recipes/scroller_block.json +++ b/fabric/src/main/resources/data/cccbridge/recipes/scroller_block.json @@ -1,26 +1,26 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "BPB", - "BCB", - "BWB" + " C ", + "APA", + " R " ], "key": { - "B": { - "item": "create:brass_nugget" + "C": { + "item": "create:cogwheel" }, "P": { "item": "create:precision_mechanism" }, - "C": { - "item": "create:brass_casing" + "R": { + "item": "minecraft:redstone" }, - "W": { - "item": "computercraft:wired_modem" + "A": { + "item": "create:cut_asurine" } }, "result": { "item": "cccbridge:scroller_block", - "count": 2 + "count": 1 } } \ No newline at end of file diff --git a/fabric/src/main/resources/data/cccbridge/recipes/source_block.json b/fabric/src/main/resources/data/cccbridge/recipes/source_block.json index ae888d8..7690abc 100644 --- a/fabric/src/main/resources/data/cccbridge/recipes/source_block.json +++ b/fabric/src/main/resources/data/cccbridge/recipes/source_block.json @@ -1,25 +1,22 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "GDG", - "PCP", - "GAG" + "AGA", + "GQG", + "ARA" ], "key": { - "G": { - "item": "create:golden_sheet" - }, - "D": { - "item": "computercraft:disk" + "A": { + "item": "create:cut_asurine" }, - "P": { - "item": "minecraft:paper" + "G": { + "item": "minecraft:glass_pane" }, - "C": { - "item": "create:brass_casing" + "Q": { + "item": "create:rose_quartz_lamp" }, - "A": { - "item": "minecraft:glass" + "R": { + "item": "minecraft:redstone" } }, "result": { diff --git a/fabric/src/main/resources/data/computercraft/lua/rom/autorun/cccbridge.lua b/fabric/src/main/resources/data/computercraft/lua/rom/autorun/cccbridge.lua new file mode 100644 index 0000000..00f63b4 --- /dev/null +++ b/fabric/src/main/resources/data/computercraft/lua/rom/autorun/cccbridge.lua @@ -0,0 +1,2 @@ +local motd = settings.get("motd.path") or "" +settings.set("motd.path", motd..":/rom/cccbridge_motd.txt") \ No newline at end of file diff --git a/fabric/src/main/resources/data/computercraft/lua/rom/cccbridge_motd.txt b/fabric/src/main/resources/data/computercraft/lua/rom/cccbridge_motd.txt new file mode 100644 index 0000000..46e47ad --- /dev/null +++ b/fabric/src/main/resources/data/computercraft/lua/rom/cccbridge_motd.txt @@ -0,0 +1,9 @@ +Hello from CC:C Bridge! +You can connect a Display Link with a Source Block to have your own text on Display Boards. :o +Create. +EMOTIONAL DAMAGE! +Visit tweaked-programs.cc for detailed changelogs about CC:C Bridge! +CC:C Bridge stands for ComputerCraft:Create Bridge. +Scroller Panes are neat to configure values while being easy to integrate in your buildings. +RedRouter Blocks use a similar function set of the Redstone API, try it out! +Target Blocks can help you process Create related information. \ No newline at end of file diff --git a/fabric/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json b/fabric/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json deleted file mode 100644 index da135a1..0000000 --- a/fabric/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "cccbridge:scroller_block" - ] -} \ No newline at end of file diff --git a/fabric/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/fabric/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index 7204cb3..2476a39 100644 --- a/fabric/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/fabric/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -3,6 +3,8 @@ "values": [ "cccbridge:source_block", "cccbridge:target_block", - "cccbridge:redrouter_block" + "cccbridge:redrouter_block", + "cccbridge:scroller_block", + "cccbridge:animatronic_block" ] } \ No newline at end of file diff --git a/fabric/src/main/resources/data/minecraft/tags/blocks/needs_stone_tool.json b/fabric/src/main/resources/data/minecraft/tags/blocks/needs_stone_tool.json deleted file mode 100644 index 24616d0..0000000 --- a/fabric/src/main/resources/data/minecraft/tags/blocks/needs_stone_tool.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "cccbridge:source_block", - "cccbridge:target_block" - ] -} \ No newline at end of file diff --git a/fabric/src/main/resources/data/minecraft/tags/painting_variant/placeable.json b/fabric/src/main/resources/data/minecraft/tags/painting_variant/placeable.json new file mode 100644 index 0000000..2748f4a --- /dev/null +++ b/fabric/src/main/resources/data/minecraft/tags/painting_variant/placeable.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "cccbridge:funny_redrouters" + ] +} \ No newline at end of file diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index c18c810..bf97433 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -1,21 +1,22 @@ { "schemaVersion": 1, - "id": "cccbridge", - "version": "${version}", + "id": "${archives_base_name}", + "version": "${version}-${modloader}", "name": "CC:C Bridge", - "description": "Adds compatibility between the ComputerCraft and Create mod!\n\nCopyright 2022 Sammy L. Koch\nLicensed under the Apache License, Version 2.0 ", + "description": "This mod adds compatibility between the ComputerCraft and Create mod!\n\nCopyright ${copyright_year} Sammy L. Koch", "authors": [ "Sammy L. Koch", "Luke A. Hanssen" ], "contact": { - "homepage": "https://tweaked-programs.cc/tag/cccbridge/", - "sources": "https://github.com/tweaked-programs/cccbridge" + "homepage": "https://tweaked-programs.cc/", + "sources": "https://github.com/tweaked-programs/cccbridge", + "issues": "https://github.com/tweaked-programs/cccbridge/issues" }, - "license": "Apache-2.0", - "icon": "assets/cccbridge/icon.png", + "license": "${license}", + "icon": "iconHD.png", "environment": "*", "entrypoints": { @@ -31,14 +32,10 @@ ], "depends": { - "create": "*", - "computercraft": ">=1.100.5", - "fabricloader": ">=0.14.6", - "fabric": "*", - "minecraft": "~1.18.2", + "create": ">=${create_version_production}", + "computercraft": ">=${cc_version}", + "fabricloader": ">=${loader_version}", + "minecraft": "~${mc_version}", "java": ">=17" - }, - "suggests": { - "another-mod": "*" } } diff --git a/fabric/src/main/resources/icon.png b/fabric/src/main/resources/icon.png new file mode 100644 index 0000000..6840705 Binary files /dev/null and b/fabric/src/main/resources/icon.png differ diff --git a/fabric/src/main/resources/iconHD.png b/fabric/src/main/resources/iconHD.png new file mode 100644 index 0000000..6316164 Binary files /dev/null and b/fabric/src/main/resources/iconHD.png differ diff --git a/forge/build.gradle b/forge/build.gradle index df82a44..7861f74 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,13 +1,16 @@ buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } + maven { url = 'https://maven.parchmentmc.org' } mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true classpath 'org.spongepowered:mixingradle:0.7.+' + classpath "org.parchmentmc:librarian:${librarian_version}" } } + // Only edit below this line plugins { id 'eclipse' @@ -15,16 +18,17 @@ plugins { } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' +apply plugin: 'org.parchmentmc.librarian.forgegradle' -version = mod_version +version = project.mod_version group = 'cc.tweaked_programs.cccbridge' -archivesBaseName = 'cccbridge' +archivesBaseName = project.archives_base_name java.toolchain.languageVersion = JavaLanguageVersion.of(17) println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { - mappings channel: 'official', version: '1.18.2' + mappings channel: 'parchment', version: "${parchment_version}" runs { client { @@ -119,8 +123,18 @@ dependencies { runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency implementation fg.deobf("org.squiddev:cc-tweaked-${mc_version}:${cc_version}") - implementation fg.deobf("com.simibubi.create:Create:mc${mc_version}_${create_version}") - implementation fg.deobf("com.jozufozu.flywheel:Flywheel-Forge:${flywheel_version}") + + implementation fg.deobf("com.simibubi.create:create-${mc_version}:${create_version}:slim") { transitive = false } + implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${mc_version}:${flywheel_version}") + implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}") +} + +processResources { + inputs.property "version", project.version + + filesMatching("META-INF/mods.toml") { + expand(project.properties) + } } jar { @@ -130,11 +144,12 @@ jar { "Specification-Vendor" : "cccbridgesareus", "Specification-Version" : "1", "Implementation-Title" : project.name, - "Implementation-Version" : project.jar.archiveVersion, + "Implementation-Version" : project.mod_version, "Implementation-Vendor" : "cccbridgesareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } + archiveName = "${archives_base_name}-mc${mc_version}-${modloader}-v${mod_version}.${jar.getArchiveExtension().get()}" } jar.finalizedBy('reobfJar') diff --git a/forge/gradle.properties b/forge/gradle.properties index a7837f7..9627a99 100644 --- a/forge/gradle.properties +++ b/forge/gradle.properties @@ -3,15 +3,25 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false +# Description +copyright_year=2023 +license=Apache-2.0 +archives_base_name=cccbridge +modloader=forge + # Properties mc_version=1.18.2 -forge_version=40.1.0 -mod_version=1.3.1 +forge_version=40.2.4 +mod_version=1.5.0 +parchment_version=2022.11.06-1.18.2 +librarian_version = 1.+ # Mod dependencies -cc_version=1.101.0 -create_version=v0.5.0c+146 -flywheel_version=1.18-0.6.4.87 +cc_version=1.101.2 +create_version=0.5.1.c-297 +create_version_production=0.5.1.c +flywheel_version=0.6.9-101 +registrate_version=MC1.18.2-1.1.3 # Runtime only jei_version=9.7.0.209 diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCBridge.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCBridge.java index 2dd2cc2..d94eb97 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCBridge.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCBridge.java @@ -1,14 +1,17 @@ package cc.tweaked_programs.cccbridge; +import cc.tweaked_programs.cccbridge.blockEntityRenderer.AnimatronicBlockEntityRenderer; +import cc.tweaked_programs.cccbridge.blockEntityRenderer.RedRouterBlockEntityRenderer; import cc.tweaked_programs.cccbridge.display.SourceBlockDisplaySource; import cc.tweaked_programs.cccbridge.display.TargetBlockDisplayTarget; -import com.simibubi.create.content.logistics.block.display.AllDisplayBehaviours; +import cc.tweaked_programs.cccbridge.entity.animatronic.AnimatronicModel; +import cc.tweaked_programs.cccbridge.entity.animatronic.AnimatronicRenderer; +import com.simibubi.create.content.redstone.displayLink.AllDisplayBehaviours; import dan200.computercraft.api.ComputerCraftAPI; -import dan200.computercraft.api.peripheral.IPeripheralProvider; import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.RenderType; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.client.event.EntityRenderersEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @@ -21,31 +24,36 @@ @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class CCCBridge { public static final String MOD_ID = "cccbridge"; - //private static final Logger LOGGER = LogUtils.getLogger(); - - public static IPeripheralProvider peripheralProvider = new PeripheralProvider(); + //public static final Logger LOGGER = LogUtils.getLogger(); public CCCBridge() { - BlockRegister.register(); + CCCRegister.register(); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); } @SubscribeEvent public static void complete(FMLLoadCompleteEvent event) { event.enqueueWork(() -> { - AllDisplayBehaviours.assignTile(AllDisplayBehaviours.register(new ResourceLocation(MOD_ID, "source_block_display_source"), new SourceBlockDisplaySource()), BlockRegister.SOURCE_BLOCK_ENTITY.get().delegate); - AllDisplayBehaviours.assignTile(AllDisplayBehaviours.register(new ResourceLocation(MOD_ID, "target_block_display_source"), new TargetBlockDisplayTarget()), BlockRegister.TARGET_BLOCK_ENTITY.get().delegate); - - ComputerCraftAPI.registerPeripheralProvider((world, pos, side) -> world.getBlockEntity(pos, BlockRegister.SOURCE_BLOCK_ENTITY.get()).map(be -> be.getPeripheral(side)).map(val -> LazyOptional.of(() -> val)).orElse(LazyOptional.empty())); - ComputerCraftAPI.registerPeripheralProvider((world, pos, side) -> world.getBlockEntity(pos, BlockRegister.TARGET_BLOCK_ENTITY.get()).map(be -> be.getPeripheral(side)).map(val -> LazyOptional.of(() -> val)).orElse(LazyOptional.empty())); - ComputerCraftAPI.registerPeripheralProvider((world, pos, side) -> world.getBlockEntity(pos,BlockRegister.REDROUTER_BLOCK_ENTITY.get()).map(be -> be.getPeripheral(side)).map(val -> LazyOptional.of(() -> val)).orElse(LazyOptional.empty())); - ComputerCraftAPI.registerPeripheralProvider((world, pos, side) -> world.getBlockEntity(pos,BlockRegister.SCROLLER_BLOCK_ENTITY.get()).map(be -> be.getPeripheral(side)).map(val -> LazyOptional.of(() -> val)).orElse(LazyOptional.empty())); - ComputerCraftAPI.registerPeripheralProvider(peripheralProvider); + AllDisplayBehaviours.assignBlockEntity(AllDisplayBehaviours.register(new ResourceLocation(MOD_ID, "source_block_display_source"), new SourceBlockDisplaySource()), CCCRegister.SOURCE_BLOCK_ENTITY.get()); + AllDisplayBehaviours.assignBlockEntity(AllDisplayBehaviours.register(new ResourceLocation(MOD_ID, "target_block_display_target"), new TargetBlockDisplayTarget()), CCCRegister.TARGET_BLOCK_ENTITY.get()); + + ComputerCraftAPI.registerPeripheralProvider(new PeripheralProvider()); }); } + @SubscribeEvent + public static void registerRenderers(EntityRenderersEvent.RegisterRenderers event) { + event.registerBlockEntityRenderer(CCCRegister.REDROUTER_BLOCK_ENTITY.get(), RedRouterBlockEntityRenderer::new); + event.registerBlockEntityRenderer(CCCRegister.ANIMATRONIC_BLOCK_ENTITY.get(), AnimatronicBlockEntityRenderer::new); + event.registerEntityRenderer(CCCRegister.ANIMATRONIC_ENTITY.get(), AnimatronicRenderer::new); + } + private void clientSetup(final FMLClientSetupEvent event) { - ItemBlockRenderTypes.setRenderLayer(BlockRegister.REDROUTER_BLOCK.get(), RenderType.translucent()); - ItemBlockRenderTypes.setRenderLayer(BlockRegister.SCROLLER_BLOCK.get(), RenderType.translucent()); + ItemBlockRenderTypes.setRenderLayer(CCCRegister.SCROLLER_BLOCK.get(), RenderType.translucent()); + } + + @SubscribeEvent + public static void registerLayerDefinitions(EntityRenderersEvent.RegisterLayerDefinitions event) { + event.registerLayerDefinition(AnimatronicModel.LAYER_LOCATION, AnimatronicModel::createBodyLayer); } } diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/BlockRegister.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCRegister.java similarity index 53% rename from forge/src/main/java/cc/tweaked_programs/cccbridge/BlockRegister.java rename to forge/src/main/java/cc/tweaked_programs/cccbridge/CCCRegister.java index 1a61956..7c2fba0 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/BlockRegister.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCRegister.java @@ -1,13 +1,18 @@ package cc.tweaked_programs.cccbridge; -import cc.tweaked_programs.cccbridge.block.RedRouterBlock; -import cc.tweaked_programs.cccbridge.block.ScrollerBlock; -import cc.tweaked_programs.cccbridge.block.SourceBlock; -import cc.tweaked_programs.cccbridge.block.TargetBlock; -import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; -import cc.tweaked_programs.cccbridge.blockEntity.ScrollerBlockEntity; -import cc.tweaked_programs.cccbridge.blockEntity.SourceBlockEntity; -import cc.tweaked_programs.cccbridge.blockEntity.TargetBlockEntity; +import cc.tweaked_programs.cccbridge.block.*; +import cc.tweaked_programs.cccbridge.blockEntity.*; +import cc.tweaked_programs.cccbridge.entity.animatronic.AnimatronicEntity; +import com.mojang.datafixers.types.Type; +import net.minecraft.Util; +import net.minecraft.core.particles.ParticleType; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.util.datafix.fixes.References; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobCategory; +import net.minecraft.world.entity.decoration.Motive; +import net.minecraft.world.entity.decoration.Painting; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; @@ -18,31 +23,47 @@ import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; -public class BlockRegister { +public class CCCRegister { private static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, CCCBridge.MOD_ID); + private static final DeferredRegister PAINTINGS = DeferredRegister.create(ForgeRegistries.PAINTING_TYPES, CCCBridge.MOD_ID); + private static final DeferredRegister SOUNDS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, CCCBridge.MOD_ID); private static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITIES, CCCBridge.MOD_ID); private static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, CCCBridge.MOD_ID); + public static final DeferredRegister> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, CCCBridge.MOD_ID); public static final RegistryObject SOURCE_BLOCK = BLOCKS.register("source_block", SourceBlock::new); public static final RegistryObject TARGET_BLOCK = BLOCKS.register("target_block", TargetBlock::new); public static final RegistryObject REDROUTER_BLOCK = BLOCKS.register("redrouter_block", RedRouterBlock::new); public static final RegistryObject SCROLLER_BLOCK = BLOCKS.register("scroller_block", ScrollerBlock::new); + public static final RegistryObject ANIMATRONIC_BLOCK = BLOCKS.register("animatronic_block", AnimatronicBlock::new); - public static final RegistryObject> SOURCE_BLOCK_ENTITY = BLOCK_ENTITIES.register("source_block_entity", () -> BlockEntityType.Builder.of(SourceBlockEntity::new, SOURCE_BLOCK.get()).build(null)); - public static final RegistryObject> TARGET_BLOCK_ENTITY = BLOCK_ENTITIES.register("target_block_entity", () -> BlockEntityType.Builder.of(TargetBlockEntity::new, TARGET_BLOCK.get()).build(null)); - public static final RegistryObject> REDROUTER_BLOCK_ENTITY = BLOCK_ENTITIES.register("redrouter_block_entity", () -> BlockEntityType.Builder.of(RedRouterBlockEntity::new, REDROUTER_BLOCK.get()).build(null)); - public static final RegistryObject> SCROLLER_BLOCK_ENTITY = BLOCK_ENTITIES.register("scroller_block_entity", () -> BlockEntityType.Builder.of(ScrollerBlockEntity::new, SCROLLER_BLOCK.get()).build(null)); + private static Type getType(String key) { + return Util.fetchChoiceType(References.BLOCK_ENTITY, key); + } + + public static final RegistryObject> SOURCE_BLOCK_ENTITY = BLOCK_ENTITIES.register("source_block_entity", () -> BlockEntityType.Builder.of(SourceBlockEntity::new, SOURCE_BLOCK.get()).build(getType("source_block"))); + public static final RegistryObject> TARGET_BLOCK_ENTITY = BLOCK_ENTITIES.register("target_block_entity", () -> BlockEntityType.Builder.of(TargetBlockEntity::new, TARGET_BLOCK.get()).build(getType("target_block"))); + public static final RegistryObject> REDROUTER_BLOCK_ENTITY = BLOCK_ENTITIES.register("redrouter_block_entity", () -> BlockEntityType.Builder.of(RedRouterBlockEntity::new, REDROUTER_BLOCK.get()).build(getType("redrouter_block"))); + public static final RegistryObject> SCROLLER_BLOCK_ENTITY = BLOCK_ENTITIES.register("scroller_block_entity", () -> BlockEntityType.Builder.of(ScrollerBlockEntity::new, SCROLLER_BLOCK.get()).build(getType("scroller_block"))); + public static final RegistryObject> ANIMATRONIC_BLOCK_ENTITY = BLOCK_ENTITIES.register("animatronic_block_entity", () -> BlockEntityType.Builder.of(AnimatronicBlockEntity::new, ANIMATRONIC_BLOCK.get()).build(getType("animatronic_block"))); + + public static final RegistryObject> ANIMATRONIC_ENTITY = ENTITIES.register("animatronic", () -> EntityType.Builder.of(AnimatronicEntity::new, MobCategory.MISC).sized(0.6F, 1.8F).build(new ResourceLocation(CCCBridge.MOD_ID, "animatronic").toString())); public static void register() { BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); BLOCK_ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus()); + ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus()); ITEMS.register("source_block", () -> new BlockItem(SOURCE_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_REDSTONE))); ITEMS.register("target_block", () -> new BlockItem(TARGET_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_REDSTONE))); ITEMS.register("redrouter_block", () -> new BlockItem(REDROUTER_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_REDSTONE))); ITEMS.register("scroller_block", () -> new BlockItem(SCROLLER_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_REDSTONE))); + ITEMS.register("animatronic_block", () -> new BlockItem(ANIMATRONIC_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_REDSTONE))); ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); - //CCCSoundEvents.init(); + PAINTINGS.register("funny_redrouters", () -> new Motive(32,16)); + PAINTINGS.register(FMLJavaModLoadingContext.get().getModEventBus()); + + CCCSoundEvents.init(SOUNDS); } } diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCSoundEvents.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCSoundEvents.java index 28dbfe9..ef42177 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCSoundEvents.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/CCCSoundEvents.java @@ -2,6 +2,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; +import net.minecraftforge.registries.DeferredRegister; import java.util.HashMap; import java.util.Map; @@ -20,8 +21,8 @@ public static SoundEvent create(String path) { return sound; } - public static void init() { - //for (ResourceLocation id : entries.keySet()) - //Registry.register(Registry.SOUND_EVENT, id, entries.get(id)); + public static void init(DeferredRegister SOUNDS) { + for (ResourceLocation id : entries.keySet()) + SOUNDS.register(id.getPath(), () -> entries.get(id)); } } diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/Misc.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/Misc.java new file mode 100644 index 0000000..260da28 --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/Misc.java @@ -0,0 +1,110 @@ +package cc.tweaked_programs.cccbridge; + +import net.minecraft.client.renderer.LightTexture; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.network.chat.TextComponent; + +import java.util.Random; + +public class Misc { + private static final char[] charsetMC = { + // Lower CP437 characters + 0x0020, 0x263A, 0x263B, 0x2665, 0x2666, 0x2663, 0x2660, 0x25CF, 0x25CB, 0x0020, 0x0020, 0x2642, 0x2640, 0x0020, 0x266A, 0x266C, + 0x25B6, 0x25C0, 0x2195, 0x203C, 0x00B6, 0x2591, 0x25AC, 0x21A8, 0x2B06, 0x2B07, 0x27A1, 0x2B05, 0x221F, 0x29FA, 0x25B2, 0x25BC, + // ASCII characters + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, + 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, + 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x2592, + // Drawing chars + 0x2800, 0x2801, 0x2808, 0x2809, 0x2802, 0x2803, 0x280A, 0x280B, 0x2810, 0x2811, 0x2818, 0x2819, 0x2812, 0x2813, 0x281A, 0x281B, + 0x2804, 0x2805, 0x280C, 0x280D, 0x2806, 0x2807, 0x280E, 0x280F, 0x2814, 0x2815, 0x281C, 0x281D, 0x2816, 0x2817, 0x281E, 0x281F, + // ISO-8859-1 characters + 0x2593, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x2588, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF + }; + + public static MutableComponent toMCTxt(String line) { + StringBuilder mcTxt = new StringBuilder(); + + for (char c : line.toCharArray()) { + if (c > 255) + mcTxt.append('?'); + else if (c == 223) // ß + mcTxt.append((char)0x1E9E); + else + mcTxt.append(charsetMC[c]); + } + + return new TextComponent("").append(mcTxt.toString()); + } + + public static String toCCTxt(String line) { + StringBuilder ccTxt = new StringBuilder(); + + for (char c : line.toCharArray()) { + char index = findCharIndex(c); + + ccTxt.append((index > 255) ? '?' : index); + } + + return ccTxt.toString(); + } + + private static char findCharIndex(char c) { + if (c == ' ') // Because we replace some non-printable chars with a space, we have to add this if-clause here. + return c; + + for (int i=0; i getPeripheral(@NotNull Level world, @NotNull BlockPos pos, @NotNull Direction side) { - if (world.getBlockEntity(pos) instanceof StationTileEntity) { - return LazyOptional.of(() -> new TrainPeripheral(pos, world)); - } else if (world.getBlockEntity(pos) instanceof SpeedControllerTileEntity) { - return LazyOptional.of(() -> new SpeedControllerPeripheral(pos, world)); + BlockEntity blockEntity = world.getBlockEntity(pos); + + if (blockEntity instanceof PeripheralBlockEntity peripheralBlock) { + IPeripheral peripheral = peripheralBlock.getPeripheral(side); + + if (peripheral != null) + return LazyOptional.of(() -> peripheral); } return LazyOptional.empty(); diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/behaviour/LuaScrollValueBehaviour.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/behaviour/LuaScrollValueBehaviour.java new file mode 100644 index 0000000..5d98ad1 --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/behaviour/LuaScrollValueBehaviour.java @@ -0,0 +1,93 @@ +package cc.tweaked_programs.cccbridge.behaviour; + +import cc.tweaked_programs.cccbridge.blockEntity.ScrollerBlockEntity; +import com.google.common.collect.ImmutableList; +import com.simibubi.create.foundation.blockEntity.behaviour.*; +import com.simibubi.create.foundation.blockEntity.behaviour.scrollValue.ScrollValueBehaviour; +import com.simibubi.create.foundation.utility.Components; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.network.chat.TextComponent; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.phys.BlockHitResult; + +import java.util.List; + +public class LuaScrollValueBehaviour extends ScrollValueBehaviour { + private boolean hasMinus; + + public LuaScrollValueBehaviour(ScrollerBlockEntity be, ValueBoxTransform slot) { + super(new TranslatableComponent("block.cccbridge.scroller_block"), be, slot); + + withCallback(i -> be.fireUpdateValueEvent()); + onlyActiveWhen(() -> (be.getLevel() != null && !(be.getLevel().getBlockState(be.getBlockPos()).getValue(BlockStateProperties.LOCKED)))); + value = 0; + hasMinus = false; + between(-15,15); + } + + @Override + public void write(CompoundTag nbt, boolean clientPacket) { + nbt.putInt("ScrollValue", value); + nbt.putBoolean("ScrollMinus", hasMinus); + nbt.putInt("ScrollLimit", max); + super.write(nbt, clientPacket); + } + + @Override + public void read(CompoundTag nbt, boolean clientPacket) { + value = nbt.getInt("ScrollValue"); + hasMinus = nbt.getBoolean("ScrollMinus"); + int limit = nbt.getInt("ScrollLimit"); + between(-limit, limit); + super.read(nbt, clientPacket); + } + + public void between(int limit) { + between(-limit, limit); + blockEntity.setChanged(); + blockEntity.sendData(); + } + + public void setHasMinus(boolean state) { + hasMinus = state; + blockEntity.setChanged(); + blockEntity.sendData(); + } + + public int getMax() { + return max; + } + + public boolean hasMinus() { + return hasMinus; + } + + @Override + public ValueSettingsBoard createBoard(Player player, BlockHitResult hitResult) { + List rows; + if (hasMinus) + rows = ImmutableList.of( + Components.translatable("cccbridge.general.unit.scroller.negative"), + Components.translatable("cccbridge.general.unit.scroller.positive") + ); + else + rows = ImmutableList.of( + Components.translatable("cccbridge.general.unit.scroller") + ); + + return new ValueSettingsBoard(label, max, 5, rows, + new ValueSettingsFormatter(ValueSettingsBehaviour.ValueSettings::format)); + } + + @Override + public void setValueSettings(Player player, ValueSettingsBehaviour.ValueSettings valueSetting, boolean ctrlDown) { + if (valueSetting.equals(getValueSettings())) + return; + setValue(hasMinus && valueSetting.row() == 0 ? -valueSetting.value() : valueSetting.value()); + playFeedbackSound(this); + } +} diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/block/AnimatronicBlock.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/AnimatronicBlock.java new file mode 100644 index 0000000..e53c022 --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/AnimatronicBlock.java @@ -0,0 +1,53 @@ +package cc.tweaked_programs.cccbridge.block; + +import cc.tweaked_programs.cccbridge.blockEntity.AnimatronicBlockEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.phys.shapes.BooleanOp; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class AnimatronicBlock extends Block implements EntityBlock { + public AnimatronicBlock() { + super(Properties.of(Material.METAL).strength(1.3f).sound(SoundType.CHAIN)); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { + return new AnimatronicBlockEntity(pos, state); + } + + @Override + public @NotNull VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter view, @NotNull BlockPos pos, @NotNull CollisionContext ctx) { + return Shapes.join(Block.box(7.5, 2, 7.5, 8.5, 16, 8.5), Block.box(2, 0, 2, 14, 2, 14), BooleanOp.OR); + } + + @Override + public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) { + BlockEntity blockentity = level.getBlockEntity(pos); + if (!(blockentity instanceof AnimatronicBlockEntity animatronicBlockEntity)) + return; + + float rotation = (float) Mth.floor((Mth.wrapDegrees(placer.yRotO) + 22.5F) / 45.0F) * 45.0F; + animatronicBlockEntity.forceBodyPose(0F, rotation, 0F); + animatronicBlockEntity.setBodyPose(15F, rotation, 0F); + animatronicBlockEntity.setHeadPose(20F, 0F, 0F); + animatronicBlockEntity.setRightArmPose(-15F, 0F, 0F); + animatronicBlockEntity.setLeftArmPose(-15F, 0F, 0F); + animatronicBlockEntity.setChanged(); + } +} diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/block/RedRouterBlock.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/RedRouterBlock.java index 646bbe7..6c35009 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/block/RedRouterBlock.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/RedRouterBlock.java @@ -1,8 +1,9 @@ package cc.tweaked_programs.cccbridge.block; -import cc.tweaked_programs.cccbridge.BlockRegister; +import cc.tweaked_programs.cccbridge.CCCRegister; +import cc.tweaked_programs.cccbridge.Misc; import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; -import com.simibubi.create.content.contraptions.wrench.IWrenchable; +import com.simibubi.create.content.equipment.wrench.IWrenchable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.InteractionResult; @@ -20,29 +21,51 @@ 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.IntegerProperty; import net.minecraft.world.level.material.Material; +import org.jetbrains.annotations.NotNull; public class RedRouterBlock extends HorizontalDirectionalBlock implements EntityBlock, IWrenchable { + public static final IntegerProperty FACE = IntegerProperty.create("face", 0, 16); + public RedRouterBlock() { - super(Properties.of(Material.STONE).strength(1.3f).sound(SoundType.STONE)); - registerDefaultState(this.stateDefinition.any().setValue(BlockStateProperties.HORIZONTAL_FACING, Direction.NORTH)); + super(Properties.of(Material.STONE).strength(1.3f).sound(SoundType.STONE).noOcclusion()); + registerDefaultState(this.stateDefinition.any() + .setValue(BlockStateProperties.HORIZONTAL_FACING, Direction.NORTH) + .setValue(FACE, 0) + ); } @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { - stateManager.add(BlockStateProperties.HORIZONTAL_FACING); + stateManager + .add(BlockStateProperties.HORIZONTAL_FACING) + .add(FACE); } @Override - public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { + public void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean pIsMoving) { + if (!level.isClientSide) { + BlockEntity be = level.getBlockEntity(pos); + if (!(be instanceof RedRouterBlockEntity rbe)) + return; + RedRouterBlockEntity.updateInputs(level, pos, rbe); + rbe.setChanged(); + } + } + + @Override + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new RedRouterBlockEntity(pos, state); } - public boolean isSignalSource(BlockState state) { + @Override + public boolean isSignalSource(@NotNull BlockState state) { return true; } - public int getSignal(BlockState state, BlockGetter world, BlockPos pos, Direction dir) { + @Override + public int getSignal(@NotNull BlockState state, BlockGetter world, @NotNull BlockPos pos, @NotNull Direction dir) { BlockEntity block = world.getBlockEntity(pos); if (!(block instanceof RedRouterBlockEntity redrouter)) return 0; @@ -72,11 +95,13 @@ public InteractionResult onWrenched(BlockState state, UseOnContext context) { @Override public BlockEntityTicker getTicker(Level world, BlockState state, BlockEntityType type) { - return BlockRegister.REDROUTER_BLOCK_ENTITY.get() == type ? RedRouterBlockEntity::tick : null; + return CCCRegister.REDROUTER_BLOCK_ENTITY.get() == type ? RedRouterBlockEntity::tick : null; } @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { - return this.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, ctx.getHorizontalDirection().getOpposite()); + return this.defaultBlockState() + .setValue(BlockStateProperties.HORIZONTAL_FACING, ctx.getHorizontalDirection().getOpposite()) + .setValue(FACE, (ctx.getLevel().isClientSide) ? 0 : Misc.randomFace()); } } \ No newline at end of file diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/block/ScrollerBlock.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/ScrollerBlock.java index 3044237..1a8e56e 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/block/ScrollerBlock.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/ScrollerBlock.java @@ -1,8 +1,7 @@ package cc.tweaked_programs.cccbridge.block; -import cc.tweaked_programs.cccbridge.BlockRegister; +import cc.tweaked_programs.cccbridge.CCCRegister; import cc.tweaked_programs.cccbridge.blockEntity.ScrollerBlockEntity; -import dan200.computercraft.shared.peripheral.modem.wired.CableModemVariant; import dan200.computercraft.shared.util.WaterloggableHelpers; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -17,13 +16,12 @@ 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.material.Fluid; import net.minecraft.world.level.material.FluidState; -import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Material; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; @@ -31,7 +29,7 @@ public class ScrollerBlock extends DirectionalBlock implements EntityBlock, SimpleWaterloggedBlock { public ScrollerBlock() { - super(BlockBehaviour.Properties.of(Material.WOOD).strength(1.0f).sound(SoundType.WOOD)); + super(BlockBehaviour.Properties.of(Material.METAL).strength(1.0f).sound(SoundType.METAL)); registerDefaultState(this.stateDefinition.any() .setValue(BlockStateProperties.FACING, Direction.NORTH) .setValue(BlockStateProperties.WATERLOGGED, false) @@ -44,40 +42,33 @@ protected void createBlockStateDefinition(StateDefinition.Builder newBox(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.125f); + case NORTH -> newBox(0.0f, 0.0f, 1 - 0.125f, 1.0f, 1.0f, 1.0f); + case WEST -> newBox(1 - 0.125f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f); + case EAST -> newBox(0.0f, 0.0f, 0.0f, 0.125f, 1.0f, 1.0f); + case UP -> newBox(0.0f, 0.0f, 0.0f, 1.0f, 0.125f, 1.0f); + case DOWN -> newBox(0.0f, 1 - 0.125f, 0.0f, 1.0f, 1.0f, 1.0f); + default -> newBox(0, 0, 0, 1, 1, 1); + }; } private static VoxelShape newBox(float p1, float p2, float p3, float p4, float p5, float p6) { @@ -85,8 +76,8 @@ private static VoxelShape newBox(float p1, float p2, float p3, float p4, float p } @Override - public BlockEntityTicker getTicker(Level world, BlockState state, BlockEntityType type) { - return BlockRegister.SCROLLER_BLOCK_ENTITY.get() == type ? ScrollerBlockEntity::tick : null; + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { + return CCCRegister.SCROLLER_BLOCK_ENTITY.get() == type ? ScrollerBlockEntity::tick : null; } @Override diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/block/SourceBlock.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/SourceBlock.java index 118f297..e36aa8f 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/block/SourceBlock.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/SourceBlock.java @@ -12,7 +12,7 @@ public class SourceBlock extends Block implements EntityBlock { public SourceBlock() { - super(Properties.of(Material.METAL).strength(2.0f).sound(SoundType.COPPER)); + super(Properties.of(Material.METAL).strength(3.0f).sound(SoundType.METAL)); } @Nullable diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/block/TargetBlock.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/TargetBlock.java index 803a11b..6e80d20 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/block/TargetBlock.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/block/TargetBlock.java @@ -13,7 +13,7 @@ public class TargetBlock extends Block implements EntityBlock { public TargetBlock() { - super(BlockBehaviour.Properties.of(Material.METAL).strength(2.0f).sound(SoundType.COPPER)); + super(BlockBehaviour.Properties.of(Material.METAL).strength(3.0f).sound(SoundType.METAL)); } @Nullable diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/AnimatronicBlockEntity.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/AnimatronicBlockEntity.java new file mode 100644 index 0000000..f143168 --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/AnimatronicBlockEntity.java @@ -0,0 +1,119 @@ +package cc.tweaked_programs.cccbridge.blockEntity; + +import cc.tweaked_programs.cccbridge.CCCRegister; +import cc.tweaked_programs.cccbridge.entity.animatronic.AnimatronicEntity; +import cc.tweaked_programs.cccbridge.peripherals.AnimatronicPeripheral; +import dan200.computercraft.api.peripheral.IPeripheral; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.Rotations; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; +import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; + +public class AnimatronicBlockEntity extends BlockEntity implements PeripheralBlockEntity { + private AnimatronicPeripheral peripheral; + private AnimatronicEntity animatronic; + + public AnimatronicBlockEntity(BlockPos pos, BlockState blockState) { + super(CCCRegister.ANIMATRONIC_BLOCK_ENTITY.get(), pos, blockState); + } + + public Rotations getRightArmPose() { + return getAnimatronic().getDestinationRightArmPose(); + } + + public Rotations getLeftArmPose() { + return getAnimatronic().getDestinationLeftArmPose(); + } + + public Rotations getBodyPose() { + return getAnimatronic().getDestinationBodyPose(); + } + + public Rotations getHeadPose() { + return getAnimatronic().getDestinationHeadPose(); + } + + public void setRightArmPose(float x, float y, float z) { + getAnimatronic().setRightArmPose(new Rotations(x, y, z)); + } + + public void setLeftArmPose(float x, float y, float z) { + getAnimatronic().setLeftArmPose(new Rotations(x, y, z)); + } + + public void setBodyPose(float x, float y, float z) { + getAnimatronic().setBodyPose(new Rotations(x, y, z)); + } + + public void setHeadPose(float x, float y, float z) { + getAnimatronic().setHeadPose(new Rotations(x, y, z)); + } + + public void forceBodyPose(float x, float y, float z) { + getAnimatronic().forceBodyPose(new Rotations(x, y, z)); + } + + @Override + @Nullable + public IPeripheral getPeripheral(@NotNull Direction side) { + if (side.getName().equals(Direction.DOWN.getName())) { + if (peripheral == null) + peripheral = new AnimatronicPeripheral(this); + return peripheral; + } + return null; + } + + public AnimatronicEntity getAnimatronic() { + if (animatronic == null) + this.animatronic = new AnimatronicEntity(CCCRegister.ANIMATRONIC_ENTITY.get(), getLevel()); + + if (getLevel() != null) + animatronic.level = getLevel(); + + return animatronic; + } + + @Override + public void load(@NotNull CompoundTag nbt) { + getAnimatronic().read(nbt); + super.load(nbt); + } + + @Override + public void saveAdditional(@NotNull CompoundTag nbt) { + getAnimatronic().add(nbt); + super.saveAdditional(nbt); + } + + @Override + public void setChanged() { + super.setChanged(); + if (level != null && this.hasLevel() && !level.isClientSide) + level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), Block.UPDATE_ALL); + } + @Nullable + @Override + public Packet getUpdatePacket() { + return ClientboundBlockEntityDataPacket.create(this); + } + + @Override + public @NotNull CompoundTag getUpdateTag() { + return saveWithoutMetadata(); + } + + public void setFace(String face) { + getAnimatronic().setFace(face); + } +} diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/PeripheralBlockEntity.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/PeripheralBlockEntity.java new file mode 100644 index 0000000..1fd0b76 --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/PeripheralBlockEntity.java @@ -0,0 +1,23 @@ +package cc.tweaked_programs.cccbridge.blockEntity; + +import dan200.computercraft.api.peripheral.IPeripheral; +import net.minecraft.core.Direction; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * This interface is used to give TileEntities the ability to provide its Peripheral. + * By implementing this, it can be made sure that the object has this ability for sure. + * + * @version 1.0 + */ +public interface PeripheralBlockEntity { + /** + * Returns a peripheral. Can be null, if the TileEntity rejects the request. + * + * @param side From which side is the block called? + * @return null or Peripheral for the TileEntity. + */ + @Nullable + IPeripheral getPeripheral(@NotNull Direction side); +} diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/RedRouterBlockEntity.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/RedRouterBlockEntity.java index 85d68f8..9a46025 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/RedRouterBlockEntity.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/RedRouterBlockEntity.java @@ -1,7 +1,7 @@ package cc.tweaked_programs.cccbridge.blockEntity; -import cc.tweaked_programs.cccbridge.BlockRegister; -import cc.tweaked_programs.cccbridge.CCCBridge; +import cc.tweaked_programs.cccbridge.CCCRegister; +import cc.tweaked_programs.cccbridge.block.RedRouterBlock; import cc.tweaked_programs.cccbridge.peripherals.RedRouterBlockPeripheral; import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.core.BlockPos; @@ -14,20 +14,23 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.Map; +import java.util.Objects; -public class RedRouterBlockEntity extends BlockEntity { +public class RedRouterBlockEntity extends BlockEntity implements PeripheralBlockEntity { private final HashMap outputDir = new HashMap<>(); private final HashMap inputDir = new HashMap<>(); private boolean blockupdate = false; + private boolean newInputs = false; private RedRouterBlockPeripheral peripheral; private Direction facing; public RedRouterBlockEntity(BlockPos pos, BlockState state) { - super(BlockRegister.REDROUTER_BLOCK_ENTITY.get(), pos, state); + super(CCCRegister.REDROUTER_BLOCK_ENTITY.get(), pos, state); facing = state.getValue(BlockStateProperties.HORIZONTAL_FACING); outputDir.put("up", 0); outputDir.put("down", 0); @@ -46,26 +49,31 @@ public RedRouterBlockEntity(BlockPos pos, BlockState state) { public static void tick(Level world, BlockPos blockPos, BlockState state, BlockEntity be) { if (!(be instanceof RedRouterBlockEntity redrouter)) return; + if (state.getValue(BlockStateProperties.HORIZONTAL_FACING) != redrouter.facing) { redrouter.blockupdate = true; - //redrouter.facing = state.getValue(BlockStateProperties.HORIZONTAL_FACING); + redrouter.facing = state.getValue(BlockStateProperties.HORIZONTAL_FACING); } if (redrouter.blockupdate) { - world.updateNeighborsAt(be.getBlockPos(), world.getBlockState(be.getBlockPos()) - .getBlock()); + world.updateNeighborsAt(be.getBlockPos(), world.getBlockState(be.getBlockPos()).getBlock()); redrouter.blockupdate = false; } + updateInputs(world, blockPos, redrouter); - updateInputs(world, blockPos, redrouter); + if (redrouter.newInputs && redrouter.peripheral != null) { + redrouter.peripheral.sendEvent(RedRouterBlockPeripheral.REDSTONE_EVENT); + redrouter.newInputs = false; + } } - private static void updateInputs(Level world, BlockPos blockPos, RedRouterBlockEntity redrouter) { + public static void updateInputs(Level world, BlockPos blockPos, RedRouterBlockEntity redrouter) { for (Map.Entry entry : redrouter.inputDir.entrySet()) { String side = entry.getKey(); Direction dir = Direction.byName(side).getOpposite(); BlockPos offsetPos = blockPos.relative(dir); BlockState block = world.getBlockState(offsetPos); + int power = block.getBlock().getSignal(block, world, offsetPos, dir); redrouter.inputDir.put(side, power); } @@ -102,7 +110,7 @@ public void setPower(String side, int power) { } @Override - public void load(CompoundTag nbt) { + public void load(@NotNull CompoundTag nbt) { super.load(nbt); for (Map.Entry entry : outputDir.entrySet()) { String side = entry.getKey(); @@ -111,7 +119,7 @@ public void load(CompoundTag nbt) { } @Override - public void saveAdditional(CompoundTag nbt) { + public void saveAdditional(@NotNull CompoundTag nbt) { for (Map.Entry entry : outputDir.entrySet()) nbt.putInt(entry.getKey(), entry.getValue()); super.saveAdditional(nbt); @@ -130,13 +138,13 @@ public Packet getUpdatePacket() { } @Override - public CompoundTag getUpdateTag() { + public @NotNull CompoundTag getUpdateTag() { return saveWithoutMetadata(); } - public IPeripheral getPeripheral(Direction side) { + public IPeripheral getPeripheral(@NotNull Direction side) { if (peripheral == null) peripheral = new RedRouterBlockPeripheral(this); return peripheral; } -} +} \ No newline at end of file diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/ScrollerBlockEntity.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/ScrollerBlockEntity.java index 106ab22..5b91347 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/ScrollerBlockEntity.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/ScrollerBlockEntity.java @@ -1,16 +1,14 @@ package cc.tweaked_programs.cccbridge.blockEntity; -import cc.tweaked_programs.cccbridge.BlockRegister; +import cc.tweaked_programs.cccbridge.CCCRegister; import cc.tweaked_programs.cccbridge.CCCSoundEvents; +import cc.tweaked_programs.cccbridge.behaviour.LuaScrollValueBehaviour; import cc.tweaked_programs.cccbridge.peripherals.ScrollerBlockPeripheral; import com.simibubi.create.AllSoundEvents; -import com.simibubi.create.foundation.tileEntity.SmartTileEntity; -import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; -import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; -import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; +import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; +import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour; +import com.simibubi.create.foundation.blockEntity.behaviour.ValueBoxTransform; import com.simibubi.create.foundation.utility.VecHelper; -import net.minecraft.network.chat.TranslatableComponent; -import net.minecraft.world.phys.Vec3; import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -19,39 +17,45 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.Nullable; import java.util.List; -public class ScrollerBlockEntity extends SmartTileEntity { + +public class ScrollerBlockEntity extends SmartBlockEntity implements PeripheralBlockEntity { private ScrollerBlockPeripheral peripheral; private boolean locked = false; private boolean updateLock = false; private boolean playTickSound = false; + private LuaScrollValueBehaviour scroller; public ScrollerBlockEntity(BlockPos pos, BlockState state) { - super(BlockRegister.SCROLLER_BLOCK_ENTITY.get(), pos, state); + super(CCCRegister.SCROLLER_BLOCK_ENTITY.get(), pos, state); } - @Nullable - public IPeripheral getPeripheral(Direction side) { - if (side == this.getBlockState().getValue(BlockStateProperties.FACING).getOpposite()) { + public IPeripheral getPeripheral(@Nullable Direction side) { + if (side == this.getBlockState().getValue(BlockStateProperties.FACING).getOpposite() || side == null) { if (peripheral == null) - peripheral = new ScrollerBlockPeripheral(this, this.getLevel()); + peripheral = new ScrollerBlockPeripheral(this); return peripheral; } return null; } public void setLock(boolean state) { locked = state; updateLock = true; } - public void playTickSound() { playTickSound = true; } - @Nullable - public ScrollValueBehaviour getBehaviour() { - TileEntityBehaviour behaviour = getBehaviour(ScrollValueBehaviour.TYPE); - if (behaviour instanceof ScrollValueBehaviour scrollValueBehaviour) - return scrollValueBehaviour; - return null; + public int getValue() { + return scroller.getValue(); + } + + public void setValue(int value) { + scroller.setValue(value); + } + + public void fireUpdateValueEvent() { + if (peripheral != null) + peripheral.sendEvent("scroller_changed", scroller.getValue()); } public static void tick(Level world, BlockPos blockPos, BlockState state, BlockEntity be) { @@ -79,44 +83,41 @@ public static void tick(Level world, BlockPos blockPos, BlockState state, BlockE 1.5f); scroller.playTickSound = false; } - - scroller.tick(); } @Override - public void addBehaviours(List behaviours) { - ScrollValueBehaviour scroller = new ScrollValueBehaviour(this.getBlockState().getBlock().getName(), this, new ControllerValueBoxTransform()) - .between(-150, 150) - .moveText(new Vec3(9, 0, 10)) - .withUnit(i -> new TranslatableComponent("cccbridge.general.unit.scroller")) - .withCallback(i -> { if (this.peripheral != null) peripheral.newValue(i); }) - .onlyActiveWhen(() -> !(this.getLevel().getBlockState(this.getBlockPos()).getValue(BlockStateProperties.LOCKED))) - .withStepFunction(context -> context.shift ? 1 : 10) - .withFormatter(i -> { - StringBuilder number = new StringBuilder(String.valueOf(i)); - if (i <= -10 || i >= 10) - number.insert(number.length()-1,'.'); - else - number.insert( (i>=0) ? 0 : 1, "0."); - return number.toString(); - }); - scroller.value = 0; + public void addBehaviours(List behaviours) { + if (scroller == null) { + scroller = new LuaScrollValueBehaviour(this, new ControllerValueBoxTransform()); + } behaviours.add(scroller); } + public int getLimit() { + return scroller.getMax(); + } + + public void setLimit(int limit) { + scroller.between(limit); + } + + public boolean hasMinus() { + return scroller.hasMinus(); + } + + public void toggleMinusSpectrum(boolean state) { + scroller.setHasMinus(state); + } + private static class ControllerValueBoxTransform extends ValueBoxTransform.Sided { @Override protected Vec3 getSouthLocation() { - return VecHelper.voxelSpace(8, 8, 0.5); + return VecHelper.voxelSpace(8D, 8D, 0.01D); } @Override protected boolean isSideActive(BlockState state, Direction direction) { return state.getValue(BlockStateProperties.FACING) == direction; } - @Override - protected float getScale() { - return 0.5f; - } } } diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/SourceBlockEntity.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/SourceBlockEntity.java index 584ea42..69b4d62 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/SourceBlockEntity.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/SourceBlockEntity.java @@ -1,37 +1,27 @@ package cc.tweaked_programs.cccbridge.blockEntity; -import cc.tweaked_programs.cccbridge.BlockRegister; +import cc.tweaked_programs.cccbridge.CCCRegister; import cc.tweaked_programs.cccbridge.peripherals.SourceBlockPeripheral; import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - -public class SourceBlockEntity extends BlockEntity { +public class SourceBlockEntity extends BlockEntity implements PeripheralBlockEntity { private SourceBlockPeripheral peripheral; public SourceBlockEntity(BlockPos pos, BlockState state) { - super(BlockRegister.SOURCE_BLOCK_ENTITY.get(), pos, state); + super(CCCRegister.SOURCE_BLOCK_ENTITY.get(), pos, state); } - public IPeripheral getPeripheral(@NotNull Direction side) { + public IPeripheral getPeripheral(@Nullable Direction side) { if (peripheral == null) peripheral = new SourceBlockPeripheral(this); return peripheral; } - @Nullable - public List getContent() { - if (peripheral == null) - return null; - return peripheral.getContent(); - } - public void setSize(int width, int height) { if (peripheral != null) peripheral.setSize(width, height); diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/TargetBlockEntity.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/TargetBlockEntity.java index a90636f..f6f9b72 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/TargetBlockEntity.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntity/TargetBlockEntity.java @@ -1,20 +1,21 @@ package cc.tweaked_programs.cccbridge.blockEntity; -import cc.tweaked_programs.cccbridge.BlockRegister; +import cc.tweaked_programs.cccbridge.CCCRegister; import cc.tweaked_programs.cccbridge.peripherals.TargetBlockPeripheral; import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; import java.util.List; -public class TargetBlockEntity extends BlockEntity { +public class TargetBlockEntity extends BlockEntity implements PeripheralBlockEntity { private TargetBlockPeripheral peripheral; public TargetBlockEntity(BlockPos pos, BlockState state) { - super(BlockRegister.TARGET_BLOCK_ENTITY.get(), pos, state); + super(CCCRegister.TARGET_BLOCK_ENTITY.get(), pos, state); } public void updateContent(int offset, List content) { @@ -22,21 +23,14 @@ public void updateContent(int offset, List content) { return; int height = getHeight(); int i = 0; - String dot = Character.toString(183); for (String line : content) { - if (i < height) { - // Replace chars that exist in C and can't be displayed in CC: - line = line.replaceAll("\u2588", "="); - line = line.replaceAll("\u2592", "-"); - line = line.replaceAll("\u2591", dot); - + if (i < height) peripheral.replaceLine(offset + i, line); - } i++; } } - public IPeripheral getPeripheral(Direction side) { + public IPeripheral getPeripheral(@NotNull Direction side) { if (peripheral == null) peripheral = new TargetBlockPeripheral(this); return peripheral; diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/AnimatronicBlockEntityRenderer.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/AnimatronicBlockEntityRenderer.java new file mode 100644 index 0000000..a309ddc --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/AnimatronicBlockEntityRenderer.java @@ -0,0 +1,32 @@ +package cc.tweaked_programs.cccbridge.blockEntityRenderer; + +import cc.tweaked_programs.cccbridge.blockEntity.AnimatronicBlockEntity; +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +import net.minecraft.client.renderer.entity.EntityRenderDispatcher; +import net.minecraft.world.entity.Entity; +import org.jetbrains.annotations.NotNull; + +public class AnimatronicBlockEntityRenderer implements BlockEntityRenderer { + private final EntityRenderDispatcher entityRenderer; + private static final float scale = 1F/32F*(32F-4F); + + public AnimatronicBlockEntityRenderer(BlockEntityRendererProvider.Context context) { + this.entityRenderer = Minecraft.getInstance().getEntityRenderDispatcher(); + } + + @Override + public void render(@NotNull AnimatronicBlockEntity blockEntity, float partialTick, @NotNull PoseStack poseStack, @NotNull MultiBufferSource bufferSource, int packedLight, int packedOverlay) { + poseStack.pushPose(); + + poseStack.scale(scale, scale, scale); + + Entity entity = blockEntity.getAnimatronic(); + this.entityRenderer.render(entity, 0.575D, 0.15D, 0.575D, 0.0F, partialTick, poseStack, bufferSource, packedLight); + + poseStack.popPose(); + } +} diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/RedRouterBlockEntityRenderer.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/RedRouterBlockEntityRenderer.java new file mode 100644 index 0000000..ecc46a1 --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/blockEntityRenderer/RedRouterBlockEntityRenderer.java @@ -0,0 +1,105 @@ +package cc.tweaked_programs.cccbridge.blockEntityRenderer; + +import cc.tweaked_programs.cccbridge.CCCBridge; +import cc.tweaked_programs.cccbridge.Misc; +import cc.tweaked_programs.cccbridge.block.RedRouterBlock; +import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import com.mojang.math.Vector3f; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.core.Direction; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.inventory.InventoryMenu; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; + +import java.util.HashMap; +import java.util.Map; + + +public class RedRouterBlockEntityRenderer implements BlockEntityRenderer { + private final Map FACE_TEXTURE; + public RedRouterBlockEntityRenderer(BlockEntityRendererProvider.Context context) { + Map faces = new HashMap<>(); + for (int i=0; i<=16; i++) { + faces.put(i, new ResourceLocation(CCCBridge.MOD_ID, "block/redrouter/face/"+i)); + } + FACE_TEXTURE = faces; + } + + @Override + public void render(RedRouterBlockEntity blockEntity, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) { + BlockState block = blockEntity.getBlockState(); + VertexConsumer buffer = bufferSource.getBuffer(RenderType.cutout()); + int flickering = Misc.flickering(); + + poseStack.pushPose(); + + // Rotate + poseStack.translate(0.5D, 0.5D, 0.5D); + if (block.hasProperty(BlockStateProperties.HORIZONTAL_FACING)) + poseStack.mulPose(Vector3f.YP.rotationDegrees(getDir(block.getValue(BlockStateProperties.HORIZONTAL_FACING)))); + poseStack.translate(-0.5D, -0.5D, -0.5D); + + int id = 0; + if (block.hasProperty(RedRouterBlock.FACE)) + id = block.getValue(RedRouterBlock.FACE); + + TextureAtlasSprite sprite = Minecraft.getInstance().getTextureAtlas(InventoryMenu.BLOCK_ATLAS).apply(getFace(id)); + int sprite_size = sprite.getWidth(); + + poseStack.translate(0D, 0D, 2D/16D-0.01); + + buffer.vertex(poseStack.last().pose(), 0 ,0 ,0) + .color(0.7F, 0.7F, 0.7F, 1.0F) + .uv(sprite.getU(sprite_size), sprite.getV(sprite_size)) + .overlayCoords(OverlayTexture.NO_OVERLAY) + .uv2(flickering) + .normal(poseStack.last().normal(), 0, 0, 0).endVertex(); + + buffer.vertex(poseStack.last().pose(), 0 ,1 ,0) + .color(0.7F, 0.7F, 0.7F, 1.0F) + .uv(sprite.getU(sprite_size), sprite.getV(0)) + .overlayCoords(OverlayTexture.NO_OVERLAY) + .uv2(flickering) + .normal(poseStack.last().normal(), 0, 0, 0).endVertex(); + + buffer.vertex(poseStack.last().pose(), 1 ,1 ,0) + .color(0.7F, 0.7F, 0.7F, 1.0F) + .uv(sprite.getU(0), sprite.getV(0)) + .overlayCoords(OverlayTexture.NO_OVERLAY) + .uv2(flickering) + .normal(poseStack.last().normal(), 0, 0, 0).endVertex(); + + buffer.vertex(poseStack.last().pose(), 1 ,0 ,0) + .color(0.7F, 0.7F, 0.7F, 1.0F) + .uv(sprite.getU(0), sprite.getV(sprite_size)) + .overlayCoords(OverlayTexture.NO_OVERLAY) + .uv2(flickering) + .normal(poseStack.last().normal(), 0, 0, 0).endVertex(); + + poseStack.popPose(); + } + + public ResourceLocation getFace(int id) { + return (id >= 1 && id <= 16) ? FACE_TEXTURE.get(id) : FACE_TEXTURE.get(0); + } + + public int getDir(Direction dir) { + return switch(dir) { + case NORTH -> 0; + case EAST -> 270; + case SOUTH -> 180; + case WEST -> 90; + default -> 0; + }; + } +} diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/display/SourceBlockDisplaySource.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/display/SourceBlockDisplaySource.java index 1899aab..2151a9c 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/display/SourceBlockDisplaySource.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/display/SourceBlockDisplaySource.java @@ -1,11 +1,12 @@ package cc.tweaked_programs.cccbridge.display; import cc.tweaked_programs.cccbridge.blockEntity.SourceBlockEntity; -import com.simibubi.create.content.logistics.block.display.DisplayLinkContext; -import com.simibubi.create.content.logistics.block.display.source.DisplaySource; -import com.simibubi.create.content.logistics.block.display.target.DisplayTargetStats; +import cc.tweaked_programs.cccbridge.Misc; +import cc.tweaked_programs.cccbridge.peripherals.SourceBlockPeripheral; +import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext; +import com.simibubi.create.content.redstone.displayLink.source.DisplaySource; +import com.simibubi.create.content.redstone.displayLink.target.DisplayTargetStats; import net.minecraft.network.chat.MutableComponent; -import net.minecraft.network.chat.TextComponent; import net.minecraft.world.level.block.entity.BlockEntity; import java.util.LinkedList; @@ -14,20 +15,28 @@ public class SourceBlockDisplaySource extends DisplaySource { @Override public List provideText(DisplayLinkContext context, DisplayTargetStats stats) { - BlockEntity block = context.getSourceTE(); + BlockEntity block = context.getSourceBlockEntity(); + if (!(block instanceof SourceBlockEntity sourceBlock)) return EMPTY; + if (!(sourceBlock.getPeripheral(null) instanceof SourceBlockPeripheral peripheral)) + return EMPTY; + sourceBlock.setSize(stats.maxColumns(), stats.maxRows()); - List data = sourceBlock.getContent(); + List data = peripheral.getContent(); if (data == null) return EMPTY; List content = new LinkedList<>(); - for (String line : data) { - content.add(new TextComponent("").append(line)); - } + for (String line : data) + content.add(Misc.toMCTxt(line)); return content; } + + @Override + public int getPassiveRefreshTicks() { + return 20; + } } \ No newline at end of file diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/display/TargetBlockDisplayTarget.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/display/TargetBlockDisplayTarget.java index 0a8530a..4df4acc 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/display/TargetBlockDisplayTarget.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/display/TargetBlockDisplayTarget.java @@ -1,9 +1,10 @@ package cc.tweaked_programs.cccbridge.display; +import cc.tweaked_programs.cccbridge.Misc; import cc.tweaked_programs.cccbridge.blockEntity.TargetBlockEntity; -import com.simibubi.create.content.logistics.block.display.DisplayLinkContext; -import com.simibubi.create.content.logistics.block.display.target.DisplayBoardTarget; -import com.simibubi.create.content.logistics.block.display.target.DisplayTargetStats; +import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext; +import com.simibubi.create.content.redstone.displayLink.target.DisplayBoardTarget; +import com.simibubi.create.content.redstone.displayLink.target.DisplayTargetStats; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.level.block.entity.BlockEntity; @@ -13,16 +14,16 @@ public class TargetBlockDisplayTarget extends DisplayBoardTarget { @Override public void acceptFlapText(int line, List> text, DisplayLinkContext context) { - BlockEntity block = context.getTargetTE(); + BlockEntity block = context.getTargetBlockEntity(); if (!(block instanceof TargetBlockEntity targetBlock)) return; List content = new LinkedList<>(); for (List c : text) { - String parts = ""; + StringBuilder parts = new StringBuilder(); for (MutableComponent sLine : c) - parts = parts + sLine.getString() + " "; - content.add(parts); + parts.append(sLine.getString()).append(" "); + content.add(Misc.toCCTxt(parts.toString())); } targetBlock.updateContent(line, content); @@ -30,7 +31,7 @@ public void acceptFlapText(int line, List> text, DisplayL @Override public DisplayTargetStats provideStats(DisplayLinkContext context) { - BlockEntity block = context.getTargetTE(); + BlockEntity block = context.getTargetBlockEntity(); if (!(block instanceof TargetBlockEntity targetBlock)) return new DisplayTargetStats(24, 1, this); diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicEntity.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicEntity.java new file mode 100644 index 0000000..c346f6c --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicEntity.java @@ -0,0 +1,242 @@ +package cc.tweaked_programs.cccbridge.entity.animatronic; + +import cc.tweaked_programs.cccbridge.Misc; +import net.minecraft.core.Rotations; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; +import net.minecraft.network.syncher.EntityDataAccessor; +import net.minecraft.network.syncher.EntityDataSerializers; +import net.minecraft.network.syncher.SynchedEntityData; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.NotNull; + +import java.util.Optional; + +public class AnimatronicEntity extends Entity { + private static final Rotations DEFAULT_HEAD_POSE = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_BODY_POSE = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_LEFT_ARM_POSE = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_RIGHT_ARM_POSE = new Rotations(0.0F, 0.0F, 0.0F); + + public static final EntityDataAccessor DATA_HEAD_POSE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.ROTATIONS); + public static final EntityDataAccessor DATA_BODY_POSE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.ROTATIONS); + public static final EntityDataAccessor DATA_LEFT_ARM_POSE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.ROTATIONS); + public static final EntityDataAccessor DATA_RIGHT_ARM_POSE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.ROTATIONS); + public static final EntityDataAccessor DATA_FACE = SynchedEntityData.defineId(AnimatronicEntity.class, EntityDataSerializers.STRING); + + + private Rotations headPose = new Rotations(DEFAULT_HEAD_POSE.getX(), DEFAULT_HEAD_POSE.getY(), DEFAULT_HEAD_POSE.getZ()); + private Rotations bodyPose = new Rotations(DEFAULT_BODY_POSE.getX(), DEFAULT_BODY_POSE.getY(), DEFAULT_BODY_POSE.getZ()); + private Rotations leftArmPose = new Rotations(DEFAULT_LEFT_ARM_POSE.getX(), DEFAULT_LEFT_ARM_POSE.getY(), DEFAULT_LEFT_ARM_POSE.getZ()); + private Rotations rightArmPose = new Rotations(DEFAULT_RIGHT_ARM_POSE.getX(), DEFAULT_RIGHT_ARM_POSE.getY(), DEFAULT_RIGHT_ARM_POSE.getZ()); + + private Rotations current_headPose = new Rotations(DEFAULT_HEAD_POSE.getX(), DEFAULT_HEAD_POSE.getY(), DEFAULT_HEAD_POSE.getZ()); + private Rotations current_bodyPose = new Rotations(DEFAULT_BODY_POSE.getX(), DEFAULT_BODY_POSE.getY(), DEFAULT_BODY_POSE.getZ()); + private Rotations current_leftArmPose = new Rotations(DEFAULT_LEFT_ARM_POSE.getX(), DEFAULT_LEFT_ARM_POSE.getY(), DEFAULT_LEFT_ARM_POSE.getZ()); + private Rotations current_rightArmPose = new Rotations(DEFAULT_RIGHT_ARM_POSE.getX(), DEFAULT_RIGHT_ARM_POSE.getY(), DEFAULT_RIGHT_ARM_POSE.getZ()); + + private Rotations start_headPose = new Rotations(DEFAULT_HEAD_POSE.getX(), DEFAULT_HEAD_POSE.getY(), DEFAULT_HEAD_POSE.getZ()); + private Rotations start_bodyPose = new Rotations(DEFAULT_BODY_POSE.getX(), DEFAULT_BODY_POSE.getY(), DEFAULT_BODY_POSE.getZ()); + private Rotations start_leftArmPose = new Rotations(DEFAULT_LEFT_ARM_POSE.getX(), DEFAULT_LEFT_ARM_POSE.getY(), DEFAULT_LEFT_ARM_POSE.getZ()); + private Rotations start_rightArmPose = new Rotations(DEFAULT_RIGHT_ARM_POSE.getX(), DEFAULT_RIGHT_ARM_POSE.getY(), DEFAULT_RIGHT_ARM_POSE.getZ()); + + private boolean isMoving; + private double step; + private long start_animation; + + private String face; + + public AnimatronicEntity(EntityType entityType, Level level) { + super(entityType, level); + isMoving = true; + step = 0.0; + face = "normal"; + start_animation = 0; + } + + public void updateCurrentPoses(float partialTicks) { + step = (level.getGameTime()-start_animation+partialTicks) * (0.0175*6); + + current_headPose = updatePose(start_headPose, getDestinationHeadPose()); + current_bodyPose = updatePose(start_bodyPose, getDestinationBodyPose()); + current_leftArmPose = updatePose(start_leftArmPose, getDestinationLeftArmPose()); + current_rightArmPose = updatePose(start_rightArmPose, getDestinationRightArmPose()); + + if (step >= 1) { + isMoving = false; + current_headPose = getDestinationHeadPose(); + current_bodyPose = getDestinationBodyPose(); + current_leftArmPose = getDestinationLeftArmPose(); + current_rightArmPose = getDestinationRightArmPose(); + } + } + + private Rotations updatePose(Rotations start, Rotations destination) { + float x = Misc.updateMovement(start.getX(), destination.getX(), step); + float y = Misc.updateMovement(start.getY(), destination.getY(), step); + float z = Misc.updateMovement(start.getZ(), destination.getZ(), step); + return new Rotations(x, y, z); + } + + public boolean isMoving() { + return isMoving; + } + + public void startAnimation() { + // onLoad level is null; skip animation + if (level == null) { + current_headPose = getDestinationHeadPose(); + current_bodyPose = getDestinationBodyPose(); + current_leftArmPose = getDestinationLeftArmPose(); + current_rightArmPose = getRightArmPose(); + return; + } + + if (!level.isClientSide) + return; + + start_animation = level.getGameTime(); + start_headPose = current_headPose; + start_bodyPose = current_bodyPose; + start_leftArmPose = current_leftArmPose; + start_rightArmPose = current_rightArmPose; + isMoving = true; + step = 0.0; + } + + public ResourceLocation getFace() { + if (this.entityData.get(DATA_FACE) == null) + return AnimatronicRenderer.TEXTURE_FACE_NORMAL; + + return switch (this.entityData.get(DATA_FACE)) { + case "normal" -> AnimatronicRenderer.TEXTURE_FACE_NORMAL; + case "happy" -> AnimatronicRenderer.TEXTURE_FACE_HAPPY; + case "question" -> AnimatronicRenderer.TEXTURE_FACE_QUESTION; + case "sad" -> AnimatronicRenderer.TEXTURE_FACE_SAD; + + default -> AnimatronicRenderer.TEXTURE_FACE_NORMAL; + }; + } + + public void setFace(String face) { + this.entityData.set(DATA_FACE, face); + } + + public void setRightArmPose(Rotations rotations) { + this.entityData.set(DATA_RIGHT_ARM_POSE, rotations); + } + + public void setLeftArmPose(Rotations rotations) { + this.entityData.set(DATA_LEFT_ARM_POSE, rotations); + } + + public void setBodyPose(Rotations rotations) { + this.entityData.set(DATA_BODY_POSE, rotations); + } + + public void forceBodyPose(Rotations rotations) { + setBodyPose(rotations); + current_bodyPose = rotations; + } + + + public void setHeadPose(Rotations rotations) { + this.entityData.set(DATA_HEAD_POSE, rotations); + + } + + public Rotations getRightArmPose() { + return current_rightArmPose; + } + + public Rotations getLeftArmPose() { + return current_leftArmPose; + } + + public Rotations getBodyPose() { + return current_bodyPose; + } + + public Rotations getHeadPose() { + return current_headPose; + } + + public Rotations getDestinationHeadPose() { + return Optional.ofNullable(this.entityData.get(DATA_HEAD_POSE)).orElse(DEFAULT_HEAD_POSE); + } + + public Rotations getDestinationBodyPose() { + return Optional.ofNullable(this.entityData.get(DATA_BODY_POSE)).orElse(DEFAULT_BODY_POSE); + } + + public Rotations getDestinationLeftArmPose() { + return Optional.ofNullable(this.entityData.get(DATA_LEFT_ARM_POSE)).orElse(DEFAULT_LEFT_ARM_POSE); + } + + public Rotations getDestinationRightArmPose() { + return Optional.ofNullable(this.entityData.get(DATA_RIGHT_ARM_POSE)).orElse(DEFAULT_RIGHT_ARM_POSE); + } + + + public void read(CompoundTag nbt) { + readAdditionalSaveData(nbt); + } + + public void add(CompoundTag nbt) { + addAdditionalSaveData(nbt); + } + + @Override + protected void readAdditionalSaveData(CompoundTag nbt) { + ListTag ltHead = nbt.getList("headPose", 5); + this.setHeadPose(ltHead.isEmpty() ? DEFAULT_HEAD_POSE : new Rotations(ltHead)); + + ListTag ltBody = nbt.getList("bodyPose", 5); + this.setBodyPose(ltBody.isEmpty() ? DEFAULT_HEAD_POSE : new Rotations(ltBody)); + + ListTag ltLeftArm = nbt.getList("leftArmPose", 5); + this.setLeftArmPose(ltLeftArm.isEmpty() ? DEFAULT_HEAD_POSE : new Rotations(ltLeftArm)); + + ListTag ltArmPose = nbt.getList("rightArmPose", 5); + this.setRightArmPose(ltArmPose.isEmpty() ? DEFAULT_HEAD_POSE : new Rotations(ltArmPose)); + + setFace(nbt.getString("face")); + + startAnimation(); + } + + @Override + protected void addAdditionalSaveData(CompoundTag nbt) { + nbt.put("headPose", getDestinationHeadPose().save()); + nbt.put("bodyPose", getDestinationBodyPose().save()); + nbt.put("leftArmPose", getDestinationLeftArmPose().save()); + nbt.put("rightArmPose", getDestinationRightArmPose().save()); + if (this.entityData.get(DATA_FACE) != null) + nbt.putString("face", this.entityData.get(DATA_FACE)); + } + + @Override + protected void defineSynchedData() { + this.entityData.define(DATA_HEAD_POSE, headPose); + this.entityData.define(DATA_BODY_POSE, bodyPose); + this.entityData.define(DATA_LEFT_ARM_POSE, leftArmPose); + this.entityData.define(DATA_RIGHT_ARM_POSE, rightArmPose); + this.entityData.define(DATA_FACE, face); + } + + @Override + public @NotNull Packet getAddEntityPacket() { + return new ClientboundAddEntityPacket(this); + } + + @Override + public void onSyncedDataUpdated(EntityDataAccessor key) { + super.onSyncedDataUpdated(key); + startAnimation(); + } +} diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicModel.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicModel.java new file mode 100644 index 0000000..2425c7f --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicModel.java @@ -0,0 +1,65 @@ +package cc.tweaked_programs.cccbridge.entity.animatronic; + +import cc.tweaked_programs.cccbridge.CCCRegister; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.EntityModel; +import net.minecraft.client.model.geom.ModelLayerLocation; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import org.jetbrains.annotations.NotNull; + +public class AnimatronicModel extends EntityModel { + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(CCCRegister.ANIMATRONIC_ENTITY.getId(), "main"); + private static final float awesomeFactor = ((float)Math.PI / 180F); + private final ModelPart root; + + public AnimatronicModel(ModelPart root) { + this.root = root.getChild("root"); + } + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create().texOffs(8, 32).addBox(-1.0F, -6.0F, -3.5F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 20).addBox(-3.0F, -4.0F, -4.5F, 6.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(26, 20).addBox(-6.0F, -2.5F, -3.0F, 12.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 10.0F, 0.0F)); + + PartDefinition head = root.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -9.0F, -5.0F, 10.0F, 10.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -6.0F, -2.5F)); + + PartDefinition rightarm = root.addOrReplaceChild("rightarm", CubeListBuilder.create().texOffs(0, 32).addBox(-1.0F, -2.0F, -1.0F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(-6.0F, -2.0F, -2.5F)); + + PartDefinition leftarm = root.addOrReplaceChild("leftarm", CubeListBuilder.create().texOffs(20, 20).addBox(-1.0F, -2.0F, -1.0F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(6.0F, -2.0F, -2.5F)); + + return LayerDefinition.create(meshdefinition, 64, 64); + } + + @Override + public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float partialTicks, float netHeadYaw, float headPitch) { + if (entity.isMoving()) + entity.updateCurrentPoses(partialTicks); + + this.root.getChild("head").xRot = entity.getHeadPose().getX() * awesomeFactor; + this.root.getChild("head").yRot = entity.getHeadPose().getY() * awesomeFactor; + this.root.getChild("head").zRot = entity.getHeadPose().getZ() * awesomeFactor; + + this.root.yRot = entity.getBodyPose().getY() * awesomeFactor; + this.root.xRot = entity.getBodyPose().getX() * awesomeFactor; + this.root.zRot = entity.getBodyPose().getZ() * awesomeFactor; + + this.root.getChild("leftarm").xRot = entity.getLeftArmPose().getX() * awesomeFactor; + this.root.getChild("leftarm").yRot = entity.getLeftArmPose().getY() * awesomeFactor; + this.root.getChild("leftarm").zRot = entity.getLeftArmPose().getZ() * awesomeFactor; + + this.root.getChild("rightarm").xRot = entity.getRightArmPose().getX() * awesomeFactor; + this.root.getChild("rightarm").yRot = entity.getRightArmPose().getY() * awesomeFactor; + this.root.getChild("rightarm").zRot = entity.getRightArmPose().getZ() * awesomeFactor; + } + + @Override + public void renderToBuffer(@NotNull PoseStack poseStack, @NotNull VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + root.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } +} \ No newline at end of file diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicRenderer.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicRenderer.java new file mode 100644 index 0000000..499f11b --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/entity/animatronic/AnimatronicRenderer.java @@ -0,0 +1,57 @@ +package cc.tweaked_programs.cccbridge.entity.animatronic; + +import cc.tweaked_programs.cccbridge.CCCBridge; +import cc.tweaked_programs.cccbridge.Misc; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.entity.EntityRenderer; +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.resources.ResourceLocation; +import org.jetbrains.annotations.NotNull; + +public class AnimatronicRenderer extends EntityRenderer { + public static final ResourceLocation TEXTURE_BODY = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/body.png"); + + public static final ResourceLocation TEXTURE_FACE_NORMAL = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_normal.png"); + public static final ResourceLocation TEXTURE_FACE_HAPPY = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_happy.png"); + public static final ResourceLocation TEXTURE_FACE_QUESTION = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_question.png"); + public static final ResourceLocation TEXTURE_FACE_SAD = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_sad.png"); + + public static final ResourceLocation TEXTURE_FACE_CURSED = new ResourceLocation(CCCBridge.MOD_ID, "textures/entity/animatronic/face_creepy.png"); + + private final AnimatronicModel model; + + public AnimatronicRenderer(EntityRendererProvider.Context context) { + super(context); + this.model = new AnimatronicModel<>(context.bakeLayer(AnimatronicModel.LAYER_LOCATION)); + } + + @Override + public @NotNull ResourceLocation getTextureLocation(@NotNull AnimatronicEntity entity) { + return TEXTURE_BODY; + } + + @Override + public void render(@NotNull AnimatronicEntity entity, float yaw, float tickDelta, PoseStack poseStack, MultiBufferSource multiBufferSource, int light) { + // Setup + poseStack.pushPose(); + poseStack.scale(-1.0F, -1.0F, 1.0F); + poseStack.translate(0.0F, -1.5F, 0.0F); + + this.model.setupAnim(entity, 0.0F, 0.0F, tickDelta, 0.0F, 0.0F); + + // Render model + VertexConsumer vertexConsumer = multiBufferSource.getBuffer(this.model.renderType(TEXTURE_BODY)); + this.model.renderToBuffer(poseStack, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + + // Eyes + vertexConsumer = multiBufferSource.getBuffer(this.model.renderType(Misc.rareCreepiness() ? TEXTURE_FACE_CURSED : entity.getFace())); + this.model.renderToBuffer(poseStack, vertexConsumer, Misc.flickering(), OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + + // Checkout + poseStack.popPose(); + super.render(entity, yaw, tickDelta, poseStack, multiBufferSource, light); + } +} \ No newline at end of file diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/AnimatronicPeripheral.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/AnimatronicPeripheral.java new file mode 100644 index 0000000..3c2c115 --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/AnimatronicPeripheral.java @@ -0,0 +1,234 @@ +package cc.tweaked_programs.cccbridge.peripherals; + +import cc.tweaked_programs.cccbridge.blockEntity.AnimatronicBlockEntity; +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.lua.LuaFunction; +import dan200.computercraft.api.lua.MethodResult; +import net.minecraft.core.Rotations; +import net.minecraft.util.Mth; + +/** + * This peripheral is used by the Animatronic. It is an electronic puppet that can be positioned however needed. + * Neat for decoration purposes! A bit rusty, however. + * + * @version 1.1 + */ +public class AnimatronicPeripheral extends TweakedPeripheral { + private float[] headRot; + private float[] bodyRot; + private float[] leftArmRot; + private float[] rightArmRot; + + public AnimatronicPeripheral(AnimatronicBlockEntity blockEntity) { + super("animatronic", blockEntity); + + headRot = new float[]{0,0,0}; + bodyRot = new float[]{0,0,0}; + leftArmRot = new float[]{0,0,0}; + rightArmRot = new float[]{0,0,0}; + } + + /** + * Changes the face of the Animatronic. + * + * @param face The new face. Must be either 'normal', 'happy', 'question' or 'sad'. + * + * @throws LuaException Whenever the given string is not one of those types. + */ + @LuaFunction + public final void setFace(String face) throws LuaException { + if (face.equals("normal") || face.equals("happy") || face.equals("question") || face.equals("sad")) { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + be.setFace(face); + be.setChanged(); + } + } else throw new LuaException("Given string must be either 'normal', 'happy', 'question' or 'sad'"); + } + + /** + * Pushes the stored rotation values to the Animatronic. + * After pushing them, the rotations get reset to 0 everywhere. + */ + @LuaFunction + public final void push() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + be.setHeadPose(headRot[0], headRot[1], headRot[2]); + be.setBodyPose(bodyRot[0], bodyRot[1], bodyRot[2]); + be.setLeftArmPose(leftArmRot[0], leftArmRot[1], leftArmRot[2]); + be.setRightArmPose(rightArmRot[0], rightArmRot[1], rightArmRot[2]); + be.setChanged(); + } + + headRot = new float[]{0,0,0}; + bodyRot = new float[]{0,0,0}; + leftArmRot = new float[]{0,0,0}; + rightArmRot = new float[]{0,0,0}; + } + + /** + * Sets the head rotation. + * Can only be set within the bounds -180° to 180° for `X`, `Y` and `Z`. + * + * @param x The X rotation. + * @param y The Y rotation. + * @param z The Z rotation. + */ + @LuaFunction + public final void setHeadRot(double x, double y, double z) { + x = Mth.clamp(x, -180D, 180D); + y = Mth.clamp(y, -180D, 180D); + z = Mth.clamp(z, -180D, 180D); + headRot = new float[]{(float)x, (float)y, (float)z}; + } + + /** + * Sets the body rotation. + * Can only be set within the bounds -180° to 180° for `Y` and `Z`; + * > Note: `X` can be set within 360°. + * + * @param x The X rotation. + * @param y The Y rotation. + * @param z The Z rotation. + */ + @LuaFunction + public final void setBodyRot(double x, double y, double z) { + x = Mth.clamp(x, -360D, 360D); + y = Mth.clamp(y, -180D, 180D); + z = Mth.clamp(z, -180D, 180D); + bodyRot = new float[]{(float)x, (float)y, (float)z}; + } + + /** + * Sets the left arm rotation. + * Can only be set within the bounds -180° to 180° for `X`, `Y` and `Z`. + * + * @param x The X rotation. + * @param y The Y rotation. + * @param z The Z rotation. + */ + @LuaFunction + public final void setLeftArmRot(double x, double y, double z) { + x = Mth.clamp(x, -180, 180); + y = Mth.clamp(y, -180, 180); + z = Mth.clamp(z, -180, 180); + leftArmRot = new float[]{(float)x, (float)y, (float)z}; + } + + /** + * Sets the right arm rotation. + * Can only be set within the bounds -180° to 180° for `X`, `Y` and `Z`. + * + * @param x The X rotation. + * @param y The Y rotation. + * @param z The Z rotation. + */ + @LuaFunction + public final void setRightArmRot(double x, double y, double z) { + x = Mth.clamp(x, -180, 180); + y = Mth.clamp(y, -180, 180); + z = Mth.clamp(z, -180, 180); + rightArmRot = new float[]{(float)x, (float)y, (float)z}; + } + + /** + * Returns the current stored head rotation. + * + * @return Head rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getStoredHeadRot() { + return MethodResult.of((double)headRot[0], (double)headRot[1], (double)headRot[2]); + } + + /** + * Returns the current stored body rotation. + * + * @return Body rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getStoredBodyRot() { + return MethodResult.of((double)bodyRot[0], (double)bodyRot[1], (double)bodyRot[2]); + } + + /** + * Returns the current stored left arm rotation. + * + * @return Left arm rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getStoredLeftArmRot() { + return MethodResult.of((double)leftArmRot[0], (double)leftArmRot[1], (double)leftArmRot[2]); + } + + /** + * Returns the current stored right arm rotation. + * + * @return Right arm rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getStoredRightArmRot() { + return MethodResult.of((double)rightArmRot[0], (double)rightArmRot[1], (double)rightArmRot[2]); + } + + /** + * Returns the head rotation of the Animatronic. + * + * @return Head rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getAppliedHeadRot() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + Rotations rot = be.getHeadPose(); + return MethodResult.of((double)rot.getX(), (double)rot.getY(), (double)rot.getZ()); + } + return MethodResult.of(0F, 0F, 0F); + } + + /** + * Returns the body rotation of the Animatronic. + * + * @return Body rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getAppliedBodyRot() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + Rotations rot = be.getBodyPose(); + return MethodResult.of((double)rot.getX(), (double)rot.getY(), (double)rot.getZ()); + } + return MethodResult.of(0F, 0F, 0F); + } + + /** + * Returns the left arm rotation of the Animatronic. + * + * @return Left arm rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getAppliedLeftArmRot() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + Rotations rot = be.getLeftArmPose(); + return MethodResult.of((double)rot.getX(), (double)rot.getY(), (double)rot.getZ()); + } + return MethodResult.of(0F, 0F, 0F); + } + + /** + * Returns the right arm rotation of the Animatronic. + * + * @return Right arm rotation: table.unpack{X, Y, Z}. + */ + @LuaFunction + public final MethodResult getAppliedRightArmRot() { + AnimatronicBlockEntity be = super.getTarget(); + if (be != null) { + Rotations rot = be.getRightArmPose(); + return MethodResult.of((double)rot.getX(), (double)rot.getY(), (double)rot.getZ()); + } + return MethodResult.of(0F, 0F, 0F); + } +} diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/RedRouterBlockPeripheral.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/RedRouterBlockPeripheral.java index 383ad38..72a5491 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/RedRouterBlockPeripheral.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/RedRouterBlockPeripheral.java @@ -3,36 +3,43 @@ import cc.tweaked_programs.cccbridge.blockEntity.RedRouterBlockEntity; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.lua.LuaFunction; -import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.core.computer.ComputerSide; import net.minecraft.core.Direction; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -public class RedRouterBlockPeripheral implements IPeripheral { - private final RedRouterBlockEntity redrouter_be; +import java.util.LinkedList; +import java.util.List; - public RedRouterBlockPeripheral(RedRouterBlockEntity redrouter_block_entity) { - this.redrouter_be = redrouter_block_entity; - } +/** + * This peripheral is used by the RedRouter. It works very similar to the Redstone API. + * + * @version 1.1 + */ +public class RedRouterBlockPeripheral extends TweakedPeripheral { + public static final String REDSTONE_EVENT = "redstone"; + private final List pcs = new LinkedList<>(); - @NotNull - @Override - public String getType() { - return "redrouter"; + public RedRouterBlockPeripheral(RedRouterBlockEntity blockentity) { + super("redrouter", blockentity); } public Direction getActualSide(ComputerSide side) { - Direction facing = redrouter_be.getFacing(); - return switch (side.getName()) { - case ("front") -> facing.getOpposite(); - case ("back") -> facing; - case ("left") -> facing.getClockWise(); - case ("right") -> facing.getCounterClockWise(); - case ("top") -> Direction.DOWN; - case ("bottom") -> Direction.UP; - default -> Direction.NORTH; - }; + RedRouterBlockEntity be = getTarget(); + + if (be != null) { + Direction facing = getTarget().getFacing(); + return switch (side.getName()) { + case ("front") -> facing.getOpposite(); + case ("back") -> facing; + case ("left") -> facing.getClockWise(); + case ("right") -> facing.getCounterClockWise(); + case ("top") -> Direction.DOWN; + case ("bottom") -> Direction.UP; + default -> Direction.NORTH; + }; + } + + return Direction.NORTH; } /** @@ -43,7 +50,9 @@ public Direction getActualSide(ComputerSide side) { */ @LuaFunction public final void setOutput(ComputerSide side, boolean on) { - redrouter_be.setPower(getActualSide(side).getName(), on ? 15 : 0); + RedRouterBlockEntity be = getTarget(); + if (be != null) + be.setPower(getActualSide(side).getName(), on ? 15 : 0); } /** @@ -55,7 +64,11 @@ public final void setOutput(ComputerSide side, boolean on) { */ @LuaFunction public final boolean getOutput(ComputerSide side) { - return redrouter_be.getPower(getActualSide(side)) > 0; + RedRouterBlockEntity be = getTarget(); + if (be != null) + return be.getPower(getActualSide(side)) > 0; + + return false; } /** @@ -66,7 +79,11 @@ public final boolean getOutput(ComputerSide side) { */ @LuaFunction public final boolean getInput(ComputerSide side) { - return redrouter_be.getRedstoneInput(getActualSide(side)) > 0; + RedRouterBlockEntity be = getTarget(); + if (be != null) + return be.getRedstoneInput(getActualSide(side)) > 0; + + return false; } /** @@ -79,7 +96,10 @@ public final boolean getInput(ComputerSide side) { @LuaFunction({"setAnalogOutput", "setAnalogueOutput"}) public final void setAnalogOutput(ComputerSide side, int value) throws LuaException { if (value < 0 || value > 15) throw new LuaException("Expected number in range 0-15"); - redrouter_be.setPower(getActualSide(side).getName(), value); + RedRouterBlockEntity be = getTarget(); + + if (be != null) + be.setPower(getActualSide(side).getName(), value); } /** @@ -91,7 +111,11 @@ public final void setAnalogOutput(ComputerSide side, int value) throws LuaExcept */ @LuaFunction({"getAnalogOutput", "getAnalogueOutput"}) public final int getAnalogOutput(ComputerSide side) { - return redrouter_be.getPower(getActualSide(side)); + RedRouterBlockEntity be = getTarget(); + if (be != null) + return be.getPower(getActualSide(side)); + + return 0; } /** @@ -102,11 +126,10 @@ public final int getAnalogOutput(ComputerSide side) { */ @LuaFunction({"getAnalogInput", "getAnalogueInput"}) public final int getAnalogInput(ComputerSide side) { - return redrouter_be.getRedstoneInput(getActualSide(side)); - } + RedRouterBlockEntity be = getTarget(); + if (be != null) + return be.getRedstoneInput(getActualSide(side)); - @Override - public boolean equals(@Nullable IPeripheral other) { - return this == other || other instanceof RedRouterBlockPeripheral redrouter && redrouter.redrouter_be == redrouter_be; + return 0; } } diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/ScrollerBlockPeripheral.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/ScrollerBlockPeripheral.java index a8f8dad..6ac0456 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/ScrollerBlockPeripheral.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/ScrollerBlockPeripheral.java @@ -1,52 +1,37 @@ package cc.tweaked_programs.cccbridge.peripherals; import cc.tweaked_programs.cccbridge.blockEntity.ScrollerBlockEntity; -import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; import dan200.computercraft.api.lua.LuaFunction; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.properties.BlockStateProperties; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import javax.annotation.Nonnull; -import java.util.LinkedList; -import java.util.List; +/** + * This peripheral is used by the Scroller Pane. It allows to interact with its valued that the player can manipulate + * (as long as this peripheral allows though, as it call lock it for outside interactions) + * + * @version 2.0 + */ +public class ScrollerBlockPeripheral extends TweakedPeripheral { -public class ScrollerBlockPeripheral implements IPeripheral { - private final ScrollerBlockEntity scroller; - private final Level level; - private final List pcs = new LinkedList<>(); - - public ScrollerBlockPeripheral(ScrollerBlockEntity block_entity, Level level) { - this.scroller = block_entity; - this.level = level; - } - - @Override - public void attach(@Nonnull IComputerAccess computer) { - pcs.add(computer); - } - - @Override - public void detach(@Nonnull IComputerAccess computer) { - pcs.removeIf(p -> (p.getID() == computer.getID())); - } - - public void newValue(int value) { - for (IComputerAccess pc : pcs) - pc.queueEvent("scroller_changed", pc.getAttachmentName(), (double)(value/10)); + public ScrollerBlockPeripheral(ScrollerBlockEntity blockentity) { + super("scroller", blockentity); } - /** * Returns whether the Scroller Pane is locked or not. * @return The state */ @LuaFunction public final boolean isLocked() { - return level.getBlockState(scroller.getBlockPos()).getValue(BlockStateProperties.LOCKED); + ScrollerBlockEntity be = getTarget(); + if (be != null) { + Level level = getTarget().getLevel(); + + if (level != null) + return level.getBlockState(be.getBlockPos()).getValue(BlockStateProperties.LOCKED); + } + + return false; } /** @@ -54,45 +39,88 @@ public final boolean isLocked() { * @param state Sate for lock */ @LuaFunction - public final void setLock(boolean state) { scroller.setLock(state); } + public final void setLock(boolean state) { + ScrollerBlockEntity be = getTarget(); + if (be != null) + be.setLock(state); + } /** - * Returns the current value of the Scroller Pane. - * @return Value (-15.0 - 15.0) + * Returns the selected value of the Scroller Pane. + * + * @return The selected value. */ @LuaFunction - public final double getValue() { - ScrollValueBehaviour scrollValueBehaviour = scroller.getBehaviour(); - if (scrollValueBehaviour == null) return 0.0f; + public final int getValue() { + ScrollerBlockEntity be = getTarget(); + if (be != null) + return be.getValue(); - return (double)scrollValueBehaviour.getValue()/10; + return 0; } /** - * Sets a new value for the Scroller Pane - * @param value The new value (Must be in between -15.0 - 15.0) + * Changes the selected value. + * @param value The new value to select. */ @LuaFunction - public final void setValue(double value) { - ScrollValueBehaviour scrollValueBehaviour = scroller.getBehaviour(); - if (scrollValueBehaviour == null) return; + public final void setValue(int value) { + ScrollerBlockEntity be = getTarget(); + if (be != null) + be.setValue(value); + } - if (value > 15) value = 15; - else if (value < -15) value = -15; + /** + * Returns the limit relative to zero. + * E.g. 15 for from 0 to 15. + * + * @return The limit. + */ + @LuaFunction + public final int getLimit() { + ScrollerBlockEntity be = getTarget(); + if (be != null) + return be.getLimit(); - scrollValueBehaviour.setValue((int)(value*10)); - scroller.playTickSound(); + return 0; } + /** + * Returns whenever the Scroller Pane has the minus spectrum enabled. + * + * @return true for when the minus spectrum is enabled, and false for the opposite. + */ + @LuaFunction + public final boolean hasMinusSpectrum() { + ScrollerBlockEntity be = getTarget(); + if (be != null) + return be.hasMinus(); - @NotNull - @Override - public String getType() { - return "scroller"; + return false; } - @Override - public boolean equals(@Nullable IPeripheral other) { - return this == other || other instanceof ScrollerBlockPeripheral s && s.scroller == scroller; + /** + * Enables or disables the minus spectrum. + * + * @param state true for enabled minus spectrum, false for the opposite. + */ + @LuaFunction + public final void toggleMinusSpectrum(boolean state) { + ScrollerBlockEntity be = getTarget(); + if (be != null) + be.toggleMinusSpectrum(state); + } + + /** + * Sets a new limit relative to zero. + * If minus spectrum enabled, the limit then gets mirrored to the minus spectrum too. + * + * @param limit The new limit. + */ + @LuaFunction + public final void setLimit(int limit) { + ScrollerBlockEntity be = getTarget(); + if (be != null) + be.setLimit(limit); } } diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SourceBlockPeripheral.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SourceBlockPeripheral.java index bbe6351..1052242 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SourceBlockPeripheral.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SourceBlockPeripheral.java @@ -11,31 +11,21 @@ import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; +import javax.xml.transform.Source; import java.util.LinkedList; import java.util.List; -public class SourceBlockPeripheral implements IPeripheral { - private final SourceBlockEntity source_block_entity; +/** + * This peripheral is used by the Source Block. It is used to give some kind of Create Display Targets data. + * The peripheral acts similar to a normal Terminal, with some implementations from the Window API and other limitations like no control over the colors. + * + * @version 1.1 + */ +public class SourceBlockPeripheral extends TweakedPeripheral { private final Terminal term = new Terminal(4, 2, false); - private final List pcs = new LinkedList<>(); - public SourceBlockPeripheral(SourceBlockEntity source_block_entity) { - this.source_block_entity = source_block_entity; - } - - @Override - public void attach(@Nonnull IComputerAccess computer) { - pcs.add(computer); - } - - @Override - public void detach(@Nonnull IComputerAccess computer) { - pcs.removeIf(p -> (p.getID() == computer.getID())); - } - - public void resize() { - for (IComputerAccess pc : pcs) - pc.queueEvent("monitor_resize", pc.getAttachmentName()); + public SourceBlockPeripheral(SourceBlockEntity blockentity) { + super("create_source", blockentity); } public void setSize(int width, int height) { @@ -43,24 +33,14 @@ public void setSize(int width, int height) { int oldH = term.getHeight(); if (!(oldW != width || oldH != height)) return; term.resize(width, height); - resize(); + super.sendEvent("monitor_resize"); } public List getContent() { List content = new LinkedList<>(); - // Replace chars that exist in CC and can't be displayed in C: - for (int i = 0; i < term.getHeight(); i++) { - String line = term.getLine(i).toString(); - for (int j = 0; j < line.length(); j++) { - char ch = line.charAt(j); - - // Printable chars in byte range - if (ch < 32 || (ch > 126 && ch < 161)) - line = line.substring(0, j) + '?' + line.substring(j + 1); - } - content.add(line); - } + for (int i = 0; i < term.getHeight(); i++) + content.add( term.getLine(i).toString()); return content; } @@ -130,7 +110,7 @@ public final String getLine(int y) throws LuaException { } /** - * Returns the current current cursor position. + * Returns the current cursor position. * * @return Object[] {posX, posY} */ @@ -148,16 +128,4 @@ public final Object[] getCursorPos() { public final Object[] getSize() { return new Object[]{term.getWidth(), term.getHeight()}; } - - - @NotNull - @Override - public String getType() { - return "create_source"; - } - - @Override - public boolean equals(@Nullable IPeripheral other) { - return this == other || other instanceof SourceBlockPeripheral source && source.source_block_entity == source_block_entity; - } } \ No newline at end of file diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SpeedControllerPeripheral.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SpeedControllerPeripheral.java deleted file mode 100644 index 683bfb9..0000000 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/SpeedControllerPeripheral.java +++ /dev/null @@ -1,71 +0,0 @@ -package cc.tweaked_programs.cccbridge.peripherals; - -import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerTileEntity; -import com.simibubi.create.foundation.config.AllConfigs; -import dan200.computercraft.api.lua.LuaException; -import dan200.computercraft.api.lua.LuaFunction; -import dan200.computercraft.api.peripheral.IPeripheral; -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.Level; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class SpeedControllerPeripheral implements IPeripheral { - private final Level level; - private final SpeedControllerTileEntity controller; - private final Integer maxSpeed = AllConfigs.SERVER.kinetics.maxRotationSpeed.get(); - - public SpeedControllerPeripheral(@NotNull BlockPos pos, Level level) { - this.level = level; - controller = (SpeedControllerTileEntity) level.getBlockEntity(pos); - } - - - @NotNull - @Override - public String getType() { - return "speed_controller"; - } - - /** - * Returns the theoretical current wanted speed. - * @return Current speed - */ - @LuaFunction - public final float getSpeed() { - return controller.getSpeed(); - } - - /** - * Changes the current speed to a new value. (must be between from server given interval) - * @param rot New wanted speed - * @throws LuaException When value is out of bounds. - */ - @LuaFunction - public final void setSpeed(int rot) throws LuaException { - /*if (rot < -maxSpeed || rot > maxSpeed) - throw new LuaException("Given rotation must be between "+-maxSpeed+" & "+maxSpeed+"!"); - - float prevSpeed = controller.getSpeed(); - controller.setSpeed(rot); - - controller.markDirty(); - controller.onSpeedChanged(prevSpeed); - controller.sendData();*/ - } - - /** - * Whenever the Speed Controller is OverStressed or not. - * @return State of being overstressed or not - */ - @LuaFunction - public final boolean isOverStressed() { - return controller.isOverStressed(); - } - - - @Override - public boolean equals(@Nullable IPeripheral iPeripheral) { - return this == iPeripheral; - } -} \ No newline at end of file diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TargetBlockPeripheral.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TargetBlockPeripheral.java index 4c84191..e6b9195 100644 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TargetBlockPeripheral.java +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TargetBlockPeripheral.java @@ -9,13 +9,16 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class TargetBlockPeripheral implements IPeripheral { - private final TargetBlockEntity target_block_entity; +/** + * This peripheral is used by the Target Block. It is used to get data from Create Display Sources. The data has to be synced by the BlockEntity. + * + * @version 1.1 + */ +public class TargetBlockPeripheral extends TweakedPeripheral { private final Terminal term = new Terminal(32, 24, false); - - public TargetBlockPeripheral(TargetBlockEntity target_block_entity) { - this.target_block_entity = target_block_entity; + public TargetBlockPeripheral(TargetBlockEntity blockentity) { + super("create_target", blockentity); } public void replaceLine(int y, String line) { @@ -30,6 +33,10 @@ public int getWidth() { return term.getWidth(); } + public int getHeight() { + return term.getHeight(); + } + /** * Sets the new width of the display. Cannot be larger than 164 chars. * @@ -42,10 +49,6 @@ public final void setWidth(int width) throws LuaException { term.resize(width, 16); } - public int getHeight() { - return term.getHeight(); - } - /** * Clears the whole screen. */ @@ -91,15 +94,4 @@ public final String getLine(int y) throws LuaException { public final Object[] getSize() { return new Object[]{term.getWidth(), term.getHeight()}; } - - @NotNull - @Override - public String getType() { - return "create_target"; - } - - @Override - public boolean equals(@Nullable IPeripheral other) { - return this == other || other instanceof TargetBlockPeripheral target && target.target_block_entity == target_block_entity; - } } \ No newline at end of file diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TrainPeripheral.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TrainPeripheral.java deleted file mode 100644 index d0d5a6b..0000000 --- a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TrainPeripheral.java +++ /dev/null @@ -1,192 +0,0 @@ -package cc.tweaked_programs.cccbridge.peripherals; - -import com.simibubi.create.Create; -import com.simibubi.create.content.logistics.trains.GraphLocation; -import com.simibubi.create.content.logistics.trains.entity.Train; -import com.simibubi.create.content.logistics.trains.management.edgePoint.station.GlobalStation; -import com.simibubi.create.content.logistics.trains.management.edgePoint.station.StationTileEntity; -import com.simibubi.create.content.logistics.trains.management.edgePoint.station.TrainEditPacket.TrainEditReturnPacket; -import com.simibubi.create.content.logistics.trains.management.schedule.Schedule; -import com.simibubi.create.foundation.networking.AllPackets; -import dan200.computercraft.api.lua.LuaFunction; -import dan200.computercraft.api.lua.MethodResult; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.network.chat.TextComponent; -import net.minecraft.world.level.Level; -import net.minecraftforge.network.PacketDistributor; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.UUID; - - -public class TrainPeripheral implements IPeripheral { - private static Schedule schedule; - private final List connectedComputers = new ArrayList<>(); - private final Level level; - private final StationTileEntity station; - - public TrainPeripheral(@NotNull BlockPos pos, Level level) { - this.level = level; - station = (StationTileEntity) level.getBlockEntity(pos); - } - - @NotNull - @Override - public String getType() { - return "train_station"; - } - - /** - * Assembles a train. - * - * @return Whether it was successful or not with a message. - */ - @LuaFunction - public final MethodResult assemble() { - if (station.getStation().getPresentTrain() != null) { - return MethodResult.of(false, "Train already assembled"); - } - if (station.tryEnterAssemblyMode()) { - station.assemble(UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5")); - station.tick(); - if (schedule == null) { - return MethodResult.of(true, "No schedule found"); - } - station.getStation().getPresentTrain().runtime.setSchedule(schedule, true); - schedule = null; - return MethodResult.of(true, "Train assembled"); - } - return MethodResult.of(false, "Could not assemble train"); - } - - /** - * Disassembles a train. - * - * @return Whether it was successful or not with a message. - */ - @LuaFunction - public final MethodResult disassemble() { - if (station.getStation().getPresentTrain() == null) { - return MethodResult.of(false, "Train not assembled"); - } - if (station.getStation().getPresentTrain().canDisassemble()) { - Direction direction = station.getAssemblyDirection(); - BlockPos position = station.edgePoint.getGlobalPosition().above(); - schedule = station.getStation().getPresentTrain().runtime.getSchedule(); - station.getStation().getPresentTrain().disassemble(direction, position); - return MethodResult.of(true, "Train disassembled"); - } - return MethodResult.of(false, "Could not disassemble train"); - } - - /** - * Returns the current station name. - * - * @return Name of station. - */ - @LuaFunction - public final String getStationName() { - return station.getStation().name; - } - - /** - * Returns the current trains name. - * - * @return Name of train. - */ - @LuaFunction - public final String getTrainName() { - return Objects.requireNonNull(station.getStation().getPresentTrain()).name.getContents(); - } - - /** - * Sets the stations name - * - * @param name The new name. - * @return Whether it was successful or not. - */ - @LuaFunction - public final boolean setStationName(@NotNull String name) { - GlobalStation station2 = station.getStation(); - GraphLocation graphLocation = station.edgePoint.determineGraphLocation(); - if (station2 != null && graphLocation != null) { - station2.name = name; - Create.RAILWAYS.sync.pointAdded(graphLocation.graph, station2); - Create.RAILWAYS.markTracksDirty(); - station.notifyUpdate(); - return true; - } - //AllPackets.channel.sendToServer(StationEditPacket.configure(station.getBlockPos(),false,name)); - return false; - } - - /** - * Sets the current trains name. - * - * @param name The new name. - * @return Whether it was successful or not with a message. - */ - @LuaFunction - public final MethodResult setTrainName(@NotNull String name) { - if (station.getStation().getPresentTrain() == null) { - return MethodResult.of(false, "There is no train to set the name of"); - } - Train train = station.getStation().getPresentTrain(); - Train Train = Create.RAILWAYS.sided(level).trains.get(train.id); - if (Train == null) { - return MethodResult.of(false, "Train not found"); - } - if (!name.isBlank()) { - Train.name = new TextComponent(name); - station.tick(); - AllPackets.channel.send(PacketDistributor.ALL.noArg(), new TrainEditReturnPacket(Train.id, name, Train.icon.getId())); - return MethodResult.of(true, "Train name set to" + name); - } - //AllPackets.channel.sendToServer(new TrainEditPacket(train.id, name,train.icon.getId())); - return MethodResult.of(false, "Train name cannot be blank"); - } - - /** - * Gets the number of Bogeys attached to the current train. - * - * @return The number of Bogeys. - */ - @LuaFunction - public final int getBogeys() { - if (station.getStation().getPresentTrain() == null) { - return 0; - } - return station.getStation().getPresentTrain().carriages.size(); - } - - /** - * Returns boolean whether a train os present or not. - * - * @return Whether it was successful or not. - */ - @LuaFunction - public final boolean getPresentTrain() { - return station.getStation().getPresentTrain() != null; - } - - /** - * Clears the schedule saved in the station. - */ - @LuaFunction - public final void clearSchedule() { - schedule = null; - } - - @Override - public boolean equals(@Nullable IPeripheral iPeripheral) { - return this == iPeripheral; - } -} - diff --git a/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TweakedPeripheral.java b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TweakedPeripheral.java new file mode 100644 index 0000000..258e453 --- /dev/null +++ b/forge/src/main/java/cc/tweaked_programs/cccbridge/peripherals/TweakedPeripheral.java @@ -0,0 +1,58 @@ +package cc.tweaked_programs.cccbridge.peripherals; + +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; +import net.minecraft.world.level.block.entity.BlockEntity; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.annotation.Nonnull; +import java.util.LinkedList; +import java.util.List; + +/** + * I did not steal the name from Create. I swear! + * No seriously! + */ +abstract class TweakedPeripheral implements IPeripheral { + private final String type; + private final BE blockEntity; + private final List computers = new LinkedList<>(); + + public TweakedPeripheral(String type, @Nullable BE blockEntity) { + this.type = type; + this.blockEntity = blockEntity; + } + + public void sendEvent(@Nonnull String event, @Nullable Object... arguments) { + for (IComputerAccess pc : computers) + pc.queueEvent(event, pc.getAttachmentName(), arguments); + } + + @Override + public void attach(@Nonnull IComputerAccess computer) { + computers.add(computer); + } + + @Override + public void detach(@Nonnull IComputerAccess computer) { + computers.removeIf(p -> (p.getID() == computer.getID())); + } + + @NotNull + @Override + public String getType() { + return type; + } + + @Nullable + @Override + public BE getTarget() { + return blockEntity; + } + + @Override + public boolean equals(@Nullable IPeripheral other) { + return other == this && other.getType().equals(type) && other.getTarget() == this.getTarget(); + } +} diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index ff82361..ca13b1e 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,42 +1,42 @@ modLoader="javafml" loaderVersion="[40,)" -license="Apache-2.0" +license="${license}" issueTrackerURL="https://github.com/tweaked-programs/cccbridge/issues/" [[mods]] -modId="cccbridge" -version="1.3.1" +modId="${archives_base_name}" +version="${version}-${modloader}" displayName="CC:C Bridge" -updateJSONURL="" -displayURL="https://tweaked-programs.cc/tag/cccbridge/" -logoFile="icon.png" -credits="Thanks for this mod goes out to agnor99, who understands forge way better than me!!" +updateJSONURL="https://api.modrinth.com/updates/${archives_base_name}/forge_updates.json" +displayURL="https://tweaked-programs.cc/" +logoFile= "iconHD.png" +credits="Thanks to agnor99, who understands modding much better!" authors="Sammy L. Koch & Luke A. Hanssen" -description='''Adds compatibility between the ComputerCraft and Create mod! +description='''This mod adds compatibility between the ComputerCraft and Create mod! -Copyright 2022 Sammy L. Koch''' +Copyright ${copyright_year} Sammy L. Koch''' -[[dependencies.cccbridge]] +[[dependencies.${archives_base_name}]] modId="forge" mandatory=true - versionRange="[40,)" + versionRange="[${forge_version},)" ordering="NONE" # NONE; BEFORE; AFTER side="BOTH" -[[dependencies.cccbridge]] +[[dependencies.${archives_base_name}]] modId="minecraft" mandatory=true - versionRange="[1.18.2,1.19)" + versionRange="[${mc_version},)" ordering="NONE" side="BOTH" -[[dependencies.cccbridge]] +[[dependencies.${archives_base_name}]] modId="create" mandatory=true - versionRange="[0.5.0c,)" + versionRange="[${create_version_production},)" ordering="NONE" side="BOTH" -[[dependencies.cccbridge]] +[[dependencies.${archives_base_name}]] modId="computercraft" mandatory=true - versionRange="[1.101.0,)" + versionRange="[${cc_version},)" ordering="NONE" side="BOTH" diff --git a/forge/src/main/resources/assets/cccbridge/blockstates/animatronic_block.json b/forge/src/main/resources/assets/cccbridge/blockstates/animatronic_block.json new file mode 100644 index 0000000..ca39b68 --- /dev/null +++ b/forge/src/main/resources/assets/cccbridge/blockstates/animatronic_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "cccbridge:block/animatronic_block" } + } +} \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/blockstates/redrouter_block.json b/forge/src/main/resources/assets/cccbridge/blockstates/redrouter_block.json index 2d71f6b..24ae416 100644 --- a/forge/src/main/resources/assets/cccbridge/blockstates/redrouter_block.json +++ b/forge/src/main/resources/assets/cccbridge/blockstates/redrouter_block.json @@ -1,76 +1,224 @@ { - "variants": { - "facing=north": [ - { "model": "cccbridge:block/redrouter_face/1", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/2", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/3", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/4", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/5", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/6", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/7", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/8", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/9", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/10", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/11", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/12", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/13", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/14", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/15", "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/16", "uvlock": true } - ], - "facing=east": [ - { "model": "cccbridge:block/redrouter_face/1", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/2", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/3", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/4", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/5", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/6", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/7", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/8", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/9", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/10", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/11", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/12", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/13", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/14", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/15", "y": 90, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/16", "y": 90, "uvlock": true } - ], - "facing=south": [ - { "model": "cccbridge:block/redrouter_face/1", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/2", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/3", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/4", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/5", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/6", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/7", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/8", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/9", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/10", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/11", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/12", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/13", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/14", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/15", "y": 180, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/16", "y": 180, "uvlock": true } - ], - "facing=west": [ - { "model": "cccbridge:block/redrouter_face/1", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/2", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/3", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/4", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/5", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/6", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/7", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/8", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/9", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/10", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/11", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/12", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/13", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/14", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/15", "y": 270, "uvlock": true }, - { "model": "cccbridge:block/redrouter_face/16", "y": 270, "uvlock": true } - ] - } + "multipart": [ + { "when": { "facing": "north", "face": 0 }, + "apply": { "model": "cccbridge:block/redrouter_face/0", "uvlock": false } + }, + { "when": { "facing": "east", "face": 0 }, + "apply": { "model": "cccbridge:block/redrouter_face/0", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 0 }, + "apply": { "model": "cccbridge:block/redrouter_face/0", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 0 }, + "apply": { "model": "cccbridge:block/redrouter_face/0", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 1 }, + "apply": { "model": "cccbridge:block/redrouter_face/1", "uvlock": false } + }, + { "when": { "facing": "east", "face": 1 }, + "apply": { "model": "cccbridge:block/redrouter_face/1", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 1 }, + "apply": { "model": "cccbridge:block/redrouter_face/1", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 1 }, + "apply": { "model": "cccbridge:block/redrouter_face/1", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 2 }, + "apply": { "model": "cccbridge:block/redrouter_face/2", "uvlock": false } + }, + { "when": { "facing": "east", "face": 2 }, + "apply": { "model": "cccbridge:block/redrouter_face/2", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 2 }, + "apply": { "model": "cccbridge:block/redrouter_face/2", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 2 }, + "apply": { "model": "cccbridge:block/redrouter_face/2", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 3 }, + "apply": { "model": "cccbridge:block/redrouter_face/3", "uvlock": false } + }, + { "when": { "facing": "east", "face": 3 }, + "apply": { "model": "cccbridge:block/redrouter_face/3", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 3 }, + "apply": { "model": "cccbridge:block/redrouter_face/3", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 3 }, + "apply": { "model": "cccbridge:block/redrouter_face/3", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 4 }, + "apply": { "model": "cccbridge:block/redrouter_face/4", "uvlock": false } + }, + { "when": { "facing": "east", "face": 4 }, + "apply": { "model": "cccbridge:block/redrouter_face/4", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 4 }, + "apply": { "model": "cccbridge:block/redrouter_face/4", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 4 }, + "apply": { "model": "cccbridge:block/redrouter_face/4", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 5 }, + "apply": { "model": "cccbridge:block/redrouter_face/5", "uvlock": false } + }, + { "when": { "facing": "east", "face": 5 }, + "apply": { "model": "cccbridge:block/redrouter_face/5", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 5 }, + "apply": { "model": "cccbridge:block/redrouter_face/5", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 5 }, + "apply": { "model": "cccbridge:block/redrouter_face/5", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 6 }, + "apply": { "model": "cccbridge:block/redrouter_face/6", "uvlock": false } + }, + { "when": { "facing": "east", "face": 6 }, + "apply": { "model": "cccbridge:block/redrouter_face/6", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 6 }, + "apply": { "model": "cccbridge:block/redrouter_face/6", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 6 }, + "apply": { "model": "cccbridge:block/redrouter_face/6", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 7 }, + "apply": { "model": "cccbridge:block/redrouter_face/7", "uvlock": false } + }, + { "when": { "facing": "east", "face": 7 }, + "apply": { "model": "cccbridge:block/redrouter_face/7", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 7 }, + "apply": { "model": "cccbridge:block/redrouter_face/7", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 7 }, + "apply": { "model": "cccbridge:block/redrouter_face/7", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 8 }, + "apply": { "model": "cccbridge:block/redrouter_face/8", "uvlock": false } + }, + { "when": { "facing": "east", "face": 8 }, + "apply": { "model": "cccbridge:block/redrouter_face/8", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 8 }, + "apply": { "model": "cccbridge:block/redrouter_face/8", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 8 }, + "apply": { "model": "cccbridge:block/redrouter_face/8", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 9 }, + "apply": { "model": "cccbridge:block/redrouter_face/9", "uvlock": false } + }, + { "when": { "facing": "east", "face": 9 }, + "apply": { "model": "cccbridge:block/redrouter_face/9", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 9 }, + "apply": { "model": "cccbridge:block/redrouter_face/9", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 9 }, + "apply": { "model": "cccbridge:block/redrouter_face/9", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 10 }, + "apply": { "model": "cccbridge:block/redrouter_face/10", "uvlock": false } + }, + { "when": { "facing": "east", "face": 10 }, + "apply": { "model": "cccbridge:block/redrouter_face/10", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 10 }, + "apply": { "model": "cccbridge:block/redrouter_face/10", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 10 }, + "apply": { "model": "cccbridge:block/redrouter_face/10", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 11 }, + "apply": { "model": "cccbridge:block/redrouter_face/11", "uvlock": false } + }, + { "when": { "facing": "east", "face": 11 }, + "apply": { "model": "cccbridge:block/redrouter_face/11", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 11 }, + "apply": { "model": "cccbridge:block/redrouter_face/11", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 11 }, + "apply": { "model": "cccbridge:block/redrouter_face/11", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 12 }, + "apply": { "model": "cccbridge:block/redrouter_face/12", "uvlock": false } + }, + { "when": { "facing": "east", "face": 12 }, + "apply": { "model": "cccbridge:block/redrouter_face/12", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 12 }, + "apply": { "model": "cccbridge:block/redrouter_face/12", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 12 }, + "apply": { "model": "cccbridge:block/redrouter_face/12", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 13 }, + "apply": { "model": "cccbridge:block/redrouter_face/13", "uvlock": false } + }, + { "when": { "facing": "east", "face": 13 }, + "apply": { "model": "cccbridge:block/redrouter_face/13", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 13 }, + "apply": { "model": "cccbridge:block/redrouter_face/13", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 13 }, + "apply": { "model": "cccbridge:block/redrouter_face/13", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 14 }, + "apply": { "model": "cccbridge:block/redrouter_face/14", "uvlock": false } + }, + { "when": { "facing": "east", "face": 14 }, + "apply": { "model": "cccbridge:block/redrouter_face/14", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 14 }, + "apply": { "model": "cccbridge:block/redrouter_face/14", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 14 }, + "apply": { "model": "cccbridge:block/redrouter_face/14", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 15 }, + "apply": { "model": "cccbridge:block/redrouter_face/15", "uvlock": false } + }, + { "when": { "facing": "east", "face": 15 }, + "apply": { "model": "cccbridge:block/redrouter_face/15", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 15 }, + "apply": { "model": "cccbridge:block/redrouter_face/15", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 15 }, + "apply": { "model": "cccbridge:block/redrouter_face/15", "y": 270, "uvlock": false } + }, + + { "when": { "facing": "north", "face": 16 }, + "apply": { "model": "cccbridge:block/redrouter_face/16", "uvlock": false } + }, + { "when": { "facing": "east", "face": 16 }, + "apply": { "model": "cccbridge:block/redrouter_face/16", "y": 90, "uvlock": false } + }, + { "when": { "facing": "south", "face": 16 }, + "apply": { "model": "cccbridge:block/redrouter_face/16", "y": 180, "uvlock": false } + }, + { "when": { "facing": "west", "face": 16 }, + "apply": { "model": "cccbridge:block/redrouter_face/16", "y": 270, "uvlock": false } + } + ] } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/blockstates/scroller_block.json b/forge/src/main/resources/assets/cccbridge/blockstates/scroller_block.json index 7d729fa..ea82087 100644 --- a/forge/src/main/resources/assets/cccbridge/blockstates/scroller_block.json +++ b/forge/src/main/resources/assets/cccbridge/blockstates/scroller_block.json @@ -1,41 +1,41 @@ { "multipart": [ { "when": { "facing": "north", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "uvlock": false } }, { "when": { "facing": "east", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "y": 90, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "y": 90, "uvlock": false } }, { "when": { "facing": "south", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "y": 180, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "y": 180, "uvlock": false } }, { "when": { "facing": "west", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "y": 270, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "y": 270, "uvlock": false } }, { "when": { "facing": "up", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "x": -90, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "x": -90, "y": 180, "uvlock": false } }, { "when": { "facing": "down", "locked": "false" }, - "apply": { "model": "cccbridge:block/scroller_block", "x": 90, "uvlock": true } + "apply": { "model": "cccbridge:block/scroller_block", "x": 90, "y": 180, "uvlock": false } }, { "when": { "facing": "north", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "uvlock": false } }, { "when": { "facing": "east", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 90, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 90, "uvlock": false } }, { "when": { "facing": "south", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 180, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 180, "uvlock": false } }, { "when": { "facing": "west", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 270, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "y": 270, "uvlock": false } }, { "when": { "facing": "up", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "x": -90, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "x": -90, "uvlock": false } }, { "when": { "facing": "down", "locked": "true" }, - "apply": { "model": "cccbridge:block/locked_scroller_block", "x": 90, "uvlock": true } + "apply": { "model": "cccbridge:block/locked_scroller_block", "x": 90, "uvlock": false } } ] } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/icon.png b/forge/src/main/resources/assets/cccbridge/icon.png deleted file mode 100644 index 94d4e3e..0000000 Binary files a/forge/src/main/resources/assets/cccbridge/icon.png and /dev/null differ diff --git a/forge/src/main/resources/assets/cccbridge/iconHD.png b/forge/src/main/resources/assets/cccbridge/iconHD.png deleted file mode 100644 index ef64978..0000000 Binary files a/forge/src/main/resources/assets/cccbridge/iconHD.png and /dev/null differ diff --git a/forge/src/main/resources/assets/cccbridge/lang/en_us.json b/forge/src/main/resources/assets/cccbridge/lang/en_us.json index 61b529e..14eb843 100644 --- a/forge/src/main/resources/assets/cccbridge/lang/en_us.json +++ b/forge/src/main/resources/assets/cccbridge/lang/en_us.json @@ -3,10 +3,13 @@ "block.cccbridge.target_block": "Target Block", "block.cccbridge.redrouter_block": "RedRouter Block", "block.cccbridge.scroller_block": "Scroller Pane", + "block.cccbridge.animatronic_block": "Animatronic", "cccbridge.display_source.source_block_display_source": "Given data from computer", - "cccbridge.general.unit.scroller": "Small Lua Number", + "cccbridge.general.unit.scroller": "Lua Number", + "cccbridge.general.unit.scroller.positive": "Lua Num. +", + "cccbridge.general.unit.scroller.negative": "Lua Num. -", "subtitles.cccbridge.cage_lock": "Scroller locked", "subtitles.cccbridge.cage_unlock": "Scroller unlocked" diff --git a/forge/src/main/resources/assets/cccbridge/models/block/animatronic_block.json b/forge/src/main/resources/assets/cccbridge/models/block/animatronic_block.json new file mode 100644 index 0000000..a1388d0 --- /dev/null +++ b/forge/src/main/resources/assets/cccbridge/models/block/animatronic_block.json @@ -0,0 +1,83 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "cccbridge:block/animatronic_block", + "particle": "cccbridge:block/animatronic_block" + }, + "elements": [ + { + "name": "base", + "from": [7.5, 2, 7.5], + "to": [8.5, 16, 8.5], + "faces": { + "north": {"uv": [6, 4, 6.5, 11], "texture": "#0"}, + "east": {"uv": [6.5, 4, 7, 11], "texture": "#0"}, + "south": {"uv": [7, 4, 7.5, 11], "texture": "#0"}, + "west": {"uv": [7.5, 4, 8, 11], "texture": "#0"}, + "up": {"uv": [8.5, 4.5, 8, 4], "texture": "#0"}, + "down": {"uv": [8.5, 4.5, 8, 5], "texture": "#0"} + } + }, + { + "name": "stick", + "from": [2, 0, 2], + "to": [14, 2, 14], + "faces": { + "north": {"uv": [6, 0, 12, 1], "texture": "#0"}, + "east": {"uv": [6, 1, 12, 2], "texture": "#0"}, + "south": {"uv": [6, 2, 12, 3], "texture": "#0"}, + "west": {"uv": [6, 3, 12, 4], "texture": "#0"}, + "up": {"uv": [6, 6, 0, 0], "texture": "#0"}, + "down": {"uv": [6, 6, 0, 12], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [69, 0, 0], + "translation": [0, 0.75, 1.25], + "scale": [0.3, 0.3, 0.3] + }, + "thirdperson_lefthand": { + "rotation": [69, 0, 0], + "translation": [0, 0.75, 1.25], + "scale": [0.3, 0.3, 0.3] + }, + "firstperson_righthand": { + "rotation": [0, -180, 0], + "translation": [1, 1, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 89, 0], + "translation": [1, 1, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 4, 0], + "scale": [0.3, 0.3, 0.3] + }, + "gui": { + "rotation": [-175.21, -45.54, 179.37], + "translation": [0, -2, 0], + "scale": [0.6, 0.6, 0.6] + }, + "head": { + "rotation": [-150, 70, -3], + "translation": [-2.5, 8, 5.75] + }, + "fixed": { + "translation": [0, -3, 0], + "scale": [0.6, 0.6, 0.6] + } + }, + "groups": [ + { + "name": "VoxelShapes", + "origin": [0, 0, 0], + "color": 0, + "children": [0, 1] + } + ] +} \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/base.json b/forge/src/main/resources/assets/cccbridge/models/block/base.json deleted file mode 100644 index b970fb2..0000000 --- a/forge/src/main/resources/assets/cccbridge/models/block/base.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "credit": "By Sammy.K via Blockbench", - "parent": "block/block", - "textures": { - "0": "cccbridge:block/st_block_top", - "particle": "cccbridge:block/st_block_top" - }, - "elements": [ - { - "name": "body", - "from": [1, 1, 1], - "to": [15, 15, 15], - "faces": { - "north": {"uv": [1, 1, 15, 15], "texture": "#0", "cullface": "north"}, - "east": {"uv": [1, 1, 15, 15], "texture": "#0", "cullface": "east"}, - "south": {"uv": [1, 1, 15, 15], "texture": "#0", "cullface": "south"}, - "west": {"uv": [1, 1, 15, 15], "texture": "#0", "cullface": "west"}, - "up": {"uv": [1, 1, 15, 15], "texture": "#0"}, - "down": {"uv": [1, 1, 15, 15], "texture": "#0"} - } - }, - { - "name": "vertical-ne", - "from": [15, 0, 0], - "to": [16, 16, 1], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#0"} - } - }, - { - "name": "vertical-es", - "from": [15, 0, 15], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "up": {"uv": [15, 15, 16, 16], "texture": "#0"}, - "down": {"uv": [0, 15, 1, 16], "texture": "#0"} - } - }, - { - "name": "vertical-sw", - "from": [0, 0, 15], - "to": [1, 16, 16], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "up": {"uv": [0, 15, 1, 16], "texture": "#0"}, - "down": {"uv": [15, 15, 16, 16], "texture": "#0"} - } - }, - { - "name": "vertical-wn", - "from": [0, 0, 0], - "to": [1, 16, 1], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#0"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#0"} - } - }, - { - "name": "side-upper-n", - "from": [1, 15, 0], - "to": [15, 16, 1], - "faces": { - "north": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#0"} - } - }, - { - "name": "side-upper-s", - "from": [1, 15, 15], - "to": [15, 16, 16], - "faces": { - "north": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} - } - }, - { - "name": "side-upper-w", - "from": [0, 15, 1], - "to": [1, 16, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "up": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "side-upper-e", - "from": [15, 15, 1], - "to": [16, 16, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#0"}, - "up": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#0"} - } - }, - { - "name": "side-lower-w", - "from": [0, 0, 1], - "to": [1, 1, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 90, "texture": "#0"}, - "down": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "side-lower-s", - "from": [1, 0, 15], - "to": [15, 1, 16], - "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "down": {"uv": [1, 15, 15, 16], "texture": "#0"} - } - }, - { - "name": "side-lower-e", - "from": [15, 0, 1], - "to": [16, 1, 15], - "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 270, "texture": "#0"}, - "down": {"uv": [0, 1, 1, 15], "texture": "#0"} - } - }, - { - "name": "side-lower-n", - "from": [1, 0, 0], - "to": [15, 1, 1], - "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} - } - } - ], - "groups": [ - 0, - { - "name": "frame", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] - } - ] -} \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/locked_scroller_block.json b/forge/src/main/resources/assets/cccbridge/models/block/locked_scroller_block.json index 1d0f7fb..cc4bb2c 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/locked_scroller_block.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/locked_scroller_block.json @@ -1,6 +1,7 @@ { "credit": "By Sammy.K via Blockbench", "parent": "block/block", + "render_type": "cutout", "textures": { "0": "cccbridge:block/scroller/scroller_side", "1": "cccbridge:block/scroller/scroller_front", @@ -10,16 +11,35 @@ }, "elements": [ { - "name": "body", - "from": [0, 0, 15], - "to": [16, 16, 16], + "name": "cage", + "from": [4, 4, 15], + "to": [12, 12, 16], "faces": { - "north": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "north"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0", "cullface": "east"}, - "south": {"uv": [0, 0, 16, 16], "texture": "#0", "cullface": "south"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0", "cullface": "west"}, - "up": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 15, 16, 16], "texture": "#0"} + "north": {"uv": [3, 3, 13, 13], "texture": "#3"}, + "east": {"uv": [3, 3, 4, 13], "texture": "#3"}, + "west": {"uv": [12, 3, 13, 13], "texture": "#3"}, + "up": {"uv": [3, 3, 13, 4], "texture": "#3"}, + "down": {"uv": [3, 12, 13, 13], "texture": "#3"} + } + }, + { + "name": "interface", + "from": [3, 3, 15.95], + "to": [13, 13, 16], + "faces": { + "north": {"uv": [3, 3, 13, 13], "texture": "#2"}, + "south": {"uv": [3, 3, 13, 13], "texture": "#0"} + } + }, + { + "name": "side-upper-n", + "from": [1, 15, 14], + "to": [15, 16, 15], + "faces": { + "north": {"uv": [1, 0, 15, 1], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [15, 0, 1, 1], "texture": "#1"}, + "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#1"} } }, { @@ -27,11 +47,12 @@ "from": [15, 0, 14], "to": [16, 16, 15], "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#0"} + "north": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "east": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "up": {"uv": [0, 0, 1, 1], "texture": "#1"}, + "down": {"uv": [0, 15, 1, 16], "texture": "#1"} } }, { @@ -39,59 +60,71 @@ "from": [0, 0, 14], "to": [1, 16, 15], "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#0"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#0"} + "north": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "east": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "up": {"uv": [15, 0, 16, 1], "texture": "#1"}, + "down": {"uv": [15, 15, 16, 16], "texture": "#1"} } }, { - "name": "side-upper-n", - "from": [1, 15, 14], - "to": [15, 16, 15], + "name": "side-lower-n", + "from": [1, 0, 14], + "to": [15, 1, 15], "faces": { - "north": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#0"} + "north": {"uv": [1, 15, 15, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#1"}, + "down": {"uv": [15, 15, 1, 16], "texture": "#1"} } }, { - "name": "side-lower-n", - "from": [1, 0, 14], - "to": [15, 1, 15], + "name": "top", + "from": [0, 13, 15], + "to": [16, 16, 16], "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} + "north": {"uv": [0, 0, 16, 3], "texture": "#0"}, + "east": {"uv": [15, 0, 16, 3], "texture": "#0"}, + "south": {"uv": [0, 0, 16, 3], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "up": {"uv": [0, 0, 16, 1], "texture": "#0"}, + "down": {"uv": [0, 2, 16, 3], "texture": "#0"} } }, { - "name": "interface", - "from": [3, 3, 15.9], - "to": [13, 13, 14.91], + "name": "east", + "from": [13, 3, 15], + "to": [16, 13, 16], "faces": { - "north": {"uv": [3, 3, 13, 13], "texture": "#2"}, - "east": {"uv": [3, 3, 2, 13], "texture": "#2"}, - "west": {"uv": [13, 3, 14, 13], "texture": "#2"}, - "up": {"uv": [3, 2, 13, 3], "rotation": 180, "texture": "#2"}, - "down": {"uv": [3, 13, 13, 14], "texture": "#2"} + "north": {"uv": [0, 3, 3, 13], "texture": "#0"}, + "east": {"uv": [15, 3, 16, 13], "texture": "#0"}, + "south": {"uv": [13, 3, 16, 13], "texture": "#0"}, + "west": {"uv": [2, 3, 3, 13], "texture": "#0"} } }, { - "name": "cage", - "from": [4, 4, 15], - "to": [12, 12, 16], + "name": "bottom", + "from": [0, 0, 15], + "to": [16, 3, 16], "faces": { - "north": {"uv": [3, 3, 13, 13], "texture": "#3"}, - "east": {"uv": [3, 3, 4, 13], "texture": "#3"}, - "west": {"uv": [12, 3, 13, 13], "texture": "#3"}, - "up": {"uv": [3, 3, 13, 4], "texture": "#3"}, - "down": {"uv": [3, 12, 13, 13], "texture": "#3"} + "north": {"uv": [0, 13, 16, 16], "texture": "#0"}, + "east": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "south": {"uv": [0, 13, 16, 16], "texture": "#0"}, + "west": {"uv": [0, 13, 1, 16], "texture": "#0"}, + "up": {"uv": [0, 13, 16, 14], "texture": "#0"}, + "down": {"uv": [0, 15, 16, 16], "texture": "#0"} + } + }, + { + "name": "west", + "from": [0, 3, 15], + "to": [3, 13, 16], + "faces": { + "north": {"uv": [13, 3, 16, 13], "texture": "#0"}, + "east": {"uv": [13, 3, 14, 13], "texture": "#0"}, + "south": {"uv": [0, 3, 3, 13], "texture": "#0"}, + "west": {"uv": [0, 3, 1, 13], "texture": "#0"} } } ], @@ -108,13 +141,13 @@ }, "firstperson_righthand": { "rotation": [-13, 155, 0], - "translation": [-3, 2.5, 5.75], - "scale": [0.4, 0.4, 0.4] + "translation": [-3.75, 2.5, 5.75], + "scale": [0.3, 0.3, 0.3] }, "firstperson_lefthand": { "rotation": [-13, 155, 0], - "translation": [-3, 2.5, 5.75], - "scale": [0.4, 0.4, 0.4] + "translation": [-3.25, 2.5, 5.75], + "scale": [0.3, 0.3, 0.3] }, "ground": { "rotation": [90, 0, 0], @@ -136,15 +169,18 @@ }, "groups": [ 0, + 1, { "name": "frame", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [1, 2, 3, 4] + "children": [2, 3, 4, 5] }, - 5, - 6 + { + "name": "base", + "origin": [0, 0, 0], + "color": 0, + "children": [6, 7, 8, 9] + } ] } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_block.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_block.json index 34f3fd1..bf43356 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_block.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_block.json @@ -1,99 +1,20 @@ { "credit": "By Sammy.K via Blockbench", - "parent": "cccbridge:block/base", + "render_type": "cutout", "textures": { - "2": "cccbridge:block/redrouter/background", "3": "cccbridge:block/redrouter/redrouter_side", "4": "cccbridge:block/redrouter/redrouter_top", "5": "cccbridge:block/redrouter/redrouter_front", - "6": "cccbridge:block/redrouter/connector", - "particle": "cccbridge:block/redrouter/background", - "face": "cccbridge:block/redrouter/face/1" + "6": "cccbridge:block/redrouter/background", + "particle": "cccbridge:block/redrouter/background" }, "elements": [ - { - "name": "background", - "from": [2, 2, 2], - "to": [14, 14, 2], - "faces": { - "north": {"uv": [2, 2, 14, 14], "texture": "#2"} - } - }, - { - "name": "face", - "from": [0, 0, 1.9], - "to": [16, 16, 1.9], - "faces": { - "north": {"uv": [0, 0, 16, 16], "texture": "#face"} - } - }, - { - "name": "east", - "from": [15, 5, 5], - "to": [14.5, 11, 11], - "faces": { - "north": {"uv": [11, 5, 12, 11], "texture": "#6"}, - "east": {"uv": [5, 5, 11, 11], "texture": "#6"}, - "south": {"uv": [4, 5, 5, 11], "texture": "#6"}, - "up": {"uv": [5, 4, 11, 5], "rotation": 270, "texture": "#6"}, - "down": {"uv": [5, 11, 11, 12], "rotation": 90, "texture": "#6"} - } - }, - { - "name": "west", - "from": [1.5, 5, 5], - "to": [1, 11, 11], - "faces": { - "north": {"uv": [4, 5, 5, 11], "texture": "#6"}, - "south": {"uv": [11, 5, 12, 11], "texture": "#6"}, - "west": {"uv": [5, 5, 11, 11], "texture": "#6"}, - "up": {"uv": [5, 4, 11, 5], "rotation": 90, "texture": "#6"}, - "down": {"uv": [5, 11, 11, 12], "rotation": 270, "texture": "#6"} - } - }, - { - "name": "south", - "from": [5, 5, 15], - "to": [11, 11, 14.5], - "rotation": {"angle": 0, "axis": "y", "origin": [15, 8, 20]}, - "faces": { - "east": {"uv": [11, 5, 12, 11], "texture": "#6"}, - "south": {"uv": [5, 5, 11, 11], "texture": "#6"}, - "west": {"uv": [4, 5, 5, 11], "texture": "#6"}, - "up": {"uv": [5, 4, 11, 5], "texture": "#6"}, - "down": {"uv": [5, 11, 11, 12], "texture": "#6"} - } - }, - { - "name": "upper", - "from": [5, 15, 5], - "to": [11, 14.5, 11], - "faces": { - "north": {"uv": [5, 4, 11, 5], "rotation": 180, "texture": "#6"}, - "east": {"uv": [11, 5, 12, 11], "rotation": 90, "texture": "#6"}, - "south": {"uv": [5, 11, 11, 12], "texture": "#6"}, - "west": {"uv": [4, 5, 5, 11], "rotation": 270, "texture": "#6"}, - "up": {"uv": [5, 5, 11, 11], "texture": "#6"} - } - }, - { - "name": "lower", - "from": [5, 1.5, 5], - "to": [11, 1, 11], - "faces": { - "north": {"uv": [5, 11, 11, 12], "rotation": 180, "texture": "#6"}, - "east": {"uv": [11, 5, 12, 11], "rotation": 270, "texture": "#6"}, - "south": {"uv": [5, 4, 11, 5], "texture": "#6"}, - "west": {"uv": [4, 5, 5, 11], "rotation": 90, "texture": "#6"}, - "down": {"uv": [5, 5, 11, 11], "texture": "#6"} - } - }, { "name": "left", "from": [2, 4, 1], "to": [2, 12, 2], "faces": { - "east": {"uv": [14, 4, 15, 12], "texture": "#2"} + "east": {"uv": [14, 4, 15, 12], "texture": "#6"} } }, { @@ -101,7 +22,7 @@ "from": [14, 4, 1], "to": [14, 12, 2], "faces": { - "west": {"uv": [1, 4, 2, 12], "texture": "#2"} + "west": {"uv": [1, 4, 2, 12], "texture": "#6"} } }, { @@ -109,7 +30,7 @@ "from": [4, 2, 1], "to": [12, 2, 2], "faces": { - "up": {"uv": [4, 14, 12, 15], "texture": "#2"} + "up": {"uv": [4, 14, 12, 15], "texture": "#6"} } }, { @@ -117,7 +38,7 @@ "from": [4, 14, 1], "to": [12, 14, 2], "faces": { - "down": {"uv": [4, 1, 12, 2], "texture": "#2"} + "down": {"uv": [4, 1, 12, 2], "texture": "#6"} } }, { @@ -125,8 +46,8 @@ "from": [3, 13, 1], "to": [4, 14, 2], "faces": { - "east": {"uv": [12, 2, 13, 3], "texture": "#2"}, - "down": {"uv": [12, 2, 13, 3], "texture": "#2"} + "east": {"uv": [12, 2, 13, 3], "texture": "#6"}, + "down": {"uv": [12, 2, 13, 3], "texture": "#6"} } }, { @@ -134,8 +55,8 @@ "from": [12, 13, 1], "to": [13, 14, 2], "faces": { - "west": {"uv": [3, 2, 4, 3], "texture": "#2"}, - "down": {"uv": [3, 2, 4, 3], "texture": "#2"} + "west": {"uv": [3, 2, 4, 3], "texture": "#6"}, + "down": {"uv": [3, 2, 4, 3], "texture": "#6"} } }, { @@ -143,8 +64,8 @@ "from": [3, 2, 1], "to": [4, 3, 2], "faces": { - "east": {"uv": [12, 13, 13, 14], "texture": "#2"}, - "up": {"uv": [12, 13, 13, 14], "texture": "#2"} + "east": {"uv": [12, 13, 13, 14], "texture": "#6"}, + "up": {"uv": [12, 13, 13, 14], "texture": "#6"} } }, { @@ -152,8 +73,8 @@ "from": [12, 2, 1], "to": [13, 3, 2], "faces": { - "west": {"uv": [3, 13, 4, 14], "texture": "#2"}, - "up": {"uv": [3, 13, 4, 14], "texture": "#2"} + "west": {"uv": [3, 13, 4, 14], "texture": "#6"}, + "up": {"uv": [3, 13, 4, 14], "texture": "#6"} } }, { @@ -161,8 +82,8 @@ "from": [2, 3, 1], "to": [3, 4, 2], "faces": { - "east": {"uv": [13, 12, 14, 13], "texture": "#2"}, - "up": {"uv": [13, 12, 14, 13], "texture": "#2"} + "east": {"uv": [13, 12, 14, 13], "texture": "#6"}, + "up": {"uv": [13, 12, 14, 13], "texture": "#6"} } }, { @@ -170,8 +91,8 @@ "from": [13, 3, 1], "to": [14, 4, 2], "faces": { - "west": {"uv": [2, 12, 3, 13], "texture": "#2"}, - "up": {"uv": [2, 12, 3, 13], "texture": "#2"} + "west": {"uv": [2, 12, 3, 13], "texture": "#6"}, + "up": {"uv": [2, 12, 3, 13], "texture": "#6"} } }, { @@ -179,8 +100,8 @@ "from": [13, 12, 1], "to": [14, 13, 2], "faces": { - "west": {"uv": [3, 2, 4, 3], "texture": "#2"}, - "down": {"uv": [2, 3, 3, 4], "texture": "#2"} + "west": {"uv": [3, 2, 4, 3], "texture": "#6"}, + "down": {"uv": [2, 3, 3, 4], "texture": "#6"} } }, { @@ -188,216 +109,231 @@ "from": [2, 12, 1], "to": [3, 13, 2], "faces": { - "east": {"uv": [13, 3, 14, 4], "texture": "#2"}, - "down": {"uv": [13, 3, 14, 4], "texture": "#2"} + "east": {"uv": [13, 3, 14, 4], "texture": "#6"}, + "down": {"uv": [13, 3, 14, 4], "texture": "#6"} } }, { "name": "body", - "from": [1, 1, 1], - "to": [15, 15, 15], + "from": [0, 0, 2], + "to": [16, 16, 16], "faces": { - "north": {"uv": [1, 1, 15, 15], "texture": "#5", "cullface": "north"}, - "east": {"uv": [1, 1, 15, 15], "texture": "#3", "cullface": "east"}, - "south": {"uv": [1, 1, 15, 15], "texture": "#3", "cullface": "south"}, - "west": {"uv": [1, 1, 15, 15], "texture": "#3", "cullface": "west"}, - "up": {"uv": [1, 1, 15, 15], "texture": "#4"}, - "down": {"uv": [1, 1, 15, 15], "texture": "#4"} + "east": {"uv": [0, 0, 15, 16], "texture": "#3", "cullface": "east"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#3", "cullface": "south"}, + "west": {"uv": [1, 0, 16, 16], "texture": "#3", "cullface": "west"}, + "up": {"uv": [0, 1, 16, 16], "texture": "#4"}, + "down": {"uv": [0, 0, 16, 15], "texture": "#4"} } }, { "name": "vertical-ne", "from": [15, 0, 0], - "to": [16, 16, 1], + "to": [16, 16, 2], "faces": { "north": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#3"}, + "east": {"uv": [14, 0, 16, 16], "texture": "#3"}, "south": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#3"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#3"} - } - }, - { - "name": "vertical-es", - "from": [15, 0, 15], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "south": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "up": {"uv": [15, 15, 16, 16], "texture": "#3"}, - "down": {"uv": [0, 15, 1, 16], "texture": "#3"} - } - }, - { - "name": "vertical-sw", - "from": [0, 0, 15], - "to": [1, 16, 16], - "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "east": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "west": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "up": {"uv": [0, 15, 1, 16], "texture": "#3"}, - "down": {"uv": [15, 15, 16, 16], "texture": "#3"} + "west": {"uv": [0, 0, 2, 16], "texture": "#3"}, + "up": {"uv": [15, 0, 16, 2], "texture": "#3"}, + "down": {"uv": [0, 0, 1, 2], "texture": "#3"} } }, { "name": "vertical-wn", "from": [0, 0, 0], - "to": [1, 16, 1], + "to": [1, 16, 2], "faces": { "north": {"uv": [15, 0, 16, 16], "texture": "#3"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#3"}, + "east": {"uv": [14, 0, 16, 16], "texture": "#3"}, "south": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#3"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#3"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#3"} + "west": {"uv": [0, 0, 2, 16], "texture": "#3"}, + "up": {"uv": [0, 0, 1, 2], "texture": "#3"}, + "down": {"uv": [15, 0, 16, 2], "texture": "#3"} } }, { "name": "side-upper-n", "from": [1, 15, 0], - "to": [15, 16, 1], + "to": [15, 16, 2], "faces": { "north": {"uv": [1, 0, 15, 1], "texture": "#3"}, "east": {"uv": [0, 0, 0, 0], "texture": "#3"}, "south": {"uv": [1, 0, 15, 1], "texture": "#3"}, "west": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#3"} + "up": {"uv": [1, 0, 15, 2], "texture": "#3"}, + "down": {"uv": [1, 0, 15, 2], "rotation": 180, "texture": "#3"} } }, { - "name": "side-upper-s", - "from": [1, 15, 15], - "to": [15, 16, 16], + "name": "side-lower-n", + "from": [1, 0, 0], + "to": [15, 1, 2], "faces": { - "north": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#3"}, + "north": {"uv": [1, 15, 15, 16], "texture": "#3"}, "east": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "south": {"uv": [1, 0, 15, 1], "texture": "#3"}, + "south": {"uv": [1, 15, 15, 16], "texture": "#3"}, "west": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#3"} + "up": {"uv": [1, 14, 15, 16], "rotation": 180, "texture": "#3"}, + "down": {"uv": [1, 2, 15, 0], "texture": "#3"} } }, { - "name": "side-upper-w", - "from": [0, 15, 1], - "to": [1, 16, 15], + "name": "bottom", + "from": [1, 1, 1], + "to": [15, 2, 1], "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "east": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#3"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "west": {"uv": [1, 0, 15, 1], "texture": "#3"}, - "up": {"uv": [0, 1, 1, 15], "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 270, "texture": "#3"} + "north": {"uv": [1, 14, 15, 15], "texture": "#5"} } }, { - "name": "side-upper-e", - "from": [15, 15, 1], - "to": [16, 16, 15], + "name": "bottom3", + "from": [12, 2, 1], + "to": [15, 3, 1], "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "east": {"uv": [1, 0, 15, 1], "texture": "#3"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "west": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#3"}, - "up": {"uv": [15, 1, 16, 15], "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 90, "texture": "#3"} + "north": {"uv": [1, 13, 4, 14], "texture": "#5"} } }, { - "name": "side-lower-w", - "from": [0, 0, 1], - "to": [1, 1, 15], + "name": "bottom4", + "from": [1, 2, 1], + "to": [4, 3, 1], "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "east": {"uv": [15, 1, 16, 15], "rotation": 270, "texture": "#3"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "west": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 90, "texture": "#3"}, - "down": {"uv": [15, 1, 16, 15], "texture": "#3"} + "north": {"uv": [12, 13, 15, 14], "texture": "#5"} } }, { - "name": "side-lower-s", - "from": [1, 0, 15], - "to": [15, 1, 16], + "name": "bottom2", + "from": [1, 3, 1], + "to": [3, 4, 1], "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "down": {"uv": [1, 15, 15, 16], "texture": "#3"} + "north": {"uv": [13, 12, 15, 13], "texture": "#5"} } }, { - "name": "side-lower-e", - "from": [15, 0, 1], - "to": [16, 1, 15], + "name": "bottom1", + "from": [13, 3, 1], + "to": [15, 4, 1], "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "east": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "west": {"uv": [0, 1, 1, 15], "rotation": 90, "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 270, "texture": "#3"}, - "down": {"uv": [0, 1, 1, 15], "texture": "#3"} + "north": {"uv": [1, 12, 3, 13], "texture": "#5"} } }, { - "name": "side-lower-n", - "from": [1, 0, 0], - "to": [15, 1, 1], + "name": "top5", + "from": [1, 12, 1], + "to": [3, 13, 1], "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "south": {"uv": [1, 15, 15, 16], "texture": "#3"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#3"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#3"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#3"} + "north": {"uv": [13, 3, 15, 4], "texture": "#5"} + } + }, + { + "name": "top4", + "from": [13, 12, 1], + "to": [15, 13, 1], + "faces": { + "north": {"uv": [1, 3, 3, 4], "texture": "#5"} + } + }, + { + "name": "left", + "from": [14, 4, 1], + "to": [15, 12, 1], + "faces": { + "north": {"uv": [1, 4, 2, 12], "texture": "#5"} + } + }, + { + "name": "right", + "from": [1, 4, 1], + "to": [2, 12, 1], + "faces": { + "north": {"uv": [14, 4, 15, 12], "texture": "#5"} + } + }, + { + "name": "top1", + "from": [12, 13, 1], + "to": [15, 14, 1], + "faces": { + "north": {"uv": [1, 2, 4, 3], "texture": "#5"} + } + }, + { + "name": "top", + "from": [1, 14, 1], + "to": [15, 15, 1], + "faces": { + "north": {"uv": [1, 1, 15, 2], "texture": "#5"} + } + }, + { + "name": "top2", + "from": [1, 13, 1], + "to": [4, 14, 1], + "faces": { + "north": {"uv": [12, 2, 15, 3], "texture": "#5"} + } + }, + { + "name": "face", + "from": [2, 2, 1.9], + "to": [14, 14, 2.9], + "faces": { + "north": {"uv": [2, 2, 14, 14], "texture": "#6"} } } ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + }, "groups": [ - 0, - 1, - { - "name": "connector", - "origin": [8, 8, 8], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [2, 3, 4, 5, 6] - }, { "name": "screen", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] }, { "name": "base", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, "children": [ - 19, + 12, { "name": "frame", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31] + "children": [13, 14, 15, 16] } ] + }, + { + "name": "face", + "origin": [0, 0, 0], + "color": 0, + "children": [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] } ] } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/0.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/0.json new file mode 100644 index 0000000..cc7cd95 --- /dev/null +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/0.json @@ -0,0 +1,6 @@ +{ + "parent": "cccbridge:block/redrouter_block", + "textures": { + "6": "cccbridge:block/redrouter/face/0" + } +} \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/1.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/1.json index 992ad97..e4f39ad 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/1.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/1.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/1" + "6": "cccbridge:block/redrouter/face/1" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/10.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/10.json index de1af19..dd06ce7 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/10.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/10.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/10" + "6": "cccbridge:block/redrouter/face/10" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/11.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/11.json index dd6051f..51fd111 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/11.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/11.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/11" + "6": "cccbridge:block/redrouter/face/11" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/12.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/12.json index ef30c46..6a483ef 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/12.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/12.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/12" + "6": "cccbridge:block/redrouter/face/12" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/13.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/13.json index 8585e44..0d203a4 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/13.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/13.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/13" + "6": "cccbridge:block/redrouter/face/13" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/14.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/14.json index 1bcdf08..e1fd253 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/14.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/14.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/14" + "6": "cccbridge:block/redrouter/face/14" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/15.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/15.json index e8af63b..c1bea21 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/15.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/15.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/15" + "6": "cccbridge:block/redrouter/face/15" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/16.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/16.json index 0996f92..92daa7a 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/16.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/16.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/16" + "6": "cccbridge:block/redrouter/face/16" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/17.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/17.json new file mode 100644 index 0000000..b2a180c --- /dev/null +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/17.json @@ -0,0 +1,6 @@ +{ + "parent": "cccbridge:block/redrouter_block", + "textures": { + "6": "cccbridge:block/redrouter/face/17" + } +} \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/2.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/2.json index 1f60b7b..a2cc2f1 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/2.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/2.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/2" + "6": "cccbridge:block/redrouter/face/2" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/3.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/3.json index 838b34f..90a867b 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/3.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/3.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/3" + "6": "cccbridge:block/redrouter/face/3" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/4.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/4.json index 15935ff..cd16c18 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/4.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/4.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/4" + "6": "cccbridge:block/redrouter/face/4" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/5.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/5.json index 4540dee..d376c72 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/5.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/5.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/5" + "6": "cccbridge:block/redrouter/face/5" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/6.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/6.json index a391ce8..8582a91 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/6.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/6.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/6" + "6": "cccbridge:block/redrouter/face/6" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/7.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/7.json index f67e417..e9b2d24 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/7.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/7.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/7" + "6": "cccbridge:block/redrouter/face/7" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/8.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/8.json index a2c90cf..bf27b07 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/8.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/8.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/8" + "6": "cccbridge:block/redrouter/face/8" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/9.json b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/9.json index d195d98..f052f44 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/9.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/redrouter_face/9.json @@ -1,7 +1,6 @@ { - "credit": "By Sammy.K", "parent": "cccbridge:block/redrouter_block", "textures": { - "face": "cccbridge:block/redrouter/face/9" + "6": "cccbridge:block/redrouter/face/9" } } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/scroller_block.json b/forge/src/main/resources/assets/cccbridge/models/block/scroller_block.json index ee6ec66..cc01eef 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/scroller_block.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/scroller_block.json @@ -1,6 +1,7 @@ { "credit": "By Sammy.K via Blockbench", "parent": "block/block", + "render_type": "cutout", "textures": { "0": "cccbridge:block/scroller/scroller_side", "1": "cccbridge:block/scroller/scroller_front", @@ -8,29 +9,17 @@ "particle": "cccbridge:block/scroller/scroller_side" }, "elements": [ - { - "name": "body", - "from": [0, 0, 15], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "north"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0", "cullface": "east"}, - "south": {"uv": [0, 0, 16, 16], "texture": "#0", "cullface": "south"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0", "cullface": "west"}, - "up": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 15, 16, 16], "texture": "#0"} - } - }, { "name": "vertical-ne", "from": [15, 0, 14], "to": [16, 16, 15], "faces": { - "north": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [15, 0, 16, 1], "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#0"} + "north": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "east": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 1, 16], "texture": "#1"}, + "up": {"uv": [0, 0, 1, 1], "texture": "#1"}, + "down": {"uv": [0, 15, 1, 16], "texture": "#1"} } }, { @@ -38,11 +27,12 @@ "from": [0, 0, 14], "to": [1, 16, 15], "faces": { - "north": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "east": {"uv": [15, 0, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1], "texture": "#0"}, - "down": {"uv": [15, 0, 16, 1], "texture": "#0"} + "north": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "east": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [15, 0, 16, 16], "texture": "#1"}, + "up": {"uv": [15, 0, 16, 1], "texture": "#1"}, + "down": {"uv": [15, 15, 16, 16], "texture": "#1"} } }, { @@ -50,11 +40,12 @@ "from": [1, 15, 14], "to": [15, 16, 15], "faces": { - "north": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 0, 15, 1], "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "rotation": 180, "texture": "#0"} + "north": {"uv": [1, 0, 15, 1], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [15, 0, 1, 1], "texture": "#1"}, + "down": {"uv": [15, 0, 1, 1], "texture": "#1"} } }, { @@ -62,24 +53,74 @@ "from": [1, 0, 14], "to": [15, 1, 15], "faces": { - "north": {"uv": [1, 15, 15, 16], "texture": "#0"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "up": {"uv": [1, 15, 15, 16], "rotation": 180, "texture": "#0"}, - "down": {"uv": [1, 0, 15, 1], "texture": "#0"} + "north": {"uv": [1, 15, 15, 16], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [15, 15, 1, 16], "texture": "#1"}, + "down": {"uv": [15, 15, 1, 16], "texture": "#1"} } }, { "name": "interface", - "from": [3, 3, 15.9], - "to": [13, 13, 14.91], + "from": [3, 3, 15.95], + "to": [13, 13, 16], "faces": { "north": {"uv": [3, 3, 13, 13], "texture": "#2"}, "east": {"uv": [3, 3, 2, 13], "texture": "#2"}, + "south": {"uv": [3, 3, 13, 13], "texture": "#0"}, "west": {"uv": [13, 3, 14, 13], "texture": "#2"}, "up": {"uv": [3, 2, 13, 3], "rotation": 180, "texture": "#2"}, "down": {"uv": [3, 13, 13, 14], "texture": "#2"} } + }, + { + "name": "bottom", + "from": [0, 0, 15], + "to": [16, 3, 16], + "faces": { + "north": {"uv": [0, 13, 16, 16], "texture": "#1"}, + "east": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "south": {"uv": [0, 13, 16, 16], "texture": "#0"}, + "west": {"uv": [0, 13, 1, 16], "texture": "#0"}, + "up": {"uv": [0, 13, 16, 14], "texture": "#2"}, + "down": {"uv": [0, 15, 16, 16], "texture": "#0"} + } + }, + { + "name": "top", + "from": [0, 13, 15], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 16, 3], "texture": "#1"}, + "east": {"uv": [15, 0, 16, 3], "texture": "#0"}, + "south": {"uv": [0, 0, 16, 3], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "up": {"uv": [0, 0, 16, 1], "texture": "#0"}, + "down": {"uv": [0, 2, 16, 3], "texture": "#2"} + } + }, + { + "name": "east", + "from": [13, 3, 15], + "to": [16, 13, 16], + "faces": { + "north": {"uv": [0, 3, 3, 13], "texture": "#1"}, + "east": {"uv": [15, 3, 16, 13], "texture": "#0"}, + "south": {"uv": [13, 3, 16, 13], "texture": "#0"}, + "west": {"uv": [2, 3, 3, 13], "texture": "#2"} + } + }, + { + "name": "west", + "from": [0, 3, 15], + "to": [3, 13, 16], + "faces": { + "north": {"uv": [13, 3, 16, 13], "texture": "#1"}, + "east": {"uv": [13, 3, 14, 13], "texture": "#2"}, + "south": {"uv": [0, 3, 3, 13], "texture": "#0"}, + "west": {"uv": [0, 3, 1, 13], "texture": "#0"} + } } ], "display": { @@ -95,13 +136,13 @@ }, "firstperson_righthand": { "rotation": [-13, 155, 0], - "translation": [-3, 2.5, 5.75], - "scale": [0.4, 0.4, 0.4] + "translation": [-3.25, 2.5, 5.75], + "scale": [0.3, 0.3, 0.3] }, "firstperson_lefthand": { "rotation": [-13, 155, 0], - "translation": [-3, 2.5, 5.75], - "scale": [0.4, 0.4, 0.4] + "translation": [-3.25, 2.5, 5.75], + "scale": [0.3, 0.3, 0.3] }, "ground": { "rotation": [90, 0, 0], @@ -122,15 +163,18 @@ } }, "groups": [ - 0, { "name": "frame", "origin": [0, 0, 0], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [1, 2, 3, 4] + "children": [0, 1, 2, 3] }, - 5 + 4, + { + "name": "base", + "origin": [0, 0, 0], + "color": 0, + "children": [5, 6, 7, 8] + } ] } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/source_block.json b/forge/src/main/resources/assets/cccbridge/models/block/source_block.json index 6628a34..07fc0a2 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/source_block.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/source_block.json @@ -1,161 +1,12 @@ { - "credit": "By Sammy.K via Blockbench", - "parent": "minecraft:block/block", + "parent": "minecraft:block/cube", "textures": { - "0": "cccbridge:block/source_block_side", - "1": "cccbridge:block/st_block_top", - "particle": "cccbridge:block/source_block_side" - }, - "elements": [ - { - "name": "base", - "from": [1, 1, 1], - "to": [15, 15, 15], - "faces": { - "north": {"uv": [1, 1, 15, 15], "texture": "#0"}, - "east": {"uv": [1, 1, 15, 15], "texture": "#0"}, - "south": {"uv": [1, 1, 15, 15], "texture": "#0"}, - "west": {"uv": [1, 1, 15, 15], "texture": "#0"} - } - }, - { - "name": "sw", - "from": [0, 1, 15], - "to": [1, 15, 16], - "faces": { - "north": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "south": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "ew", - "from": [15, 1, 15], - "to": [16, 15, 16], - "faces": { - "north": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "south": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "wn", - "from": [0, 1, 0], - "to": [1, 15, 1], - "faces": { - "north": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 14], "texture": "#0"}, - "south": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "ne", - "from": [15, 1, 0], - "to": [16, 15, 1], - "faces": { - "north": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "east": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "south": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "west": {"uv": [0, 1, 1, 15], "texture": "#0"} - } - }, - { - "name": "top", - "from": [0, 15, 0], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "south": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#0"} - } - }, - { - "name": "bottom", - "from": [0, 0, 0], - "to": [16, 1, 16], - "faces": { - "north": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "east": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "south": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#0"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#1"} - } - }, - { - "name": "west", - "from": [0, 4, 4], - "to": [1, 12, 12], - "faces": { - "north": {"uv": [4, 4, 5, 12], "texture": "#0"}, - "south": {"uv": [11, 4, 12, 12], "texture": "#0"}, - "west": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "up": {"uv": [4, 4, 12, 5], "rotation": 90, "texture": "#0"}, - "down": {"uv": [4, 11, 12, 12], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "north", - "from": [4, 4, 0], - "to": [12, 12, 1], - "faces": { - "north": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "east": {"uv": [4, 4, 5, 12], "texture": "#0"}, - "west": {"uv": [11, 4, 12, 12], "texture": "#0"}, - "up": {"uv": [4, 4, 12, 5], "rotation": 180, "texture": "#0"}, - "down": {"uv": [4, 11, 12, 12], "rotation": 180, "texture": "#0"} - } - }, - { - "name": "east", - "from": [15, 4, 4], - "to": [16, 12, 12], - "faces": { - "north": {"uv": [11, 4, 12, 12], "texture": "#0"}, - "east": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "south": {"uv": [4, 4, 5, 12], "texture": "#0"}, - "up": {"uv": [4, 4, 12, 5], "rotation": 270, "texture": "#0"}, - "down": {"uv": [4, 11, 12, 12], "rotation": 90, "texture": "#0"} - } - }, - { - "name": "south", - "from": [4, 4, 15], - "to": [12, 12, 16], - "faces": { - "east": {"uv": [11, 4, 12, 12], "texture": "#0"}, - "south": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "west": {"uv": [4, 4, 5, 12], "texture": "#0"}, - "up": {"uv": [4, 4, 12, 5], "texture": "#0"}, - "down": {"uv": [4, 11, 12, 12], "texture": "#0"} - } - } - ], - "groups": [ - 0, - { - "name": "frame", - "origin": [0, 0, 0], - "color": 0, - "children": [1, 2, 3, 4] - }, - { - "name": "plates", - "origin": [0, 0, 0], - "color": 0, - "children": [5, 6] - }, - { - "name": "connections", - "origin": [0, 0, 0], - "color": 0, - "children": [7, 8, 9, 10] - } - ] -} \ No newline at end of file + "down": "cccbridge:block/source_target_block_vertical", + "east": "cccbridge:block/source_block_horizontal", + "north": "cccbridge:block/source_block_horizontal", + "particle": "cccbridge:block/source_block_horizontal", + "south": "cccbridge:block/source_block_horizontal", + "up": "cccbridge:block/source_target_block_vertical", + "west": "cccbridge:block/source_block_horizontal" + } + } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/block/target_block.json b/forge/src/main/resources/assets/cccbridge/models/block/target_block.json index 451c149..3d3adcc 100644 --- a/forge/src/main/resources/assets/cccbridge/models/block/target_block.json +++ b/forge/src/main/resources/assets/cccbridge/models/block/target_block.json @@ -1,221 +1,12 @@ { - "credit": "By Sammy.K via Blockbench", - "parent": "minecraft:block/block", + "parent": "minecraft:block/cube", "textures": { - "0": "cccbridge:block/target_block_side", - "1": "cccbridge:block/st_block_top", - "particle": "cccbridge:block/target_block_side" - }, - "elements": [ - { - "name": "sw", - "from": [0, 1, 15], - "to": [1, 15, 16], - "faces": { - "north": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "south": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "ew", - "from": [15, 1, 15], - "to": [16, 15, 16], - "faces": { - "north": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "east": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "south": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "wn", - "from": [0, 1, 0], - "to": [1, 15, 1], - "faces": { - "north": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 14], "texture": "#0"}, - "south": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "west": {"uv": [15, 1, 16, 15], "texture": "#0"} - } - }, - { - "name": "ne", - "from": [15, 1, 0], - "to": [16, 15, 1], - "faces": { - "north": {"uv": [0, 1, 1, 15], "texture": "#0"}, - "east": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "south": {"uv": [15, 1, 16, 15], "texture": "#0"}, - "west": {"uv": [0, 1, 1, 15], "texture": "#0"} - } - }, - { - "name": "top", - "from": [0, 15, 0], - "to": [16, 16, 16], - "faces": { - "north": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "east": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "south": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 16, 1], "texture": "#0"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#0"} - } - }, - { - "name": "bottom", - "from": [0, 0, 0], - "to": [16, 1, 16], - "faces": { - "north": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "east": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "south": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "west": {"uv": [0, 15, 16, 16], "texture": "#0"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#0"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#1"} - } - }, - { - "name": "west", - "from": [2, 12, 12], - "to": [1, 4, 4], - "faces": { - "north": {"uv": [3, 4, 4, 12], "texture": "#0"}, - "south": {"uv": [12, 4, 13, 12], "texture": "#0"}, - "west": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "up": {"uv": [4, 3, 12, 4], "rotation": 90, "texture": "#0"}, - "down": {"uv": [4, 12, 12, 13], "rotation": 270, "texture": "#0"} - } - }, - { - "name": "north", - "from": [12, 12, 2], - "to": [4, 4, 1], - "faces": { - "north": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "east": {"uv": [3, 4, 4, 12], "texture": "#0"}, - "west": {"uv": [12, 4, 13, 12], "texture": "#0"}, - "up": {"uv": [4, 3, 12, 4], "rotation": 180, "texture": "#0"}, - "down": {"uv": [4, 12, 12, 13], "rotation": 180, "texture": "#0"} - } - }, - { - "name": "east", - "from": [15, 12, 12], - "to": [14, 4, 4], - "faces": { - "north": {"uv": [12, 4, 13, 12], "texture": "#0"}, - "east": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "south": {"uv": [3, 4, 4, 12], "texture": "#0"}, - "up": {"uv": [4, 3, 12, 4], "rotation": 270, "texture": "#0"}, - "down": {"uv": [4, 12, 12, 13], "rotation": 90, "texture": "#0"} - } - }, - { - "name": "south", - "from": [12, 12, 15], - "to": [4, 4, 14], - "faces": { - "east": {"uv": [12, 4, 13, 12], "texture": "#0"}, - "south": {"uv": [4, 4, 12, 12], "texture": "#0"}, - "west": {"uv": [3, 4, 4, 12], "texture": "#0"}, - "up": {"uv": [4, 3, 12, 4], "texture": "#0"}, - "down": {"uv": [4, 12, 12, 13], "texture": "#0"} - } - }, - { - "name": "bottom", - "from": [1, 1, 1], - "to": [15, 4, 15], - "faces": { - "north": {"uv": [1, 12, 15, 15], "texture": "#0"}, - "east": {"uv": [1, 12, 15, 15], "texture": "#0"}, - "south": {"uv": [1, 12, 15, 15], "texture": "#0"}, - "west": {"uv": [1, 12, 15, 15], "texture": "#0"} - } - }, - { - "name": "top", - "from": [1, 12, 1], - "to": [15, 15, 15], - "faces": { - "north": {"uv": [1, 1, 15, 4], "texture": "#0"}, - "east": {"uv": [1, 1, 15, 4], "texture": "#0"}, - "south": {"uv": [1, 1, 15, 4], "texture": "#0"}, - "west": {"uv": [1, 1, 15, 4], "texture": "#0"} - } - }, - { - "name": "wn", - "from": [1, 4, 1], - "to": [4, 12, 4], - "faces": { - "north": {"uv": [12, 4, 15, 12], "texture": "#0"}, - "west": {"uv": [1, 4, 4, 12], "texture": "#0"} - } - }, - { - "name": "ne", - "from": [12, 4, 1], - "to": [15, 12, 4], - "faces": { - "north": {"uv": [1, 4, 4, 12], "texture": "#0"}, - "east": {"uv": [12, 4, 15, 12], "texture": "#0"} - } - }, - { - "name": "es", - "from": [12, 4, 12], - "to": [15, 12, 15], - "faces": { - "east": {"uv": [1, 4, 4, 12], "texture": "#0"}, - "south": {"uv": [12, 4, 15, 12], "texture": "#0"} - } - }, - { - "name": "sw", - "from": [1, 4, 12], - "to": [4, 12, 15], - "faces": { - "south": {"uv": [1, 4, 4, 12], "texture": "#0"}, - "west": {"uv": [12, 4, 15, 12], "texture": "#0"} - } - } - ], - "groups": [ - { - "name": "frame", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [0, 1, 2, 3] - }, - { - "name": "plates", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [4, 5] - }, - { - "name": "connections", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [6, 7, 8, 9] - }, - { - "name": "group", - "origin": [0, 0, 0], - "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, - "children": [10, 11, 12, 13, 14, 15] - } - ] -} \ No newline at end of file + "down": "cccbridge:block/source_target_block_vertical", + "east": "cccbridge:block/target_block_horizontal", + "north": "cccbridge:block/target_block_horizontal", + "particle": "cccbridge:block/target_block_horizontal", + "south": "cccbridge:block/target_block_horizontal", + "up": "cccbridge:block/source_target_block_vertical", + "west": "cccbridge:block/target_block_horizontal" + } + } \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/entity/animatronic.bbmodel b/forge/src/main/resources/assets/cccbridge/models/entity/animatronic.bbmodel new file mode 100644 index 0000000..0536de5 --- /dev/null +++ b/forge/src/main/resources/assets/cccbridge/models/entity/animatronic.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.5","model_format":"modded_entity","box_uv":true},"name":"animatronic","model_identifier":"animatronic","modded_entity_version":"1.17","modded_entity_flip_y":true,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":64,"height":64},"elements":[{"name":"head","box_uv":true,"rescale":false,"locked":false,"from":[-5,19,-7.500000000000002],"to":[5,29,2.5000000000000004],"autouv":0,"color":0,"origin":[0,6,-2.4999999999999996],"faces":{"north":{"uv":[10.000000000000002,10.000000000000002,20,20],"texture":0},"east":{"uv":[0,10.000000000000002,10.000000000000002,20],"texture":0},"south":{"uv":[30.000000000000004,10.000000000000002,40,20],"texture":0},"west":{"uv":[20,10.000000000000002,30,20],"texture":0},"up":{"uv":[20,10.000000000000002,10,0],"texture":0},"down":{"uv":[30,0,20,10.000000000000002],"texture":0}},"type":"cube","uuid":"983326be-c52f-6d62-e8f9-2fc169cb7792"},{"name":"body","box_uv":true,"rescale":false,"locked":false,"from":[-3,10,-4.500000000000002],"to":[3,18,-0.5],"autouv":0,"color":9,"origin":[0,6,-2.4999999999999996],"uv_offset":[0,20],"faces":{"north":{"uv":[4.000000000000002,24,10.000000000000002,32],"texture":0},"east":{"uv":[0,24,4.000000000000002,32],"texture":0},"south":{"uv":[14.000000000000004,24,20.000000000000004,32],"texture":0},"west":{"uv":[10.000000000000002,24,14.000000000000004,32],"texture":0},"up":{"uv":[10.000000000000002,24,4.000000000000002,20],"texture":0},"down":{"uv":[16,20,10,24],"texture":0}},"type":"cube","uuid":"53b35782-90ec-ae42-69f9-03af3c6eee02"},{"name":"shoulder","box_uv":true,"rescale":false,"locked":false,"from":[-6,15.5,-2.9999999999999996],"to":[6,16.5,-1.9999999999999996],"autouv":0,"color":4,"origin":[0,6,-2.4999999999999996],"uv_offset":[26,20],"faces":{"north":{"uv":[27,21,39,22],"texture":0},"east":{"uv":[26,21,27,22],"texture":0},"south":{"uv":[40,21,52,22],"texture":0},"west":{"uv":[39,21,40,22],"texture":0},"up":{"uv":[39,21,27,20],"texture":0},"down":{"uv":[51,20,39,21],"texture":0}},"type":"cube","uuid":"68f5c928-414f-4de7-09b2-46ea4d076351"},{"name":"right","box_uv":true,"rescale":false,"locked":false,"from":[5,6,-3.4999999999999996],"to":[7,18,-1.4999999999999996],"autouv":0,"color":4,"origin":[0,6,-2.4999999999999996],"uv_offset":[0,32],"faces":{"north":{"uv":[2,34,4,46],"texture":0},"east":{"uv":[0,34,2,46],"texture":0},"south":{"uv":[6,34,8,46],"texture":0},"west":{"uv":[4,34,6,46],"texture":0},"up":{"uv":[4,34,2,32],"texture":0},"down":{"uv":[6,32,4,34],"texture":0}},"type":"cube","uuid":"d43891b0-0785-c032-0498-f7f5719adaf6"},{"name":"left","box_uv":true,"rescale":false,"locked":false,"from":[-7,6,-3.4999999999999996],"to":[-5,18,-1.4999999999999996],"autouv":0,"color":4,"origin":[0,6,-2.4999999999999996],"uv_offset":[20,20],"faces":{"north":{"uv":[22,22,24,34],"texture":0},"east":{"uv":[20,22,22,34],"texture":0},"south":{"uv":[26,22,28,34],"texture":0},"west":{"uv":[24,22,26,34],"texture":0},"up":{"uv":[24,22,22,20],"texture":0},"down":{"uv":[26,20,24,22],"texture":0}},"type":"cube","uuid":"3545fcdc-da31-0c11-27f1-bd071718f1c2"},{"name":"neck","box_uv":true,"rescale":false,"locked":false,"from":[-1,18,-3.4999999999999996],"to":[1,20,-1.4999999999999996],"autouv":0,"color":4,"origin":[0,6,-2.4999999999999996],"uv_offset":[8,32],"faces":{"north":{"uv":[10,34,12,36],"texture":0},"east":{"uv":[8,34,10,36],"texture":0},"south":{"uv":[14,34,16,36],"texture":0},"west":{"uv":[12,34,14,36],"texture":0},"up":{"uv":[12,34,10,32],"texture":0},"down":{"uv":[14,32,12,34],"texture":0}},"type":"cube","uuid":"58c87944-0655-3c67-4c79-e25cf0ecc2aa"}],"outliner":[{"name":"root","origin":[0,14,0],"color":0,"uuid":"138ba760-ee55-83ad-2ae1-86dc0f45a078","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":[{"name":"head","origin":[0,20,-2.4999999999999996],"color":0,"uuid":"b63c1834-bb3b-e14d-d441-411f4061f7bd","export":true,"mirror_uv":false,"isOpen":false,"locked":false,"visibility":true,"autouv":0,"children":["983326be-c52f-6d62-e8f9-2fc169cb7792"]},"58c87944-0655-3c67-4c79-e25cf0ecc2aa","53b35782-90ec-ae42-69f9-03af3c6eee02","68f5c928-414f-4de7-09b2-46ea4d076351",{"name":"rightarm","origin":[6,16,-2.4999999999999996],"color":0,"uuid":"b96240a4-e136-4252-e14e-8a9e40a7912a","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["d43891b0-0785-c032-0498-f7f5719adaf6"]},{"name":"leftarm","origin":[-6,16,-2.4999999999999996],"color":0,"uuid":"651fbc5b-c499-0db1-89a2-b7c8b2a63a0d","export":true,"mirror_uv":false,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["3545fcdc-da31-0c11-27f1-bd071718f1c2"]}]}],"textures":[{"path":"C:\\Users\\Sammy\\Documents\\GitHub\\cccbridge\\forge\\src\\main\\resources\\assets\\cccbridge\\textures\\entity\\animatronic\\body.png","name":"body.png","folder":"block","namespace":"","id":"0","particle":false,"render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"ce0d31b2-e9e8-fdac-090c-6229a474c760","relative_path":"../../../textures/entity/animatronic/body.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABJZJREFUeF7tWU1IVFEUvlNmKqipOWr0RxJm1sIiN4kgYgSRi1ZREC1bBCIU7SLaBVEIFbSJaBFtatHPKtpYbYxwUaYShmSgjqmlMFlJE9+VM5y5c9+8e8eZ4c2bdzfPO++89875znfO+d4zJAxX2+GTMZgWl22WV1TX7pTH+dkJefwT/Z5wJze7wbePQoaPzqqZsRMAAEEh8H8VvxOcWre4UQJBIJjY5R0A7d3nY7rgCQkCgdihgqTavXl5yxj8bFLA2AkAsKmxQfpSX1Qvplem40dy8Mf4lPyT7Jwch13eAdBz6nqMZ1UHAliA5ZR9zoKnDy8Yg+8JBqgA6JzyNQC8BJzKwNclwJugE/1pJJo0y7zrAQU/Bn0rhDIdGDVHNyVoapdtwRTKNLVJLueLYgzpFB41OQRjq/BUJcjv5XQ/taliH5lfkPI6281SAsCVm67D24w3rgRNFKMKEN/nQjGGdAJHdVwVONxJlS2kBJ2CJxZwxaiCkEvFqAWACx3u8OXhBXGwcUUcD1ckCMFnkUXxfrxIXG2pSpDCqQLzimSOl4CTs3CUSmBPU6sMEC9CfOFarNGxoZQvQ/QMXUk5lV5OegB1bB0Ia22CBBTdW3e/VMoy6wCkMwbD1VVxFvCObfNBxHRc5kQHkDM0wnB0+9RF5UC0t/0k5hkhpL7W7qjbEivZUCmW//4U/BguLxeRpSWhHse+jWjf6z/374t9/TIntu+qEXUdx0RF67XQq96GGPZY+G1m4IWAzc9lISpLhDh09ow8R7/jbxv7rv4p628MSRc0bW2OqcHTXgfC65FB7UMXhy7Jj6jv7j+QQSBQ24AoOQQi3Y8Ao98BGBaeYQtCkvNrZQAyj+zyBRAo+N29H62zpLI0k/uMMyDvAADldYiOtvVIcXN67okV4M8vro/bExOIojjhOQZQzcM5NL2WurCYjf4SA82dIvq4TxzY1hlvfOgFZId+oFtXjkzGG5d6Pp0atUI/DeNQKgAmbvSJo+3OANSWlUqw6Ijn3zsXTWp4Hz6tNsD9e2u8yQAOHDHgZnG3pD/tMQL5IgaoIPR1TMqRxjs+XQcgTty1H1VpJNb4EskAGm+4CgFjDc9E5PF2R7m4M1Ya3/NR6MQAejr1AE9PAWqCamAAgMAAzbkIQoBODND1ACoBMMN2ThunMk3DBAYgKMoqAqbsAwAsVQnqGMABIPHDffMkAGptIzBiAA9e1wNU4AEALZKxtPfkFCDnoNPpb2hyaHclOFUvOL4DqD2A9tADntMB5By0u4umNgZAp/vxHE8CgMzztzA4ymu3q3/1X94plqe0vZuz6vmkV1TKFAHhewB0Ly9e1u62GXazD3EAeOB0odealltAtudlCVAP4IqNlUBe17gbIAk9QDX24tx2C8j2fAIA6vgqGAAINXxr48uL2t02w272kgFq4HRRwQCgokQaviBKAGNQ1/zwG4AoiDHIM47A+Vj02uurW03bnvf1jDcBIwDABCU/2wQM8HN2TWILGGCCkp9tAgb4ObsmsQUMMEHJzzYBA/ycXZPYAgaYoORnm4ABfs6uSWwFz4D/tfP8bichFEQAAAAASUVORK5CYII="}]} \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/models/item/animatronic_block.json b/forge/src/main/resources/assets/cccbridge/models/item/animatronic_block.json new file mode 100644 index 0000000..b29148c --- /dev/null +++ b/forge/src/main/resources/assets/cccbridge/models/item/animatronic_block.json @@ -0,0 +1,168 @@ +{ + "credit": "Made with Blockbench", + "parent": "cccbridge:block/animatronic_block", + "texture_size": [64, 64], + "textures": { + "0": "cccbridge:block/animatronic_block", + "1": "cccbridge:entity/animatronic/body", + "2": "cccbridge:entity/animatronic/face_happy", + "particle": "cccbridge:block/animatronic_block" + }, + "elements": [ + { + "name": "base", + "from": [7.5, 2, 7.5], + "to": [8.5, 10, 8.5], + "faces": { + "north": {"uv": [6, 7, 6.5, 11], "texture": "#0"}, + "east": {"uv": [6.5, 7, 7, 11], "texture": "#0"}, + "south": {"uv": [7, 7, 7.5, 11], "texture": "#0"}, + "west": {"uv": [7.5, 7, 8, 11], "texture": "#0"}, + "up": {"uv": [8.5, 4.5, 8, 4], "texture": "#0"}, + "down": {"uv": [8.5, 4.5, 8, 5], "texture": "#0"} + } + }, + { + "name": "stick", + "from": [2, 0, 2], + "to": [14, 2, 14], + "faces": { + "north": {"uv": [6, 0, 12, 1], "texture": "#0"}, + "east": {"uv": [6, 1, 12, 2], "texture": "#0"}, + "south": {"uv": [6, 2, 12, 3], "texture": "#0"}, + "west": {"uv": [6, 3, 12, 4], "texture": "#0"}, + "up": {"uv": [6, 6, 0, 0], "texture": "#0"}, + "down": {"uv": [6, 6, 0, 12], "texture": "#0"} + } + }, + { + "name": "head", + "from": [3, 14, 0.5], + "to": [13, 24, 10.5], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 14, 5.5]}, + "faces": { + "north": {"uv": [5, 2.5, 7.5, 5], "texture": "#1"}, + "east": {"uv": [2.5, 2.5, 5, 5], "texture": "#1"}, + "south": {"uv": [0, 2.5, 2.5, 5], "texture": "#1"}, + "west": {"uv": [7.5, 2.5, 10, 5], "texture": "#1"}, + "up": {"uv": [5, 2.5, 2.5, 0], "rotation": 90, "texture": "#1"}, + "down": {"uv": [7.5, 0, 5, 2.5], "rotation": 270, "texture": "#1"} + } + }, + { + "name": "face", + "from": [13.23223, 14, 0.45406], + "to": [13.23223, 24, 10.45406], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 14, 5.5]}, + "faces": { + "east": {"uv": [2.5, 2.5, 5, 5], "texture": "#2"} + } + }, + { + "name": "neck", + "from": [7, 13, 4.5], + "to": [9, 15, 6.5], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, -2.5]}, + "faces": { + "north": {"uv": [2.5, 8.5, 3, 9], "texture": "#1"}, + "east": {"uv": [2, 8.5, 2.5, 9], "texture": "#1"}, + "south": {"uv": [3.5, 8.5, 4, 9], "texture": "#1"}, + "west": {"uv": [3, 8.5, 3.5, 9], "texture": "#1"}, + "up": {"uv": [3, 8.5, 2.5, 8], "texture": "#1"}, + "down": {"uv": [3.5, 8, 3, 8.5], "texture": "#1"} + } + }, + { + "name": "body", + "from": [5, 5, 3.5], + "to": [11, 13, 7.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 10, 7.5]}, + "faces": { + "north": {"uv": [1, 6, 2.5, 8], "texture": "#1"}, + "east": {"uv": [0, 6, 1, 8], "texture": "#1"}, + "south": {"uv": [3.5, 6, 5, 8], "texture": "#1"}, + "west": {"uv": [2.5, 6, 3.5, 8], "texture": "#1"}, + "up": {"uv": [2.5, 6, 1, 5], "texture": "#1"}, + "down": {"uv": [4, 5, 2.5, 6], "texture": "#1"} + } + }, + { + "name": "shoulder", + "from": [2, 10.5, 5], + "to": [14, 11.5, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 1, -2.5]}, + "faces": { + "north": {"uv": [6.75, 5.25, 9.75, 5.5], "texture": "#1"}, + "east": {"uv": [6.5, 5.25, 6.75, 5.5], "texture": "#1"}, + "south": {"uv": [10, 5.25, 13, 5.5], "texture": "#1"}, + "west": {"uv": [9.75, 5.25, 10, 5.5], "texture": "#1"}, + "up": {"uv": [9.75, 5.25, 6.75, 5], "texture": "#1"}, + "down": {"uv": [12.75, 5, 9.75, 5.25], "texture": "#1"} + } + }, + { + "name": "right", + "from": [13, 1, 4.5], + "to": [15, 13, 6.5], + "rotation": {"angle": 22.5, "axis": "z", "origin": [13, 11, 5.5]}, + "faces": { + "north": {"uv": [0.5, 8.5, 1, 11.5], "texture": "#1"}, + "east": {"uv": [0, 8.5, 0.5, 11.5], "texture": "#1"}, + "south": {"uv": [1.5, 8.5, 2, 11.5], "texture": "#1"}, + "west": {"uv": [1, 8.5, 1.5, 11.5], "texture": "#1"}, + "up": {"uv": [1, 8.5, 0.5, 8], "texture": "#1"}, + "down": {"uv": [1.5, 8, 1, 8.5], "texture": "#1"} + } + }, + { + "name": "left", + "from": [1, 1, 4.5], + "to": [3, 13, 6.5], + "rotation": {"angle": 45, "axis": "x", "origin": [3, 11, 5.5]}, + "faces": { + "north": {"uv": [5.5, 5.5, 6, 8.5], "texture": "#1"}, + "east": {"uv": [5, 5.5, 5.5, 8.5], "texture": "#1"}, + "south": {"uv": [6.5, 5.5, 7, 8.5], "texture": "#1"}, + "west": {"uv": [6, 5.5, 6.5, 8.5], "texture": "#1"}, + "up": {"uv": [6, 5.5, 5.5, 5], "texture": "#1"}, + "down": {"uv": [6.5, 5, 6, 5.5], "texture": "#1"} + } + } + ], + "groups": [ + { + "name": "VoxelShapes", + "origin": [0, 0, 0], + "color": 0, + "children": [0, 1] + }, + { + "name": "root", + "origin": [0, 14, 0], + "color": 0, + "children": [ + { + "name": "head", + "origin": [0, 20, -2.5], + "color": 0, + "children": [2, 3] + }, + 4, + 5, + 6, + { + "name": "rightarm", + "origin": [6, 16, -2.5], + "color": 0, + "children": [7] + }, + { + "name": "leftarm", + "origin": [-6, 16, -2.5], + "color": 0, + "children": [8] + } + ] + } + ] +} \ No newline at end of file diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/animatronic_block.png b/forge/src/main/resources/assets/cccbridge/textures/block/animatronic_block.png new file mode 100644 index 0000000..0f49242 Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/block/animatronic_block.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/background.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/background.png index 0190758..5fd2852 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/background.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/background.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/connector.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/connector.png deleted file mode 100644 index e03a70f..0000000 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/connector.png and /dev/null differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/0.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/0.png new file mode 100644 index 0000000..1659e4a Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/0.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/1.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/1.png index 1352829..c4bc77f 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/1.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/1.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/10.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/10.png index 6cc6c9f..5af035d 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/10.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/10.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/11.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/11.png index 46ab109..0749a26 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/11.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/11.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/12.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/12.png index 8e34b43..f2d77e8 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/12.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/12.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/13.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/13.png index 778bae2..714be72 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/13.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/13.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/14.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/14.png index ee66cec..7bd8c3a 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/14.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/14.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/15.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/15.png index 987ce11..04718aa 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/15.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/15.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/16.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/16.png index 80a0ba3..b1f477b 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/16.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/16.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/2.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/2.png index 952f152..461eef4 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/2.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/2.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/3.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/3.png index 1c9e812..54ab01d 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/3.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/3.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/4.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/4.png index b34f489..30b66b4 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/4.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/4.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/5.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/5.png index b352807..b9dcb9b 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/5.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/5.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/6.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/6.png index 48d9b32..f8df71d 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/6.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/6.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/7.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/7.png index fa74d68..f4934d3 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/7.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/7.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/8.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/8.png index 721b56b..2045d2e 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/8.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/8.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/9.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/9.png index 8c7c65f..e91ce35 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/9.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/face/9.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_front.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_front.png index e46f886..4749d17 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_front.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_front.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_side.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_side.png index 7b53360..112891a 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_side.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_side.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_top.png b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_top.png index 66e09d7..95a46cb 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_top.png and b/forge/src/main/resources/assets/cccbridge/textures/block/redrouter/redrouter_top.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/scroller/cage.png b/forge/src/main/resources/assets/cccbridge/textures/block/scroller/cage.png index 0aa9553..6d0ea5e 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/scroller/cage.png and b/forge/src/main/resources/assets/cccbridge/textures/block/scroller/cage.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/scroller/interface.png b/forge/src/main/resources/assets/cccbridge/textures/block/scroller/interface.png index 92f988d..9272c13 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/scroller/interface.png and b/forge/src/main/resources/assets/cccbridge/textures/block/scroller/interface.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_front.png b/forge/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_front.png index fccbab9..c97a359 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_front.png and b/forge/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_front.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_side.png b/forge/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_side.png index fe1df09..bcc8c24 100644 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_side.png and b/forge/src/main/resources/assets/cccbridge/textures/block/scroller/scroller_side.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png b/forge/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png new file mode 100644 index 0000000..df14c26 Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png.mcmeta b/forge/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png.mcmeta new file mode 100644 index 0000000..df5ea39 --- /dev/null +++ b/forge/src/main/resources/assets/cccbridge/textures/block/source_block_horizontal.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": true, + "frametime": 32 + } +} diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/source_block_side.png b/forge/src/main/resources/assets/cccbridge/textures/block/source_block_side.png deleted file mode 100644 index a2d8621..0000000 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/source_block_side.png and /dev/null differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/source_target_block_vertical.png b/forge/src/main/resources/assets/cccbridge/textures/block/source_target_block_vertical.png new file mode 100644 index 0000000..63aecd8 Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/block/source_target_block_vertical.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/st_block_top.png b/forge/src/main/resources/assets/cccbridge/textures/block/st_block_top.png deleted file mode 100644 index 588647a..0000000 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/st_block_top.png and /dev/null differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/target_block_horizontal.png b/forge/src/main/resources/assets/cccbridge/textures/block/target_block_horizontal.png new file mode 100644 index 0000000..8da7ee6 Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/block/target_block_horizontal.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/block/target_block_side.png b/forge/src/main/resources/assets/cccbridge/textures/block/target_block_side.png deleted file mode 100644 index f84c5b1..0000000 Binary files a/forge/src/main/resources/assets/cccbridge/textures/block/target_block_side.png and /dev/null differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/body.png b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/body.png new file mode 100644 index 0000000..9ede837 Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/body.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_creepy.png b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_creepy.png new file mode 100644 index 0000000..e0a1621 Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_creepy.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_happy.png b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_happy.png new file mode 100644 index 0000000..3bb8a80 Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_happy.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_normal.png b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_normal.png new file mode 100644 index 0000000..db0d54d Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_normal.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_question.png b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_question.png new file mode 100644 index 0000000..a38034d Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_question.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_sad.png b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_sad.png new file mode 100644 index 0000000..5287c06 Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/entity/animatronic/face_sad.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/gui/advancements/backgrounds/luarocks.png b/forge/src/main/resources/assets/cccbridge/textures/gui/advancements/backgrounds/luarocks.png new file mode 100644 index 0000000..aafd6fb Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/gui/advancements/backgrounds/luarocks.png differ diff --git a/forge/src/main/resources/assets/cccbridge/textures/painting/funny_redrouters.png b/forge/src/main/resources/assets/cccbridge/textures/painting/funny_redrouters.png new file mode 100644 index 0000000..4f8c020 Binary files /dev/null and b/forge/src/main/resources/assets/cccbridge/textures/painting/funny_redrouters.png differ diff --git a/forge/src/main/resources/data/cccbridge/advancements/place_animatronic.json b/forge/src/main/resources/data/cccbridge/advancements/place_animatronic.json new file mode 100644 index 0000000..6ba83a0 --- /dev/null +++ b/forge/src/main/resources/data/cccbridge/advancements/place_animatronic.json @@ -0,0 +1,21 @@ +{ + "display": { + "title": "Five Nights in Minecraft", + "description": "A very normal Animatronic, what could go wrong!", + "icon": { "item": "cccbridge:animatronic_block" }, + "frame": "task", + "show_toast": false, + "announce_to_chat": true, + "hidden": false, + "background": "cccbridge:textures/gui/advancements/backgrounds/luarocks.png" + }, + "criteria": { + "placed_animatronic": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "cccbridge:animatronic_block" + } + } + }, + "parent": "cccbridge:place_redrouter" +} \ No newline at end of file diff --git a/forge/src/main/resources/data/cccbridge/advancements/place_redrouter.json b/forge/src/main/resources/data/cccbridge/advancements/place_redrouter.json index c350da6..e64ae8a 100644 --- a/forge/src/main/resources/data/cccbridge/advancements/place_redrouter.json +++ b/forge/src/main/resources/data/cccbridge/advancements/place_redrouter.json @@ -6,11 +6,11 @@ "frame": "task", "show_toast": false, "announce_to_chat": true, - "hidden": true, - "background": "minecraft:textures/gui/advancements/backgrounds/stone.png" + "hidden": false, + "background": "cccbridge:textures/gui/advancements/backgrounds/luarocks.png" }, "criteria": { - "c1": { + "placed_redrouter": { "trigger": "minecraft:placed_block", "conditions": { "block": "cccbridge:redrouter_block" diff --git a/forge/src/main/resources/data/cccbridge/loot_tables/blocks/animatronic_block.json b/forge/src/main/resources/data/cccbridge/loot_tables/blocks/animatronic_block.json new file mode 100644 index 0000000..c7bfd1f --- /dev/null +++ b/forge/src/main/resources/data/cccbridge/loot_tables/blocks/animatronic_block.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "cccbridge:animatronic_block" + } + ] + } + ] +} \ No newline at end of file diff --git a/forge/src/main/resources/data/cccbridge/recipes/animatronic_block.json b/forge/src/main/resources/data/cccbridge/recipes/animatronic_block.json new file mode 100644 index 0000000..4666e68 --- /dev/null +++ b/forge/src/main/resources/data/cccbridge/recipes/animatronic_block.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " M ", + "HTH", + " R " + ], + "key": { + "M": { + "item": "computercraft:monitor_normal" + }, + "T": { + "item": "minecraft:leather_chestplate" + }, + "R": { + "item": "minecraft:redstone" + }, + "H": { + "item": "create:brass_hand" + } + }, + "result": { + "item": "cccbridge:animatronic_block", + "count": 1 + } +} \ No newline at end of file diff --git a/forge/src/main/resources/data/cccbridge/recipes/scroller_block.json b/forge/src/main/resources/data/cccbridge/recipes/scroller_block.json index 2c56350..0f45d9c 100644 --- a/forge/src/main/resources/data/cccbridge/recipes/scroller_block.json +++ b/forge/src/main/resources/data/cccbridge/recipes/scroller_block.json @@ -1,26 +1,26 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "BPB", - "BCB", - "BWB" + " C ", + "APA", + " R " ], "key": { - "B": { - "item": "create:brass_nugget" + "C": { + "item": "create:cogwheel" }, "P": { "item": "create:precision_mechanism" }, - "C": { - "item": "create:brass_casing" + "R": { + "item": "minecraft:redstone" }, - "W": { - "item": "computercraft:wired_modem" + "A": { + "item": "create:cut_asurine" } }, "result": { "item": "cccbridge:scroller_block", - "count": 2 + "count": 1 } } \ No newline at end of file diff --git a/forge/src/main/resources/data/cccbridge/recipes/source_block.json b/forge/src/main/resources/data/cccbridge/recipes/source_block.json index ae888d8..7690abc 100644 --- a/forge/src/main/resources/data/cccbridge/recipes/source_block.json +++ b/forge/src/main/resources/data/cccbridge/recipes/source_block.json @@ -1,25 +1,22 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "GDG", - "PCP", - "GAG" + "AGA", + "GQG", + "ARA" ], "key": { - "G": { - "item": "create:golden_sheet" - }, - "D": { - "item": "computercraft:disk" + "A": { + "item": "create:cut_asurine" }, - "P": { - "item": "minecraft:paper" + "G": { + "item": "minecraft:glass_pane" }, - "C": { - "item": "create:brass_casing" + "Q": { + "item": "create:rose_quartz_lamp" }, - "A": { - "item": "minecraft:glass" + "R": { + "item": "minecraft:redstone" } }, "result": { diff --git a/forge/src/main/resources/data/computercraft/lua/rom/autorun/cccbridge.lua b/forge/src/main/resources/data/computercraft/lua/rom/autorun/cccbridge.lua new file mode 100644 index 0000000..00f63b4 --- /dev/null +++ b/forge/src/main/resources/data/computercraft/lua/rom/autorun/cccbridge.lua @@ -0,0 +1,2 @@ +local motd = settings.get("motd.path") or "" +settings.set("motd.path", motd..":/rom/cccbridge_motd.txt") \ No newline at end of file diff --git a/forge/src/main/resources/data/computercraft/lua/rom/cccbridge_motd.txt b/forge/src/main/resources/data/computercraft/lua/rom/cccbridge_motd.txt new file mode 100644 index 0000000..46e47ad --- /dev/null +++ b/forge/src/main/resources/data/computercraft/lua/rom/cccbridge_motd.txt @@ -0,0 +1,9 @@ +Hello from CC:C Bridge! +You can connect a Display Link with a Source Block to have your own text on Display Boards. :o +Create. +EMOTIONAL DAMAGE! +Visit tweaked-programs.cc for detailed changelogs about CC:C Bridge! +CC:C Bridge stands for ComputerCraft:Create Bridge. +Scroller Panes are neat to configure values while being easy to integrate in your buildings. +RedRouter Blocks use a similar function set of the Redstone API, try it out! +Target Blocks can help you process Create related information. \ No newline at end of file diff --git a/forge/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json b/forge/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json deleted file mode 100644 index da135a1..0000000 --- a/forge/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "cccbridge:scroller_block" - ] -} \ No newline at end of file diff --git a/forge/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/forge/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index 7204cb3..2476a39 100644 --- a/forge/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/forge/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -3,6 +3,8 @@ "values": [ "cccbridge:source_block", "cccbridge:target_block", - "cccbridge:redrouter_block" + "cccbridge:redrouter_block", + "cccbridge:scroller_block", + "cccbridge:animatronic_block" ] } \ No newline at end of file diff --git a/forge/src/main/resources/data/minecraft/tags/blocks/needs_stone_tool.json b/forge/src/main/resources/data/minecraft/tags/blocks/needs_stone_tool.json deleted file mode 100644 index 24616d0..0000000 --- a/forge/src/main/resources/data/minecraft/tags/blocks/needs_stone_tool.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "cccbridge:source_block", - "cccbridge:target_block" - ] -} \ No newline at end of file diff --git a/forge/src/main/resources/data/minecraft/tags/painting_variant/placeable.json b/forge/src/main/resources/data/minecraft/tags/painting_variant/placeable.json new file mode 100644 index 0000000..2748f4a --- /dev/null +++ b/forge/src/main/resources/data/minecraft/tags/painting_variant/placeable.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "cccbridge:funny_redrouters" + ] +} \ No newline at end of file diff --git a/forge/src/main/resources/icon.png b/forge/src/main/resources/icon.png index 94d4e3e..6840705 100644 Binary files a/forge/src/main/resources/icon.png and b/forge/src/main/resources/icon.png differ diff --git a/forge/src/main/resources/iconHD.png b/forge/src/main/resources/iconHD.png index ef64978..6316164 100644 Binary files a/forge/src/main/resources/iconHD.png and b/forge/src/main/resources/iconHD.png differ