├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE │ ├── bug_fix.md │ └── feature_addition.md └── workflows │ └── gradle.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── FORGE_LICENSE.txt ├── LICENSE ├── README.md ├── build.gradle.kts ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src ├── generated └── resources │ ├── .cache │ └── cache │ ├── assets │ └── rubymod │ │ ├── lang │ │ └── en_us.json │ │ └── models │ │ └── item │ │ ├── centrifuge.json │ │ ├── ghost_water_bucket.json │ │ ├── logic_gate.json │ │ ├── poisoned_apple.json │ │ ├── ruby.json │ │ ├── ruby_axe.json │ │ ├── ruby_barrel.json │ │ ├── ruby_block.json │ │ ├── ruby_boots.json │ │ ├── ruby_button.json │ │ ├── ruby_carpet.json │ │ ├── ruby_chestplate.json │ │ ├── ruby_helmet.json │ │ ├── ruby_hoe.json │ │ ├── ruby_leggings.json │ │ ├── ruby_ore.json │ │ ├── ruby_pickaxe.json │ │ ├── ruby_pressure_plate.json │ │ ├── ruby_sheep_spawn_egg.json │ │ ├── ruby_shovel.json │ │ ├── ruby_slab.json │ │ ├── ruby_stairs.json │ │ ├── ruby_sword.json │ │ ├── ruby_wall.json │ │ └── ruby_wool.json │ └── data │ ├── forge │ └── tags │ │ ├── blocks │ │ ├── ores.json │ │ └── storage_blocks.json │ │ └── items │ │ ├── gems.json │ │ ├── ores.json │ │ └── storage_blocks.json │ ├── minecraft │ └── tags │ │ ├── blocks │ │ ├── beacon_base_blocks.json │ │ ├── buttons.json │ │ ├── carpets.json │ │ ├── pressure_plates.json │ │ ├── walls.json │ │ └── wool.json │ │ └── items │ │ ├── beacon_payment_items.json │ │ ├── buttons.json │ │ ├── carpets.json │ │ ├── walls.json │ │ └── wool.json │ └── rubymod │ ├── advancements │ └── recipes │ │ ├── food │ │ └── poisoned_apple.json │ │ └── ruby_tab │ │ ├── centrifuge.json │ │ ├── ghost_water_bucket.json │ │ ├── logic_gate.json │ │ ├── ruby.json │ │ ├── ruby_axe.json │ │ ├── ruby_barrel.json │ │ ├── ruby_block.json │ │ ├── ruby_boots.json │ │ ├── ruby_button.json │ │ ├── ruby_carpet_from_carpet.json │ │ ├── ruby_carpet_from_wool.json │ │ ├── ruby_chestplate.json │ │ ├── ruby_helmet.json │ │ ├── ruby_hoe.json │ │ ├── ruby_leggings.json │ │ ├── ruby_ore_blast.json │ │ ├── ruby_ore_smelt.json │ │ ├── ruby_pickaxe.json │ │ ├── ruby_pressure_plate.json │ │ ├── ruby_shovel.json │ │ ├── ruby_slab.json │ │ ├── ruby_stairs.json │ │ ├── ruby_sword.json │ │ ├── ruby_wall.json │ │ └── ruby_wool.json │ ├── loot_tables │ ├── blocks │ │ ├── centrifuge.json │ │ ├── logic_gate.json │ │ ├── ruby_barrel.json │ │ ├── ruby_block.json │ │ ├── ruby_button.json │ │ ├── ruby_carpet.json │ │ ├── ruby_ore.json │ │ ├── ruby_pressure_plate.json │ │ ├── ruby_slab.json │ │ ├── ruby_stairs.json │ │ ├── ruby_wall.json │ │ └── ruby_wool.json │ ├── entities │ │ └── ruby_sheep.json │ └── gameplay │ │ └── hero_of_the_village │ │ └── jeweler_gift.json │ └── recipes │ ├── centrifuge.json │ ├── ghost_water_bucket.json │ ├── logic_gate.json │ ├── poisoned_apple.json │ ├── ruby.json │ ├── ruby_axe.json │ ├── ruby_barrel.json │ ├── ruby_block.json │ ├── ruby_boots.json │ ├── ruby_button.json │ ├── ruby_carpet_from_carpet.json │ ├── ruby_carpet_from_wool.json │ ├── ruby_chestplate.json │ ├── ruby_helmet.json │ ├── ruby_hoe.json │ ├── ruby_leggings.json │ ├── ruby_ore_blast.json │ ├── ruby_ore_smelt.json │ ├── ruby_pickaxe.json │ ├── ruby_pressure_plate.json │ ├── ruby_shovel.json │ ├── ruby_slab.json │ ├── ruby_stairs.json │ ├── ruby_sword.json │ ├── ruby_wall.json │ └── ruby_wool.json └── main ├── kotlin └── com │ └── theonlytails │ └── rubymod │ ├── RubyMod.kt │ ├── blocks │ ├── Centrifuge.kt │ ├── LogicGate.kt │ ├── RubyBarrel.kt │ └── RubyCarpet.kt │ ├── client │ ├── gui │ │ └── RubyBarrelScreen.kt │ └── render │ │ ├── RubySheepRenderer.kt │ │ └── RubySheepWoolLayer.kt │ ├── containers │ └── RubyBarrelContainer.kt │ ├── datagen │ ├── BlockLootTablesGenerator.kt │ ├── BlockTagDataGenerator.kt │ ├── DataGenerators.kt │ ├── EntityLootTablesGenerator.kt │ ├── GiftLootTablesGenerator.kt │ ├── ItemModelsGenerator.kt │ ├── ItemTagGenerator.kt │ ├── LangGenerator.kt │ └── RecipesGenerator.kt │ ├── enchantments │ └── StingerEnchantment.kt │ ├── entities │ └── RubySheepEntity.kt │ ├── items │ ├── CustomSpawnEggItem.kt │ ├── PoisonedApple.kt │ ├── Ruby.kt │ └── RubyArmor.kt │ ├── registries │ ├── BiomeRegistry.kt │ ├── BlockRegistry.kt │ ├── ContainerTypeRegistry.kt │ ├── EnchantmentRegistry.kt │ ├── EntityTypeRegistry.kt │ ├── FeatureRegistry.kt │ ├── FluidRegistry.kt │ ├── ItemRegistry.kt │ ├── PotionRegistry.kt │ ├── TileEntityTypes.kt │ └── VillagerProfessionsRegistry.kt │ ├── tileentities │ └── RubyBarrelTileEntity.kt │ ├── trades │ ├── ItemsForRubyAndItemsTrade.kt │ ├── ItemsForRubyTrade.kt │ └── TradesRegisterer.kt │ ├── util │ ├── BrewingRecipes.kt │ ├── ExtensionStuff.kt │ └── enums │ │ ├── LogicGateModes.kt │ │ ├── RubyArmorMaterial.kt │ │ └── RubyItemTier.kt │ └── world │ ├── BiomeMaker.kt │ └── FeatureGen.kt └── resources ├── META-INF ├── accesstransformer.cfg └── mods.toml ├── assets └── rubymod │ ├── blockstates │ ├── centrifuge.json │ ├── ghost_water.json │ ├── ghost_water_block.json │ ├── logic_gate.json │ ├── ruby_barrel.json │ ├── ruby_block.json │ ├── ruby_button.json │ ├── ruby_carpet.json │ ├── ruby_ore.json │ ├── ruby_pressure_plate.json │ ├── ruby_slab.json │ ├── ruby_stairs.json │ ├── ruby_wall.json │ └── ruby_wool.json │ ├── models │ └── block │ │ ├── centrifuge.json │ │ ├── ghost_water.json │ │ ├── logic_gate.json │ │ ├── logic_gate_and.json │ │ ├── logic_gate_on.json │ │ ├── logic_gate_on_and.json │ │ ├── ruby_barrel.json │ │ ├── ruby_barrel_open.json │ │ ├── ruby_block.json │ │ ├── ruby_button.json │ │ ├── ruby_button_inventory.json │ │ ├── ruby_button_pressed.json │ │ ├── ruby_carpet.json │ │ ├── ruby_ore.json │ │ ├── ruby_pressure_plate.json │ │ ├── ruby_pressure_plate_down.json │ │ ├── ruby_slab.json │ │ ├── ruby_slab_top.json │ │ ├── ruby_stairs.json │ │ ├── ruby_stairs_inner.json │ │ ├── ruby_stairs_outer.json │ │ ├── ruby_wall_inventory.json │ │ ├── ruby_wall_post.json │ │ ├── ruby_wall_side.json │ │ ├── ruby_wall_side_tall.json │ │ └── ruby_wool.json │ └── textures │ ├── blocks │ ├── centrifuge.png │ ├── ghost_water_flow.png │ ├── ghost_water_flow.png.mcmeta │ ├── ghost_water_overlay.png │ ├── ghost_water_still.png │ ├── ghost_water_still.png.mcmeta │ ├── logic_gate.png │ ├── logic_gate_on.png │ ├── ruby_barrel_bottom.png │ ├── ruby_barrel_side.png │ ├── ruby_barrel_top.png │ ├── ruby_barrel_top_open.png │ ├── ruby_block.png │ ├── ruby_carpet.png │ ├── ruby_ore.png │ └── ruby_wool.png │ ├── entity │ ├── ruby_sheep │ │ ├── ruby_sheep.png │ │ └── ruby_sheep_fur.png │ ├── villager │ │ └── profession │ │ │ └── jeweler.png │ └── zombie_villager │ │ └── profession │ │ └── jeweler.png │ ├── gui │ └── ruby_barrel │ │ └── ruby_barrel.png │ ├── items │ ├── ghost_water_bucket.png │ ├── logic_gate.png │ ├── poisoned_apple.png │ ├── ruby.png │ ├── ruby_axe.png │ ├── ruby_boots.png │ ├── ruby_chestplate.png │ ├── ruby_helmet.png │ ├── ruby_hoe.png │ ├── ruby_leggings.png │ ├── ruby_pickaxe.png │ ├── ruby_shovel.png │ └── ruby_sword.png │ └── models │ └── armor │ ├── ruby_layer_1.png │ └── ruby_layer_2.png ├── logo.png └── pack.mcmeta /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report about: Create a report to help us improve title: '' 3 | labels: '' 4 | assignees: '' 5 | 6 | --- 7 | 8 | **Describe the bug** 9 | A clear and concise description of what the bug is. 10 | 11 | **To Reproduce** 12 | Steps to reproduce the behavior: 13 | 1. Go to '...' 14 | 2. Click on '....' 15 | 3. Scroll down to '....' 16 | 4. See error 17 | 18 | **Expected behavior** 19 | A clear and concise description of what you expected to happen. 20 | 21 | **Screenshots** 22 | If applicable, add screenshots to help explain your problem. 23 | 24 | **Additional context** 25 | Add any other context about the problem here. 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request about: Suggest an idea for this project title: '' 3 | labels: '' 4 | assignees: '' 5 | 6 | --- 7 | 8 | **Is your feature request related to a problem? Please describe.** 9 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 10 | 11 | **Describe the solution you'd like** 12 | A clear and concise description of what you want to happen. 13 | 14 | **Describe alternatives you've considered** 15 | A clear and concise description of any alternative solutions or features you've considered. 16 | 17 | **Additional context** 18 | Add any other context or screenshots about the feature request here. 19 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/bug_fix.md: -------------------------------------------------------------------------------- 1 | **Describe what bugs you fixed!** 2 | A clear and concise description of what you changed. Ex. Fixed: [...] -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/feature_addition.md: -------------------------------------------------------------------------------- 1 | **Describe what you changed!** 2 | A clear and concise description of what you changed. Ex. Added [...] 3 | 4 | **Describe what you removed!** 5 | A clear and concise description of what you removed. Ex. Removed [...] -------------------------------------------------------------------------------- /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | name: Java CI with Gradle 2 | 3 | on: 4 | push: 5 | branches: [ master, develop ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: Set up JDK 1.8 15 | uses: actions/setup-java@v1 16 | with: 17 | java-version: 1.8 18 | - name: Grant execute permission for gradlew 19 | run: chmod +x gradlew 20 | - name: Remove Forge license warning 21 | run: ./gradlew hideOfficialWarningUntilChanged 22 | - name: Build with Gradle 23 | run: ./gradlew build 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse 2 | bin 3 | *.launch 4 | .settings 5 | .metadata 6 | .classpath 7 | .project 8 | 9 | # idea 10 | out 11 | *.ipr 12 | *.iws 13 | *.iml 14 | .idea 15 | 16 | # gradle 17 | build 18 | .gradle 19 | 20 | # other 21 | eclipse 22 | run 23 | 24 | # bad macos files 25 | ._* 26 | .DS_Store 27 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making 6 | participation in our project, and our community a harassment-free experience for everyone, regardless of age, body size, 7 | disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, 8 | socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 9 | 10 | ## Our Standards 11 | 12 | Examples of behavior that contributes to creating a positive environment 13 | include: 14 | 15 | * Using welcoming and inclusive language 16 | * Being respectful of differing viewpoints and experiences 17 | * Gracefully accepting constructive criticism 18 | * Focusing on what is best for the community 19 | * Showing empathy towards other community members 20 | 21 | Examples of unacceptable behavior by participants include: 22 | 23 | * The use of sexualized language or imagery and unwelcome sexual attention or 24 | advances 25 | * Trolling, insulting/derogatory comments, and personal or political attacks 26 | * Public or private harassment 27 | * Publishing others' private information, such as a physical or electronic 28 | address, without explicit permission 29 | * Other conduct which could reasonably be considered inappropriate in a 30 | professional setting 31 | 32 | ## Our Responsibilities 33 | 34 | Project maintainers are responsible for clarifying the standards of acceptable 35 | behavior and are expected to take appropriate and fair corrective action in 36 | response to any instances of unacceptable behavior. 37 | 38 | Project maintainers have the right and responsibility to remove, edit, or 39 | reject comments, commits, code, wiki edits, issues, and other contributions 40 | that are not aligned to this Code of Conduct, or to ban temporarily or 41 | permanently any contributor for other behaviors that they deem inappropriate, 42 | threatening, offensive, or harmful. 43 | 44 | ## Scope 45 | 46 | This Code of Conduct applies both within project spaces and in public spaces 47 | when an individual is representing the project or its community. Examples of 48 | representing a project or community include using an official project e-mail 49 | address, posting via an official social media account, or acting as an appointed 50 | representative at an online or offline event. Representation of a project may be 51 | further defined and clarified by project maintainers. 52 | 53 | ## Enforcement 54 | 55 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 56 | reported by contacting the project team at shacharzidon@gmail.com. All 57 | complaints will be reviewed and investigated and will result in a response that 58 | is deemed necessary and appropriate to the circumstances. The project team is 59 | obligated to maintain confidentiality with regard to the reporter of an incident. 60 | Further details of specific enforcement policies may be posted separately. 61 | 62 | Project maintainers who do not follow or enforce the Code of Conduct in good 63 | faith may face temporary or permanent repercussions as determined by other 64 | members of the project's leadership. 65 | 66 | ## Attribution 67 | 68 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 69 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 70 | 71 | [homepage]: https://www.contributor-covenant.org 72 | 73 | For answers to common questions about this code of conduct, see 74 | https://www.contributor-covenant.org/faq 75 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | - It's simple! Fork this repository, and work on your changes. Once you're done, create a pull request. I'll review it, leave some comments, and merge it. 4 | - Use the default PR template. 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 TheOnlyTails 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | 2 | import net.minecraftforge.gradle.common.util.ModConfig 3 | import net.minecraftforge.gradle.common.util.RunConfig 4 | import net.minecraftforge.gradle.userdev.UserDevExtension 5 | import java.time.Instant 6 | import java.time.format.DateTimeFormatter 7 | 8 | buildscript { 9 | repositories { 10 | maven { url = uri("https://maven.minecraftforge.net/") } 11 | jcenter() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath(group = "net.minecraftforge.gradle", name = "ForgeGradle", version = "4.1.+") 16 | } 17 | } 18 | 19 | plugins { 20 | idea 21 | kotlin("jvm") version "latest.release" 22 | } 23 | apply(plugin = "net.minecraftforge.gradle") 24 | 25 | // Config -> Minecraft 26 | val forgeVersion: String by extra 27 | val minecraftVersion: String by extra 28 | val lootTablesVersion: String by extra 29 | 30 | // Config -> Mod 31 | val modId: String by extra 32 | val modVersion: String by extra 33 | 34 | // Default Mod Information 35 | version = modVersion 36 | group = "com.theonlytails.rubymod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html 37 | base.archivesBaseName = "rubymod" 38 | 39 | // Sets the toolchain to compile against OpenJDK 8 40 | java { 41 | toolchain { 42 | languageVersion.set(JavaLanguageVersion.of(8)) 43 | vendor.set(JvmVendorSpec.ADOPTOPENJDK) 44 | } 45 | } 46 | 47 | configure { 48 | // The mappings can be changed at any time, and must be in the following format. 49 | // snapshot_YYYYMMDD Snapshot are built nightly. 50 | // stable_# Stables are built at the discretion of the MCP team. 51 | // Use non-default mappings at your own risk. they may not always work. 52 | // Simply re-run your setup task after changing the mappings to update your workspace. 53 | mappings("official", minecraftVersion) 54 | 55 | // Exposes fields, methods, constructors, and classes for use within the mod. 56 | // Uncomment this to enable. 57 | accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg")) 58 | 59 | // Default run configurations. 60 | // These can be tweaked, removed, or duplicated as needed. 61 | runs(closureOf> { 62 | create("client") { 63 | workingDirectory(file("run")) 64 | 65 | taskName("client") 66 | 67 | // Recommended logging data for a userdev environment 68 | property("forge.logging.markers", "SCAN,REGISTRIES,REGISTRYDUMP") 69 | 70 | // Recommended logging level for the console 71 | property("forge.logging.console.level", "debug") 72 | 73 | mods(closureOf> { 74 | create(modId) { 75 | source(sourceSets["main"]) 76 | } 77 | }) 78 | } 79 | 80 | create("server") { 81 | workingDirectory(file("run")) 82 | 83 | taskName("server") 84 | // Recommended logging data for a userdev environment 85 | property("forge.logging.markers", "SCAN,REGISTRIES,REGISTRYDUMP") 86 | 87 | // Recommended logging level for the console 88 | property("forge.logging.console.level", "debug") 89 | 90 | mods(closureOf> { 91 | create(modId) { 92 | source(sourceSets["main"]) 93 | } 94 | }) 95 | } 96 | 97 | create("data") { 98 | workingDirectory(file("run")) 99 | 100 | taskName("datagen") 101 | 102 | // Recommended logging data for a userdev environment 103 | property("forge.logging.markers", "SCAN,REGISTRIES,REGISTRYDUMP") 104 | 105 | // Recommended logging level for the console 106 | property("forge.logging.console.level", "debug") 107 | 108 | // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. 109 | args( 110 | "--mod", 111 | modId, 112 | "--all", 113 | "--output", 114 | file("src/generated/resources/"), 115 | "--existing", 116 | file("src/main/resources/") 117 | ) 118 | 119 | mods(closureOf> { 120 | create(modId) { 121 | source(sourceSets["main"]) 122 | } 123 | }) 124 | } 125 | }) 126 | } 127 | 128 | // Include resources generated by data generators 129 | sourceSets["main"].resources { srcDir("src/generated/resources") } 130 | 131 | dependencies { 132 | // Specify the version of Minecraft to use, If this is any group other than "net.minecraft" it is assumed 133 | // that the dep is a ForgeGradle "patcher" dependency, and its patches will be applied. 134 | // The userdev artifact is a special name and will get all sorts of transformations applied to it. 135 | "minecraft"(group = "net.minecraftforge", name = "forge", version = "$minecraftVersion-$forgeVersion") 136 | 137 | // Specify that the standard library of Kotlin that should be used to compile 138 | implementation(group = "thedarkcolour", name = "kotlinforforge", version = "latest.release") 139 | 140 | implementation(group = "com.theonlytails", name = "loottables", version = "0.2.13") 141 | } 142 | 143 | // Repositories to add Kotlin 144 | repositories { 145 | mavenCentral() 146 | maven { 147 | name = "Kotlin for Forge" 148 | url = uri("https://thedarkcolour.github.io/KotlinForForge/") 149 | } 150 | } 151 | 152 | tasks { 153 | named("jar") { 154 | // Example for how to set properties within the manifest for reading by runtime 155 | manifest { 156 | attributes( 157 | "Specification-Title" to "RubyMod", 158 | "Specification-Vendor" to "TheOnlyTails", 159 | "Specification-Version" to project.version, 160 | "Implementation-Title" to "RubyMod", 161 | "Implementation-Vendor" to "TheOnlyTails", 162 | "Implementation-Version" to project.version, 163 | "Implementation-Timestamp" to DateTimeFormatter.ISO_INSTANT.format(Instant.now()) 164 | ) 165 | } 166 | 167 | // This is the preferred method to reobfuscate your jar file 168 | finalizedBy("reobfJar") 169 | } 170 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | org.gradle.daemon=false 5 | # Versions 6 | minecraftVersion=1.16.5 7 | forgeVersion=36.1.25 8 | modVersion=1.0.4-beta 9 | modId=rubymod -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "biome.rubymod.ruby_hills": "Ruby Hills", 3 | "block.rubymod.centrifuge": "Centrifuge", 4 | "block.rubymod.logic_gate": "Logic Gate", 5 | "block.rubymod.ruby_barrel": "Ruby Barrel", 6 | "block.rubymod.ruby_block": "Ruby Block", 7 | "block.rubymod.ruby_button": "Ruby Button", 8 | "block.rubymod.ruby_carpet": "Ruby Carpet", 9 | "block.rubymod.ruby_ore": "Ruby Ore", 10 | "block.rubymod.ruby_pressure_plate": "Ruby Pressure Plate", 11 | "block.rubymod.ruby_slab": "Ruby Slab", 12 | "block.rubymod.ruby_stairs": "Ruby Stairs", 13 | "block.rubymod.ruby_wall": "Ruby Wall", 14 | "block.rubymod.ruby_wool": "Ruby Wool", 15 | "enchantment.rubymod.stinger": "Stinger", 16 | "entity.minecraft.villager.rubymod.jeweler": "Jeweler", 17 | "entity.rubymod.ruby_sheep": "Ruby Sheep", 18 | "item.minecraft.lingering_potion.effect.laziness": "Lingering Potion of Laziness", 19 | "item.minecraft.lingering_potion.effect.motivation": "Lingering Potion of Motivation", 20 | "item.minecraft.potion.effect.laziness": "Potion of Laziness", 21 | "item.minecraft.potion.effect.motivation": "Potion of Motivation", 22 | "item.minecraft.splash_potion.effect.laziness": "Splash Potion of Laziness", 23 | "item.minecraft.splash_potion.effect.motivation": "Splash Potion of Motivation", 24 | "item.minecraft.tipped_arrow.effect.laziness": "Tipped Arrow of Laziness", 25 | "item.minecraft.tipped_arrow.effect.motivation": "Tipped Arrow of Motivation", 26 | "item.rubymod.ghost_water_bucket": "Ghost Water Bucket", 27 | "item.rubymod.poisoned_apple": "Poisoned Apple", 28 | "item.rubymod.ruby": "Ruby", 29 | "item.rubymod.ruby_axe": "Ruby Axe", 30 | "item.rubymod.ruby_boots": "Ruby Boots", 31 | "item.rubymod.ruby_chestplate": "Ruby Chestplate", 32 | "item.rubymod.ruby_helmet": "Ruby Helmet", 33 | "item.rubymod.ruby_hoe": "Ruby Hoe", 34 | "item.rubymod.ruby_leggings": "Ruby Leggings", 35 | "item.rubymod.ruby_pickaxe": "Ruby Pickaxe", 36 | "item.rubymod.ruby_sheep_spawn_egg": "Ruby Sheep Spawn Egg", 37 | "item.rubymod.ruby_shovel": "Ruby Shovel", 38 | "item.rubymod.ruby_sword": "Ruby Sword", 39 | "itemGroup.ruby_tab": "RubyMod" 40 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/centrifuge.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/centrifuge" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ghost_water_bucket.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "rubymod:items/ghost_water_bucket" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/logic_gate.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "rubymod:items/logic_gate" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/poisoned_apple.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "rubymod:items/poisoned_apple" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_axe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/handheld", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby_axe" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_barrel.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_barrel" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_block" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_boots.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby_boots" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_button.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_button_inventory" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_carpet.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_carpet" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_chestplate.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby_chestplate" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_helmet.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby_helmet" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_hoe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/handheld", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby_hoe" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_leggings.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby_leggings" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_ore.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_ore" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_pickaxe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/handheld", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby_pickaxe" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_pressure_plate.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_pressure_plate" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_sheep_spawn_egg.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/template_spawn_egg" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_shovel.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/handheld", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby_shovel" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_slab.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_slab" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_stairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_stairs" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/handheld", 3 | "textures": { 4 | "layer0": "rubymod:items/ruby_sword" 5 | } 6 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_wall.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_wall_inventory" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/assets/rubymod/models/item/ruby_wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "rubymod:block/ruby_wool" 3 | } -------------------------------------------------------------------------------- /src/generated/resources/data/forge/tags/blocks/ores.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_ore" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/forge/tags/blocks/storage_blocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_block" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/forge/tags/items/gems.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/forge/tags/items/ores.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_ore" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/forge/tags/items/storage_blocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_block" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/blocks/beacon_base_blocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_block" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/blocks/buttons.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_button" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/blocks/carpets.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_carpet" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/blocks/pressure_plates.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_pressure_plate" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/blocks/walls.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_wall" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/blocks/wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_wool" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/items/beacon_payment_items.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/items/buttons.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_button" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/items/carpets.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_carpet" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/items/walls.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_wall" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/minecraft/tags/items/wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "rubymod:ruby_wool" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/food/poisoned_apple.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:poisoned_apple" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:poisoned_apple" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/centrifuge.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:centrifuge" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:centrifuge" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ghost_water_bucket.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ghost_water_bucket" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ghost_water_bucket" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/logic_gate.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:logic_gate" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:logic_gate" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby_block" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_axe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_axe" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_axe" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_barrel.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_barrel" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_barrel" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_block" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_block" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_boots.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_boots" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_boots" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_button.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_button" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_button" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_carpet_from_carpet.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_carpet_from_carpet" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_carpet_from_carpet" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_carpet_from_wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_carpet_from_wool" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_carpet_from_wool" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_chestplate.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_chestplate" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_chestplate" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_helmet.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_helmet" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_helmet" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_hoe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_hoe" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_hoe" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_leggings.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_leggings" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_leggings" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_ore_blast.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_ore_blast" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby_ore": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby_ore" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_ore_blast" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby_ore", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_ore_smelt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_ore_smelt" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby_ore": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby_ore" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_ore_smelt" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby_ore", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_pickaxe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_pickaxe" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_pickaxe" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_pressure_plate.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_pressure_plate" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_pressure_plate" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_shovel.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_shovel" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_shovel" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_slab.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_slab" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_slab" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_stairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_stairs" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_stairs" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_sword" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_sword" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_wall.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_wall" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_wall" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/advancements/recipes/ruby_tab/ruby_wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:recipes/root", 3 | "rewards": { 4 | "recipes": [ 5 | "rubymod:ruby_wool" 6 | ] 7 | }, 8 | "criteria": { 9 | "ruby": { 10 | "trigger": "minecraft:inventory_changed", 11 | "conditions": { 12 | "items": [ 13 | { 14 | "item": "rubymod:ruby" 15 | } 16 | ] 17 | } 18 | }, 19 | "has_the_recipe": { 20 | "trigger": "minecraft:recipe_unlocked", 21 | "conditions": { 22 | "recipe": "rubymod:ruby_wool" 23 | } 24 | } 25 | }, 26 | "requirements": [ 27 | [ 28 | "ruby", 29 | "has_the_recipe" 30 | ] 31 | ] 32 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/centrifuge.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:alternatives", 9 | "children": [ 10 | { 11 | "type": "minecraft:item", 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:match_tool", 15 | "predicate": { 16 | "enchantments": [ 17 | { 18 | "enchantment": "minecraft:silk_touch", 19 | "levels": { 20 | "min": 1 21 | } 22 | } 23 | ] 24 | } 25 | } 26 | ], 27 | "name": "rubymod:centrifuge" 28 | }, 29 | { 30 | "type": "minecraft:item", 31 | "name": "rubymod:ruby" 32 | } 33 | ] 34 | } 35 | ], 36 | "conditions": [ 37 | { 38 | "condition": "minecraft:survives_explosion" 39 | } 40 | ] 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/logic_gate.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:logic_gate" 10 | } 11 | ], 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:survives_explosion" 15 | } 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_barrel.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "functions": [ 10 | { 11 | "function": "minecraft:copy_name", 12 | "source": "block_entity" 13 | } 14 | ], 15 | "name": "rubymod:ruby_barrel" 16 | } 17 | ], 18 | "conditions": [ 19 | { 20 | "condition": "minecraft:survives_explosion" 21 | } 22 | ] 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:ruby_block" 10 | } 11 | ], 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:survives_explosion" 15 | } 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_button.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:ruby_button" 10 | } 11 | ], 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:survives_explosion" 15 | } 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_carpet.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:ruby_carpet" 10 | } 11 | ], 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:survives_explosion" 15 | } 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_ore.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:alternatives", 9 | "children": [ 10 | { 11 | "type": "minecraft:item", 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:match_tool", 15 | "predicate": { 16 | "enchantments": [ 17 | { 18 | "enchantment": "minecraft:silk_touch", 19 | "levels": { 20 | "min": 1 21 | } 22 | } 23 | ] 24 | } 25 | } 26 | ], 27 | "name": "rubymod:ruby_ore" 28 | }, 29 | { 30 | "type": "minecraft:item", 31 | "functions": [ 32 | { 33 | "function": "minecraft:explosion_decay" 34 | }, 35 | { 36 | "function": "minecraft:apply_bonus", 37 | "enchantment": "minecraft:fortune", 38 | "formula": "minecraft:ore_drops" 39 | } 40 | ], 41 | "name": "rubymod:ruby" 42 | } 43 | ] 44 | } 45 | ], 46 | "conditions": [ 47 | { 48 | "condition": "minecraft:survives_explosion" 49 | } 50 | ] 51 | } 52 | ] 53 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_pressure_plate.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:ruby_pressure_plate" 10 | } 11 | ], 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:survives_explosion" 15 | } 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_slab.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:ruby_slab" 10 | } 11 | ], 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:survives_explosion" 15 | } 16 | ], 17 | "functions": [ 18 | { 19 | "function": "minecraft:set_count", 20 | "conditions": [ 21 | { 22 | "condition": "minecraft:block_state_property", 23 | "block": "rubymod:ruby_slab", 24 | "properties": { 25 | "type": "double" 26 | } 27 | } 28 | ], 29 | "count": 2 30 | } 31 | ] 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_stairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:ruby_stairs" 10 | } 11 | ], 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:survives_explosion" 15 | } 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_wall.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:ruby_wall" 10 | } 11 | ], 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:survives_explosion" 15 | } 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/blocks/ruby_wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:ruby_wool" 10 | } 11 | ], 12 | "conditions": [ 13 | { 14 | "condition": "minecraft:survives_explosion" 15 | } 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/entities/ruby_sheep.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:entity", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "rubymod:ruby_wool" 10 | } 11 | ] 12 | }, 13 | { 14 | "rolls": 1, 15 | "entries": [ 16 | { 17 | "type": "minecraft:loot_table", 18 | "name": "minecraft:entities/sheep" 19 | } 20 | ] 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/loot_tables/gameplay/hero_of_the_village/jeweler_gift.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:gift", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "minecraft:iron_nugget" 10 | }, 11 | { 12 | "type": "minecraft:item", 13 | "name": "minecraft:iron_ingot" 14 | }, 15 | { 16 | "type": "minecraft:item", 17 | "name": "minecraft:gold_nugget" 18 | }, 19 | { 20 | "type": "minecraft:item", 21 | "name": "minecraft:gold_ingot" 22 | } 23 | ] 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/centrifuge.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "iri", 5 | "ici", 6 | "idi" 7 | ], 8 | "key": { 9 | "i": { 10 | "item": "minecraft:iron_ingot" 11 | }, 12 | "r": { 13 | "item": "rubymod:ruby" 14 | }, 15 | "c": { 16 | "item": "minecraft:cauldron" 17 | }, 18 | "d": { 19 | "item": "minecraft:redstone" 20 | } 21 | }, 22 | "result": { 23 | "item": "rubymod:centrifuge" 24 | } 25 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ghost_water_bucket.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "rubymod:ruby" 6 | }, 7 | { 8 | "item": "minecraft:water_bucket" 9 | } 10 | ], 11 | "result": { 12 | "item": "rubymod:ghost_water_bucket" 13 | } 14 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/logic_gate.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "t t", 5 | "srs" 6 | ], 7 | "key": { 8 | "t": { 9 | "item": "minecraft:redstone_torch" 10 | }, 11 | "s": { 12 | "tag": "minecraft:stone_crafting_materials" 13 | }, 14 | "r": { 15 | "item": "rubymod:ruby" 16 | } 17 | }, 18 | "result": { 19 | "item": "rubymod:logic_gate" 20 | } 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/poisoned_apple.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "minecraft:apple" 6 | }, 7 | { 8 | "item": "rubymod:ruby" 9 | } 10 | ], 11 | "result": { 12 | "item": "rubymod:poisoned_apple" 13 | } 14 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "rubymod:ruby_block" 6 | } 7 | ], 8 | "result": { 9 | "item": "rubymod:ruby", 10 | "count": 9 11 | } 12 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_axe.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | " rr", 5 | " sr", 6 | " s " 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby" 11 | }, 12 | "s": { 13 | "item": "minecraft:stick" 14 | } 15 | }, 16 | "result": { 17 | "item": "rubymod:ruby_axe" 18 | } 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_barrel.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "brb", 5 | "bcb", 6 | "brb" 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby" 11 | }, 12 | "b": { 13 | "item": "rubymod:ruby_block" 14 | }, 15 | "c": { 16 | "item": "minecraft:barrel" 17 | } 18 | }, 19 | "result": { 20 | "item": "rubymod:ruby_barrel" 21 | } 22 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "rrr", 5 | "rrr", 6 | "rrr" 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby" 11 | } 12 | }, 13 | "result": { 14 | "item": "rubymod:ruby_block" 15 | } 16 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_boots.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "r r", 5 | "r r" 6 | ], 7 | "key": { 8 | "r": { 9 | "item": "rubymod:ruby" 10 | } 11 | }, 12 | "result": { 13 | "item": "rubymod:ruby_boots" 14 | } 15 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_button.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "rubymod:ruby" 6 | } 7 | ], 8 | "result": { 9 | "item": "rubymod:ruby_button" 10 | } 11 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_carpet_from_carpet.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "group": "carpet", 4 | "pattern": [ 5 | "ccc", 6 | "crc", 7 | "ccc" 8 | ], 9 | "key": { 10 | "r": { 11 | "item": "rubymod:ruby" 12 | }, 13 | "c": { 14 | "item": "minecraft:white_carpet" 15 | } 16 | }, 17 | "result": { 18 | "item": "rubymod:ruby_carpet", 19 | "count": 8 20 | } 21 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_carpet_from_wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "group": "carpet", 4 | "pattern": [ 5 | "ww" 6 | ], 7 | "key": { 8 | "w": { 9 | "item": "rubymod:ruby_wool" 10 | } 11 | }, 12 | "result": { 13 | "item": "rubymod:ruby_carpet", 14 | "count": 8 15 | } 16 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_chestplate.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "r r", 5 | "rrr", 6 | "rrr" 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby" 11 | } 12 | }, 13 | "result": { 14 | "item": "rubymod:ruby_chestplate" 15 | } 16 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_helmet.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "rrr", 5 | "r r" 6 | ], 7 | "key": { 8 | "r": { 9 | "item": "rubymod:ruby" 10 | } 11 | }, 12 | "result": { 13 | "item": "rubymod:ruby_helmet" 14 | } 15 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_hoe.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | " rr", 5 | " s ", 6 | " s " 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby" 11 | }, 12 | "s": { 13 | "item": "minecraft:stick" 14 | } 15 | }, 16 | "result": { 17 | "item": "rubymod:ruby_hoe" 18 | } 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_leggings.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "rrr", 5 | "r r", 6 | "r r" 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby" 11 | } 12 | }, 13 | "result": { 14 | "item": "rubymod:ruby_leggings" 15 | } 16 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_ore_blast.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:blasting", 3 | "ingredient": { 4 | "item": "rubymod:ruby_ore" 5 | }, 6 | "result": "rubymod:ruby", 7 | "experience": 1.0, 8 | "cookingtime": 100 9 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_ore_smelt.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:smelting", 3 | "ingredient": { 4 | "item": "rubymod:ruby_ore" 5 | }, 6 | "result": "rubymod:ruby", 7 | "experience": 1.0, 8 | "cookingtime": 100 9 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_pickaxe.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "rrr", 5 | " s ", 6 | " s " 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby" 11 | }, 12 | "s": { 13 | "item": "minecraft:stick" 14 | } 15 | }, 16 | "result": { 17 | "item": "rubymod:ruby_pickaxe" 18 | } 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_pressure_plate.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "rr" 5 | ], 6 | "key": { 7 | "r": { 8 | "item": "rubymod:ruby_block" 9 | } 10 | }, 11 | "result": { 12 | "item": "rubymod:ruby_pressure_plate" 13 | } 14 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_shovel.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | " r ", 5 | " s ", 6 | " s " 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby" 11 | }, 12 | "s": { 13 | "item": "minecraft:stick" 14 | } 15 | }, 16 | "result": { 17 | "item": "rubymod:ruby_shovel" 18 | } 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_slab.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "rrr" 5 | ], 6 | "key": { 7 | "r": { 8 | "item": "rubymod:ruby_block" 9 | } 10 | }, 11 | "result": { 12 | "item": "rubymod:ruby_slab", 13 | "count": 6 14 | } 15 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_stairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "r ", 5 | "rr ", 6 | "rrr" 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby_block" 11 | } 12 | }, 13 | "result": { 14 | "item": "rubymod:ruby_stairs", 15 | "count": 4 16 | } 17 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | " r ", 5 | " r ", 6 | " s " 7 | ], 8 | "key": { 9 | "r": { 10 | "item": "rubymod:ruby" 11 | }, 12 | "s": { 13 | "item": "minecraft:stick" 14 | } 15 | }, 16 | "result": { 17 | "item": "rubymod:ruby_sword" 18 | } 19 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_wall.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "rrr", 5 | "rrr" 6 | ], 7 | "key": { 8 | "r": { 9 | "item": "rubymod:ruby_block" 10 | } 11 | }, 12 | "result": { 13 | "item": "rubymod:ruby_wall", 14 | "count": 6 15 | } 16 | } -------------------------------------------------------------------------------- /src/generated/resources/data/rubymod/recipes/ruby_wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "rubymod:ruby" 6 | }, 7 | { 8 | "tag": "minecraft:wool" 9 | } 10 | ], 11 | "result": { 12 | "item": "rubymod:ruby_wool" 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/RubyMod.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod 2 | 3 | import com.theonlytails.rubymod.client.gui.RubyBarrelScreen 4 | import com.theonlytails.rubymod.client.render.RubySheepRenderer 5 | import com.theonlytails.rubymod.entities.RubySheepEntity 6 | import com.theonlytails.rubymod.items.CustomSpawnEggItem 7 | import com.theonlytails.rubymod.registries.* 8 | import com.theonlytails.rubymod.trades.addVillagerTrades 9 | import com.theonlytails.rubymod.util.registerBrewingRecipes 10 | import com.theonlytails.rubymod.world.addFeaturesToBiomes 11 | import net.minecraft.block.ComposterBlock 12 | import net.minecraft.client.gui.ScreenManager 13 | import net.minecraft.client.renderer.RenderType 14 | import net.minecraft.client.renderer.RenderTypeLookup 15 | import net.minecraft.entity.EntityType 16 | import net.minecraft.item.Item 17 | import net.minecraft.item.ItemGroup 18 | import net.minecraft.item.ItemStack 19 | import net.minecraft.util.ResourceLocation 20 | import net.minecraft.village.PointOfInterestType 21 | import net.minecraftforge.event.RegistryEvent 22 | import net.minecraftforge.event.entity.EntityAttributeCreationEvent 23 | import net.minecraftforge.eventbus.api.EventPriority 24 | import net.minecraftforge.fml.client.registry.RenderingRegistry 25 | import net.minecraftforge.fml.common.Mod 26 | import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent 27 | import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent 28 | import org.apache.logging.log4j.LogManager 29 | import org.apache.logging.log4j.Logger 30 | import thedarkcolour.kotlinforforge.forge.FORGE_BUS 31 | import thedarkcolour.kotlinforforge.forge.MOD_BUS 32 | import kotlin.collections.set 33 | 34 | const val MOD_ID = "rubymod" 35 | 36 | val rubyTab: ItemGroup = object : ItemGroup("ruby_tab") { 37 | override fun makeIcon() = ItemStack(ItemRegistry.ruby) 38 | } 39 | 40 | val rubyTabProperty: Item.Properties = Item.Properties().tab(rubyTab) 41 | 42 | fun id(path: String): ResourceLocation = ResourceLocation(MOD_ID, path) 43 | 44 | val logger: Logger = LogManager.getLogger() 45 | 46 | /** 47 | * The main mod class. 48 | * 49 | * @author TheOnlyTails 50 | */ 51 | @Mod(MOD_ID) 52 | object RubyMod { 53 | init { 54 | MOD_BUS.apply { 55 | addListener(::commonSetup) 56 | addListener(::clientSetup) 57 | addListener(::createEntityAttributes) 58 | 59 | EntityTypeRegistry.entityTypes.register(this) 60 | BiomeRegistry.biomes.register(this) 61 | FluidRegistry.fluids.register(this) 62 | TileEntityTypes.tileEntities.register(this) 63 | ContainerTypeRegistry.containerTypes.register(this) 64 | EnchantmentRegistry.enchantments.register(this) 65 | BlockRegistry.blocks.register(this) 66 | ItemRegistry.items.register(this) 67 | PotionRegistry.potions.register(this) 68 | VillagerProfessionsRegistry.professions.register(this) 69 | VillagerProfessionsRegistry.pointsOfInterest.register(this) 70 | } 71 | 72 | FORGE_BUS.apply { 73 | addListener(::addVillagerTrades) 74 | addGenericListener(::onRegisterEntities) 75 | addListener(EventPriority.HIGH, ::biomeLoading) 76 | addListener(EventPriority.HIGH, ::addFeaturesToBiomes) 77 | } 78 | } 79 | 80 | private fun commonSetup(event: FMLCommonSetupEvent) { 81 | event.enqueueWork { 82 | PointOfInterestType.registerBlockStates(VillagerProfessionsRegistry.jewelerPOI) 83 | 84 | registerBrewingRecipes(event) 85 | 86 | ComposterBlock.COMPOSTABLES[ItemRegistry.poisonedApple.asItem()] = 0.3f 87 | 88 | FluidRegistry.fluids.registry.entries.forEach { 89 | RenderTypeLookup.setRenderLayer(it.value, RenderType.translucent()) 90 | } 91 | } 92 | } 93 | 94 | private fun clientSetup(event: FMLClientSetupEvent) { 95 | event.enqueueWork { 96 | ScreenManager.register(ContainerTypeRegistry.rubyBarrel) { screenContainer, inv, titleIn -> 97 | RubyBarrelScreen(screenContainer, inv, titleIn) 98 | } 99 | } 100 | 101 | RenderTypeLookup.setRenderLayer(BlockRegistry.logicGate, RenderType.cutout()) 102 | 103 | RenderingRegistry.registerEntityRenderingHandler(EntityTypeRegistry.rubySheep) { RubySheepRenderer(it) } 104 | } 105 | 106 | private fun onRegisterEntities(@Suppress("UNUSED_PARAMETER") event: RegistryEvent.Register>) = 107 | CustomSpawnEggItem.initSpawnEggs() 108 | 109 | private fun createEntityAttributes(event: EntityAttributeCreationEvent) = 110 | event.put(EntityTypeRegistry.rubySheep, RubySheepEntity.customAttributes) 111 | } 112 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/blocks/Centrifuge.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("DEPRECATION") 2 | 3 | package com.theonlytails.rubymod.blocks 4 | 5 | import net.minecraft.block.* 6 | import net.minecraft.block.material.Material 7 | import net.minecraft.item.BlockItemUseContext 8 | import net.minecraft.state.StateContainer 9 | import net.minecraft.util.Direction 10 | import net.minecraft.util.Mirror 11 | import net.minecraft.util.Rotation 12 | import net.minecraft.util.math.BlockPos 13 | import net.minecraft.util.math.shapes.* 14 | import net.minecraft.world.IBlockReader 15 | import net.minecraftforge.common.ToolType 16 | import javax.annotation.Nonnull 17 | 18 | /** 19 | * The block class for the centrifuge block. 20 | * 21 | * @author TheOnlyTails 22 | */ 23 | class Centrifuge : HorizontalBlock( 24 | Properties.of(Material.METAL) 25 | .strength(3.5f, 5f) 26 | .sound(SoundType.ANVIL) 27 | .harvestLevel(2) 28 | .harvestTool(ToolType.PICKAXE) 29 | .requiresCorrectToolForDrops() 30 | ) { 31 | override fun getStateForPlacement(context: BlockItemUseContext): BlockState = 32 | defaultBlockState().setValue(FACING, context.horizontalDirection.opposite) 33 | 34 | @Nonnull 35 | override fun rotate(state: BlockState, rot: Rotation): BlockState = 36 | state.setValue(FACING, rot.rotate(state.getValue(FACING))) 37 | 38 | @Nonnull 39 | override fun mirror(state: BlockState, mirrorIn: Mirror): BlockState = 40 | state.rotate(mirrorIn.getRotation(state.getValue(FACING))) 41 | 42 | override fun createBlockStateDefinition(builder: StateContainer.Builder) { 43 | builder.add(FACING) 44 | } 45 | 46 | @Nonnull 47 | override fun getShape( 48 | state: BlockState, 49 | worldIn: IBlockReader, 50 | pos: BlockPos, 51 | context: ISelectionContext, 52 | ) = when (state.getValue(FACING)) { 53 | Direction.EAST -> SHAPE_E 54 | Direction.SOUTH -> SHAPE_S 55 | Direction.WEST -> SHAPE_W 56 | else -> SHAPE_N 57 | } 58 | 59 | companion object { 60 | val SHAPE_N: VoxelShape = sequenceOf( 61 | box(0.0, 0.0, 0.0, 1.0, 3.0, 1.0), 62 | box(0.0, 0.0, 15.0, 1.0, 3.0, 16.0), 63 | box(15.0, 0.0, 0.0, 16.0, 3.0, 1.0), 64 | box(15.0, 0.0, 15.0, 16.0, 3.0, 16.0), 65 | box(0.0, 3.0, 0.0, 16.0, 13.0, 16.0), 66 | box(0.0, 13.0, 0.0, 1.0, 15.0, 16.0), 67 | box(15.0, 13.0, 0.0, 16.0, 15.0, 16.0), 68 | box(1.0, 13.0, 15.0, 15.0, 15.0, 16.0), 69 | box(1.0, 13.0, 0.0, 15.0, 15.0, 1.0) 70 | ).reduce { v1, v2 -> VoxelShapes.join(v1, v2, IBooleanFunction.OR) } 71 | 72 | val SHAPE_E: VoxelShape = sequenceOf( 73 | box(15.0, 0.0, 0.0, 16.0, 3.0, 1.0), 74 | box(0.0, 0.0, 0.0, 1.0, 3.0, 1.0), 75 | box(15.0, 0.0, 15.0, 16.0, 3.0, 16.0), 76 | box(0.0, 0.0, 15.0, 1.0, 3.0, 16.0), 77 | box(0.0, 3.0, 0.0, 16.0, 13.0, 16.0), 78 | box(0.0, 13.0, 0.0, 16.0, 15.0, 1.0), 79 | box(0.0, 13.0, 15.0, 16.0, 15.0, 16.0), 80 | box(0.0, 13.0, 1.0, 1.0, 15.0, 15.0), 81 | box(15.0, 13.0, 1.0, 16.0, 15.0, 15.0) 82 | ).reduce { v1, v2 -> VoxelShapes.join(v1, v2, IBooleanFunction.OR) } 83 | 84 | val SHAPE_S: VoxelShape = sequenceOf( 85 | box(15.0, 0.0, 15.0, 16.0, 3.0, 16.0), 86 | box(15.0, 0.0, 0.0, 16.0, 3.0, 1.0), 87 | box(0.0, 0.0, 15.0, 1.0, 3.0, 16.0), 88 | box(0.0, 0.0, 0.0, 1.0, 3.0, 1.0), 89 | box(0.0, 3.0, 0.0, 16.0, 13.0, 16.0), 90 | box(15.0, 13.0, 0.0, 16.0, 15.0, 16.0), 91 | box(0.0, 13.0, 0.0, 1.0, 15.0, 16.0), 92 | box(1.0, 13.0, 0.0, 15.0, 15.0, 1.0), 93 | box(1.0, 13.0, 15.0, 15.0, 15.0, 16.0) 94 | ).reduce { v1, v2 -> VoxelShapes.join(v1, v2, IBooleanFunction.OR) } 95 | 96 | val SHAPE_W: VoxelShape = sequenceOf( 97 | box(0.0, 0.0, 15.0, 1.0, 3.0, 16.0), 98 | box(15.0, 0.0, 15.0, 16.0, 3.0, 16.0), 99 | box(0.0, 0.0, 0.0, 1.0, 3.0, 1.0), 100 | box(15.0, 0.0, 0.0, 16.0, 3.0, 1.0), 101 | box(0.0, 3.0, 0.0, 16.0, 13.0, 16.0), 102 | box(0.0, 13.0, 15.0, 16.0, 15.0, 16.0), 103 | box(0.0, 13.0, 0.0, 16.0, 15.0, 1.0), 104 | box(15.0, 13.0, 1.0, 16.0, 15.0, 15.0), 105 | box(0.0, 13.0, 1.0, 1.0, 15.0, 15.0) 106 | ).reduce { v1, v2 -> VoxelShapes.join(v1, v2, IBooleanFunction.OR) } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/blocks/LogicGate.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.blocks 2 | 3 | import com.theonlytails.rubymod.util.enums.LogicGateModes 4 | import net.minecraft.block.Block 5 | import net.minecraft.block.BlockState 6 | import net.minecraft.block.RedstoneDiodeBlock 7 | import net.minecraft.block.SoundType 8 | import net.minecraft.block.material.Material 9 | import net.minecraft.entity.player.PlayerEntity 10 | import net.minecraft.state.EnumProperty 11 | import net.minecraft.state.StateContainer 12 | import net.minecraft.util.ActionResultType 13 | import net.minecraft.util.Direction 14 | import net.minecraft.util.Hand 15 | import net.minecraft.util.math.BlockPos 16 | import net.minecraft.util.math.BlockRayTraceResult 17 | import net.minecraft.world.IBlockReader 18 | import net.minecraft.world.IWorld 19 | import net.minecraft.world.World 20 | 21 | class LogicGate : RedstoneDiodeBlock(Properties.of(Material.DECORATION).instabreak().sound(SoundType.METAL)) { 22 | init { 23 | this.registerDefaultState( 24 | this.stateDefinition.any() 25 | .setValue(FACING, Direction.NORTH) 26 | .setValue(POWERED, false) 27 | .setValue(MODE, LogicGateModes.OR) 28 | ) 29 | } 30 | 31 | override fun getInputSignal(world: World, pos: BlockPos, state: BlockState): Int { 32 | val facing = state.getValue(FACING) 33 | 34 | val firstInput = world.getSignal(pos.relative(facing.clockWise), facing.clockWise) > 0 35 | val secondInput = world.getSignal(pos.relative(facing.counterClockWise), facing.counterClockWise) > 0 36 | 37 | return state.getValue(MODE)(firstInput, secondInput) 38 | } 39 | 40 | override fun use( 41 | state: BlockState, 42 | world: World, 43 | pos: BlockPos, 44 | player: PlayerEntity, 45 | hand: Hand, 46 | result: BlockRayTraceResult, 47 | ): ActionResultType = if (player.abilities.mayBuild) { 48 | world.setBlock(pos, state.cycle(MODE), 3) 49 | ActionResultType.sidedSuccess(world.isClientSide) 50 | } else ActionResultType.PASS 51 | 52 | override fun getDelay(state: BlockState) = 1 53 | 54 | override fun createBlockStateDefinition(builder: StateContainer.Builder) { 55 | builder.add(FACING, POWERED, MODE) 56 | } 57 | 58 | override fun canConnectRedstone( 59 | state: BlockState, 60 | world: IBlockReader, 61 | pos: BlockPos, 62 | side: Direction?, 63 | ) = side == state.getValue(FACING) 64 | || side == state.getValue(FACING).clockWise 65 | || side == state.getValue(FACING).counterClockWise 66 | 67 | override fun isAlternateInput(state: BlockState) = isDiode(state) 68 | 69 | @Suppress("DEPRECATION") 70 | override fun updateShape( 71 | stateIn: BlockState, 72 | facing: Direction, 73 | facingState: BlockState, 74 | worldIn: IWorld, 75 | currentPos: BlockPos, 76 | facingPos: BlockPos, 77 | ): BlockState = 78 | if (!worldIn.isClientSide && facing.axis != stateIn.getValue(FACING).axis) 79 | stateIn.setValue(MODE, stateIn.getValue(MODE)) 80 | else super.updateShape(stateIn, facing, facingState, worldIn, currentPos, facingPos) 81 | 82 | companion object { 83 | val MODE: EnumProperty = EnumProperty.create( 84 | "logic_gate_mode", 85 | LogicGateModes::class.java, 86 | LogicGateModes.AND, 87 | LogicGateModes.OR, 88 | ) 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/blocks/RubyBarrel.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("DEPRECATION") 2 | 3 | package com.theonlytails.rubymod.blocks 4 | 5 | import com.theonlytails.rubymod.registries.TileEntityTypes 6 | import com.theonlytails.rubymod.tileentities.RubyBarrelTileEntity 7 | import net.minecraft.block.Block 8 | import net.minecraft.block.BlockState 9 | import net.minecraft.block.SoundType 10 | import net.minecraft.block.material.Material 11 | import net.minecraft.block.material.MaterialColor 12 | import net.minecraft.entity.player.PlayerEntity 13 | import net.minecraft.entity.player.ServerPlayerEntity 14 | import net.minecraft.inventory.InventoryHelper 15 | import net.minecraft.inventory.container.INamedContainerProvider 16 | import net.minecraft.state.BooleanProperty 17 | import net.minecraft.state.StateContainer 18 | import net.minecraft.state.properties.BlockStateProperties 19 | import net.minecraft.stats.Stats 20 | import net.minecraft.util.ActionResultType 21 | import net.minecraft.util.Hand 22 | import net.minecraft.util.math.BlockPos 23 | import net.minecraft.util.math.BlockRayTraceResult 24 | import net.minecraft.world.IBlockReader 25 | import net.minecraft.world.World 26 | import net.minecraftforge.common.ToolType 27 | import net.minecraftforge.fml.network.NetworkHooks 28 | import net.minecraftforge.items.ItemHandlerHelper 29 | 30 | /** 31 | * The block class for the ruby barrel. 32 | * 33 | * @author TheOnlyTails 34 | */ 35 | class RubyBarrel : Block(Properties.of(Material.METAL, MaterialColor.COLOR_RED) 36 | .strength(3.5f) 37 | .sound(SoundType.METAL) 38 | .harvestTool(ToolType.PICKAXE) 39 | .harvestLevel(2) 40 | .requiresCorrectToolForDrops() 41 | ) { 42 | 43 | init { 44 | registerDefaultState(stateDefinition.any().setValue(PROPERTY_OPEN, false)) 45 | } 46 | 47 | override fun use( 48 | state: BlockState, 49 | worldIn: World, 50 | pos: BlockPos, 51 | player: PlayerEntity, 52 | handIn: Hand, 53 | hit: BlockRayTraceResult, 54 | ): ActionResultType { 55 | if (!worldIn.isClientSide) { 56 | val tileEntity = worldIn.getBlockEntity(pos) as INamedContainerProvider? 57 | if (tileEntity is RubyBarrelTileEntity) { 58 | NetworkHooks.openGui(player as ServerPlayerEntity, tileEntity, pos) 59 | player.awardStat(Stats.OPEN_BARREL) 60 | } 61 | } 62 | 63 | return ActionResultType.SUCCESS 64 | } 65 | 66 | override fun onRemove(state: BlockState, worldIn: World, pos: BlockPos, newState: BlockState, isMoving: Boolean) { 67 | if (state.block != newState.block) { 68 | val tileEntity = worldIn.getBlockEntity(pos) 69 | if (tileEntity is RubyBarrelTileEntity) { 70 | dropItems(tileEntity, worldIn, pos) 71 | worldIn.updateNeighbourForOutputSignal(pos, this) 72 | } 73 | } 74 | super.onRemove(state, worldIn, pos, newState, isMoving) 75 | } 76 | 77 | override fun createTileEntity(state: BlockState, world: IBlockReader) = TileEntityTypes.rubyBarrel.create() 78 | 79 | override fun getAnalogOutputSignal(blockState: BlockState, worldIn: World, pos: BlockPos): Int { 80 | val rubyBarrel = worldIn.getBlockEntity(pos) 81 | return if (rubyBarrel is RubyBarrelTileEntity) ItemHandlerHelper.calcRedstoneFromInventory(rubyBarrel.itemHandler) else 0 82 | } 83 | 84 | override fun hasAnalogOutputSignal(state: BlockState) = true 85 | 86 | override fun createBlockStateDefinition(builder: StateContainer.Builder) { 87 | builder.add(PROPERTY_OPEN) 88 | } 89 | 90 | private fun dropItems(rubyBarrel: RubyBarrelTileEntity, world: World, pos: BlockPos) { 91 | (0..rubyBarrel.itemHandler.slots) 92 | .map { slot -> rubyBarrel.itemHandler.getStackInSlot(slot) } 93 | .filter { !it.isEmpty } 94 | .forEach { 95 | InventoryHelper.dropItemStack(world, pos.x.toDouble(), pos.y.toDouble(), pos.z.toDouble(), it) 96 | } 97 | } 98 | 99 | companion object { 100 | val PROPERTY_OPEN: BooleanProperty = BlockStateProperties.OPEN 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/blocks/RubyCarpet.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("DEPRECATION") 2 | 3 | package com.theonlytails.rubymod.blocks 4 | 5 | import net.minecraft.block.* 6 | import net.minecraft.block.material.Material 7 | import net.minecraft.block.material.MaterialColor 8 | import net.minecraft.util.Direction 9 | import net.minecraft.util.math.BlockPos 10 | import net.minecraft.util.math.shapes.ISelectionContext 11 | import net.minecraft.util.math.shapes.VoxelShape 12 | import net.minecraft.world.IBlockReader 13 | import net.minecraft.world.IWorld 14 | import net.minecraft.world.IWorldReader 15 | 16 | /** 17 | * The block class for the ruby carpet. 18 | * 19 | * @author TheOnlyTails 20 | */ 21 | class RubyCarpet : Block(Properties.of(Material.CLOTH_DECORATION, MaterialColor.CRIMSON_HYPHAE) 22 | .strength(0.1f) 23 | .sound(SoundType.WOOL) 24 | ) { 25 | 26 | override fun getShape( 27 | state: BlockState, 28 | worldIn: IBlockReader, 29 | pos: BlockPos, 30 | context: ISelectionContext, 31 | ): VoxelShape = SHAPE 32 | 33 | /** 34 | * Update the provided state given the provided neighbor facing and neighbor state, returning a new state. 35 | * For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately 36 | * returns its solidified counterpart. 37 | * Note that this method should ideally consider only the specific face passed in. 38 | */ 39 | override fun updateShape( 40 | stateIn: BlockState, 41 | facing: Direction, 42 | facingState: BlockState, 43 | worldIn: IWorld, 44 | currentPos: BlockPos, 45 | facingPos: BlockPos, 46 | ): BlockState = 47 | if (!stateIn.canSurvive(worldIn, currentPos)) Blocks.AIR.defaultBlockState() 48 | else super.updateShape(stateIn, facing, facingState, worldIn, currentPos, facingPos) 49 | 50 | override fun canSurvive(state: BlockState, worldIn: IWorldReader, pos: BlockPos) = 51 | !worldIn.isEmptyBlock(pos.below()) 52 | 53 | companion object { 54 | val SHAPE: VoxelShape = box(0.0, 0.0, 0.0, 16.0, 1.0, 16.0) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/client/gui/RubyBarrelScreen.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("DEPRECATION") 2 | 3 | package com.theonlytails.rubymod.client.gui 4 | 5 | import com.mojang.blaze3d.matrix.MatrixStack 6 | import com.mojang.blaze3d.systems.RenderSystem 7 | import com.theonlytails.rubymod.blocks.RubyBarrel 8 | import com.theonlytails.rubymod.containers.RubyBarrelContainer 9 | import com.theonlytails.rubymod.id 10 | import net.minecraft.client.gui.screen.inventory.ContainerScreen 11 | import net.minecraft.entity.player.PlayerInventory 12 | import net.minecraft.util.text.ITextComponent 13 | import net.minecraftforge.api.distmarker.Dist 14 | import net.minecraftforge.api.distmarker.OnlyIn 15 | 16 | /** 17 | * The GUI/screen class for [RubyBarrel]. 18 | * 19 | * @author TheOnlyTails 20 | */ 21 | @OnlyIn(Dist.CLIENT) 22 | class RubyBarrelScreen(screenContainer: RubyBarrelContainer, inv: PlayerInventory, titleIn: ITextComponent) : 23 | ContainerScreen(screenContainer, inv, titleIn) { 24 | 25 | init { 26 | leftPos = 0 27 | topPos = 0 28 | imageWidth = 176 29 | imageHeight = 204 30 | titleLabelX = 8 31 | titleLabelY = 6 32 | inventoryLabelX = 8 33 | inventoryLabelY = 110 34 | } 35 | 36 | override fun render(matrixStack: MatrixStack, mouseX: Int, mouseY: Int, partialTicks: Float) { 37 | this.renderBackground(matrixStack) 38 | super.render(matrixStack, mouseX, mouseY, partialTicks) 39 | this.renderTooltip(matrixStack, mouseX, mouseY) 40 | } 41 | 42 | override fun renderLabels(matrixStack: MatrixStack, x: Int, y: Int) { 43 | super.renderLabels(matrixStack, x, y) 44 | font.draw(matrixStack, title.string, titleLabelX.toFloat(), titleLabelY.toFloat(), 4210752) 45 | font.draw( 46 | matrixStack, 47 | inventory.displayName.string, 48 | inventoryLabelX.toFloat(), 49 | inventoryLabelY.toFloat(), 50 | 4_210_752 51 | ) 52 | } 53 | 54 | override fun renderBg( 55 | matrixStack: MatrixStack, 56 | partialTicks: Float, 57 | mouseX: Int, 58 | mouseY: Int, 59 | ) { 60 | RenderSystem.color4f(1f, 1f, 1f, 1f) 61 | if (minecraft != null) { 62 | minecraft?.getTextureManager()?.bind(id("textures/gui/ruby_barrel/ruby_barrel.png")) 63 | val x = (width - xSize) / 2 64 | val y = (height - ySize) / 2 65 | this.blit(matrixStack, x, y, 0, 0, xSize, ySize) 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/client/render/RubySheepRenderer.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.client.render 2 | 3 | import com.theonlytails.rubymod.entities.RubySheepEntity 4 | import com.theonlytails.rubymod.id 5 | import net.minecraft.client.renderer.entity.EntityRendererManager 6 | import net.minecraft.client.renderer.entity.MobRenderer 7 | import net.minecraft.client.renderer.entity.model.SheepModel 8 | 9 | /** 10 | * The model class for [RubySheepEntity]. 11 | * 12 | * @author TheOnlyTails 13 | */ 14 | class RubySheepModel : SheepModel() 15 | 16 | /** 17 | * The renderer class for [RubySheepEntity]. 18 | * 19 | * @author TheOnlyTails 20 | */ 21 | class RubySheepRenderer(renderManagerIn: EntityRendererManager) : 22 | MobRenderer(renderManagerIn, RubySheepModel(), 0.7f) { 23 | 24 | init { 25 | addLayer(RubySheepWoolLayer(this)) 26 | } 27 | 28 | override fun getTextureLocation(entity: RubySheepEntity) = id("textures/entity/ruby_sheep/ruby_sheep.png") 29 | } 30 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/client/render/RubySheepWoolLayer.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.client.render 2 | 3 | import com.mojang.blaze3d.matrix.MatrixStack 4 | import com.theonlytails.rubymod.entities.RubySheepEntity 5 | import com.theonlytails.rubymod.id 6 | import net.minecraft.client.renderer.IRenderTypeBuffer 7 | import net.minecraft.client.renderer.entity.IEntityRenderer 8 | import net.minecraft.client.renderer.entity.layers.LayerRenderer 9 | import net.minecraft.client.renderer.entity.model.SheepWoolModel 10 | import net.minecraft.entity.passive.SheepEntity 11 | import net.minecraft.item.DyeColor 12 | import javax.annotation.Nonnull 13 | 14 | /** 15 | * The renderer class for the wool layer of [RubySheepEntity]. 16 | * 17 | * @author TheOnlyTails 18 | */ 19 | class RubySheepWoolLayer(rendererIn: IEntityRenderer) : 20 | LayerRenderer(rendererIn) { 21 | private val sheepModel = SheepWoolModel() 22 | 23 | override fun render( 24 | @Nonnull matrixStackIn: MatrixStack, 25 | bufferIn: IRenderTypeBuffer, 26 | packedLightIn: Int, 27 | entitylivingbaseIn: RubySheepEntity, 28 | limbSwing: Float, 29 | limbSwingAmount: Float, 30 | partialTicks: Float, 31 | ageInTicks: Float, 32 | netHeadYaw: Float, 33 | headPitch: Float, 34 | ) { 35 | if (!entitylivingbaseIn.isSheared && !entitylivingbaseIn.isInvisible) { 36 | val f: Float 37 | val f1: Float 38 | val f2: Float 39 | if (entitylivingbaseIn.hasCustomName() && "jeb_" == entitylivingbaseIn.name.contents) { 40 | val i = entitylivingbaseIn.tickCount / 25 + entitylivingbaseIn.id 41 | val j = DyeColor.values().size 42 | val k = i % j 43 | val l = (i + 1) % j 44 | val f3 = ((entitylivingbaseIn.tickCount % 25).toFloat() + partialTicks) / 25 45 | val dyeRgbOfK = SheepEntity.getColorArray(DyeColor.byId(k)) 46 | val dyeRgbOfL = SheepEntity.getColorArray(DyeColor.byId(l)) 47 | f = dyeRgbOfK[0] * (1.0f - f3) + dyeRgbOfL[0] * f3 48 | f1 = dyeRgbOfK[1] * (1.0f - f3) + dyeRgbOfL[1] * f3 49 | f2 = dyeRgbOfK[2] * (1.0f - f3) + dyeRgbOfL[2] * f3 50 | } else { 51 | val dyeRgb = SheepEntity.getColorArray(entitylivingbaseIn.color) 52 | f = dyeRgb[0] 53 | f1 = dyeRgb[1] 54 | f2 = dyeRgb[2] 55 | } 56 | 57 | coloredCutoutModelCopyLayerRender( 58 | parentModel, 59 | sheepModel, 60 | id("textures/entity/ruby_sheep/ruby_sheep_fur.png"), 61 | matrixStackIn, 62 | bufferIn, 63 | packedLightIn, 64 | entitylivingbaseIn, 65 | limbSwing, 66 | limbSwingAmount, 67 | ageInTicks, 68 | netHeadYaw, 69 | headPitch, 70 | partialTicks, 71 | f, 72 | f1, 73 | f2) 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/containers/RubyBarrelContainer.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.containers 2 | 3 | import com.theonlytails.rubymod.blocks.RubyBarrel 4 | import com.theonlytails.rubymod.registries.BlockRegistry 5 | import com.theonlytails.rubymod.registries.ContainerTypeRegistry 6 | import com.theonlytails.rubymod.tileentities.RubyBarrelTileEntity 7 | import com.theonlytails.rubymod.tileentities.rubyBarrelTileEntitySize 8 | import net.minecraft.entity.player.PlayerEntity 9 | import net.minecraft.entity.player.PlayerInventory 10 | import net.minecraft.inventory.container.Container 11 | import net.minecraft.inventory.container.Slot 12 | import net.minecraft.item.ItemStack 13 | import net.minecraft.network.PacketBuffer 14 | import net.minecraft.util.IWorldPosCallable 15 | import net.minecraft.util.SoundEvents 16 | import net.minecraftforge.items.SlotItemHandler 17 | import java.util.Objects 18 | 19 | /** 20 | * The container class for [RubyBarrel]. 21 | * 22 | * @author TheOnlyTails 23 | */ 24 | class RubyBarrelContainer( 25 | id: Int, 26 | playerInventory: PlayerInventory, 27 | private val tileEntity: RubyBarrelTileEntity, 28 | ) : Container(ContainerTypeRegistry.rubyBarrel, id) { 29 | private val canInteractWithCallable: IWorldPosCallable 30 | 31 | init { 32 | val world = tileEntity.level ?: throw NullPointerException("The world was null, for some reason.") 33 | canInteractWithCallable = IWorldPosCallable.create(world, tileEntity.blockPos) 34 | 35 | tileEntity.players++ 36 | tileEntity.playSound(SoundEvents.BARREL_OPEN) 37 | tileEntity.changeState(tileEntity.blockState, true) 38 | 39 | // Main barrel inventory 40 | val startX = 8 41 | val startY = 18 42 | val slotSizePlus2 = 18 43 | 44 | for (row in 0..4) { 45 | for (column in 0..8) { 46 | addSlot( 47 | SlotItemHandler( 48 | tileEntity.itemHandler, 49 | row * 9 + column, 50 | startX + column * slotSizePlus2, 51 | startY + row * slotSizePlus2 52 | ) 53 | ) 54 | } 55 | } 56 | 57 | // Main Player inventory 58 | val playerInvStartY = startY * 5 + 32 59 | for (row in 0..2) 60 | for (column in 0..8) 61 | addSlot( 62 | Slot( 63 | playerInventory, 64 | 9 + row * 9 + column, 65 | startX + column * slotSizePlus2, 66 | playerInvStartY + row * slotSizePlus2 67 | ) 68 | ) 69 | 70 | // Hotbar 71 | val hotbarY = playerInvStartY + playerInvStartY / 2 - 3 72 | for (column in 0..8) 73 | addSlot( 74 | Slot( 75 | playerInventory, 76 | column, 77 | startX + column * slotSizePlus2, 78 | hotbarY 79 | ) 80 | ) 81 | } 82 | 83 | constructor(windowId: Int, playerInventory: PlayerInventory, data: PacketBuffer) : 84 | this(windowId, playerInventory, getTileEntity(playerInventory, data)) 85 | 86 | override fun removed(playerIn: PlayerEntity) { 87 | super.removed(playerIn) 88 | tileEntity.apply { 89 | players-- 90 | playSound(SoundEvents.BARREL_CLOSE) 91 | changeState(tileEntity.blockState, false) 92 | } 93 | } 94 | 95 | override fun stillValid(playerIn: PlayerEntity): Boolean { 96 | return stillValid( 97 | canInteractWithCallable, playerIn, BlockRegistry.rubyBarrel 98 | ) 99 | } 100 | 101 | override fun quickMoveStack(playerIn: PlayerEntity, index: Int): ItemStack { 102 | var itemStack = ItemStack.EMPTY 103 | val slot = slots[index] 104 | 105 | if (slot != null && slot.hasItem()) { 106 | val itemStack1 = slot.item 107 | itemStack = itemStack1.copy() 108 | 109 | if (index < rubyBarrelTileEntitySize) { 110 | if (!moveItemStackTo(itemStack1, 5 * 9, slots.size, true)) return ItemStack.EMPTY 111 | 112 | } else if (!moveItemStackTo(itemStack1, 0, 5 * 9, false)) return ItemStack.EMPTY 113 | 114 | if (itemStack1.isEmpty) slot.set(ItemStack.EMPTY) else slot.setChanged() 115 | } 116 | 117 | return itemStack 118 | } 119 | 120 | companion object { 121 | private fun getTileEntity(playerInventory: PlayerInventory, data: PacketBuffer): RubyBarrelTileEntity { 122 | Objects.requireNonNull(playerInventory, "playerInventory cannot be null") 123 | Objects.requireNonNull(data, "data cannot be null") 124 | 125 | val tileAtPos = playerInventory.player.level.getBlockEntity(data.readBlockPos()) 126 | 127 | if (tileAtPos is RubyBarrelTileEntity) return tileAtPos 128 | else throw IllegalStateException("Tile entity is not correct! $tileAtPos") 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/datagen/BlockLootTablesGenerator.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.datagen 2 | 3 | import com.theonlytails.loottables.* 4 | import com.theonlytails.rubymod.registries.BlockRegistry 5 | import com.theonlytails.rubymod.registries.ItemRegistry 6 | import net.minecraft.block.Block 7 | import net.minecraft.block.SlabBlock 8 | import net.minecraft.data.DataGenerator 9 | import net.minecraft.data.DirectoryCache 10 | import net.minecraft.data.LootTableProvider 11 | import net.minecraft.enchantment.Enchantments 12 | import net.minecraft.loot.LootParameterSets 13 | import net.minecraft.loot.LootTable 14 | import net.minecraft.loot.functions.CopyName 15 | import net.minecraft.state.properties.SlabType 16 | import net.minecraft.util.ResourceLocation 17 | 18 | /** 19 | * Generates loot tables for blocks. 20 | * 21 | * @author TheOnlyTails 22 | */ 23 | class BlockLootTablesGenerator(private val generator: DataGenerator) : LootTableProvider(generator) { 24 | private val tables = hashMapOf() 25 | 26 | private fun addLootTables(loot: BlockLootTablesGenerator) { 27 | // Centrifuge 28 | loot.addLoot( 29 | BlockRegistry.centrifuge, lootTable(LootParameterSets.BLOCK) { 30 | pool { 31 | alternativesEntry( 32 | itemEntry(ItemRegistry.centrifuge, addToPool = false) { 33 | condition { hasSilkTouch } 34 | }, 35 | itemEntry(ItemRegistry.ruby, addToPool = false), 36 | ) 37 | 38 | condition { survivesExplosion() } 39 | } 40 | } 41 | ) 42 | 43 | // Ruby Barrel 44 | loot.addLoot(BlockRegistry.rubyBarrel, lootTable(LootParameterSets.BLOCK) { 45 | pool { 46 | itemEntry(BlockRegistry.rubyBarrel) { 47 | function { copyName(CopyName.Source.BLOCK_ENTITY) } 48 | } 49 | 50 | condition { survivesExplosion() } 51 | } 52 | }) 53 | 54 | // Ruby Block 55 | loot.dropSelf(BlockRegistry.rubyBlock) 56 | 57 | // Ruby Slab 58 | loot.dropSlabs(BlockRegistry.rubySlab) 59 | 60 | // Ruby Stairs 61 | loot.dropSelf(BlockRegistry.rubyStairs) 62 | 63 | // Ruby Pressure Plate 64 | loot.dropSelf(BlockRegistry.rubyPressurePlate) 65 | 66 | // Ruby Button 67 | loot.dropSelf(BlockRegistry.rubyButton) 68 | 69 | // Ruby Wall 70 | loot.dropSelf(BlockRegistry.rubyWall) 71 | 72 | // Ruby Carpet 73 | loot.dropSelf(BlockRegistry.rubyCarpet) 74 | 75 | // Logic Gate 76 | loot.dropSelf(BlockRegistry.logicGate) 77 | 78 | // Ruby Ore 79 | loot.addLoot(BlockRegistry.rubyOre, lootTable(LootParameterSets.BLOCK) { 80 | pool { 81 | alternativesEntry( 82 | itemEntry(ItemRegistry.rubyOre, addToPool = false) { 83 | condition { hasSilkTouch } 84 | }, 85 | itemEntry(ItemRegistry.ruby, addToPool = false) { 86 | function { explosionDecay() } 87 | function { oreBonusCount(Enchantments.BLOCK_FORTUNE) } 88 | }, 89 | ) 90 | 91 | condition { survivesExplosion() } 92 | } 93 | }) 94 | 95 | // Ruby Wool 96 | loot.dropSelf(BlockRegistry.rubyWool) 97 | } 98 | 99 | // Always drop, unless explosion 100 | private fun dropSelf(block: Block) { 101 | tables[block] = lootTable(LootParameterSets.BLOCK) { 102 | pool { 103 | itemEntry(block) 104 | condition { survivesExplosion() } 105 | } 106 | } 107 | } 108 | 109 | private fun dropSlabs(block: Block) { 110 | tables[block] = lootTable(LootParameterSets.BLOCK) { 111 | pool { 112 | itemEntry(block) 113 | 114 | condition { survivesExplosion() } 115 | 116 | function { 117 | setConstantCount(2) { 118 | condition { 119 | blockStateProperty(block) { 120 | setProperties(stateProperties { hasProperty(SlabBlock.TYPE, SlabType.DOUBLE) }) 121 | } 122 | } 123 | } 124 | } 125 | } 126 | } 127 | } 128 | 129 | // Add a custom loot table 130 | private fun addLoot(block: Block, loot: LootTable) { 131 | tables[block] = loot 132 | } 133 | 134 | /** 135 | * Performs this provider's action. 136 | */ 137 | override fun run(cache: DirectoryCache) { 138 | addLootTables(this) 139 | 140 | val namespacedTables = hashMapOf() 141 | 142 | for (entry in tables) { 143 | namespacedTables[entry.key.lootTable] = entry.value 144 | } 145 | 146 | writeLootTables(generator, namespacedTables, cache) 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/datagen/BlockTagDataGenerator.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.datagen 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.registries.BlockRegistry 5 | import net.minecraft.data.BlockTagsProvider 6 | import net.minecraft.data.DataGenerator 7 | import net.minecraft.tags.BlockTags.* 8 | import net.minecraft.util.ResourceLocation 9 | import net.minecraftforge.common.Tags.Blocks 10 | import net.minecraftforge.common.data.ExistingFileHelper 11 | import java.nio.file.Path 12 | 13 | /** 14 | * Generates block tags. 15 | * 16 | * @author TheOnlyTails 17 | */ 18 | class BlockTagDataGenerator(generator: DataGenerator, helper: ExistingFileHelper) : 19 | BlockTagsProvider(generator, MOD_ID, helper) { 20 | /** 21 | * Register tags for each block. 22 | */ 23 | override fun addTags() { 24 | // Vanilla tags 25 | tag(BEACON_BASE_BLOCKS).add(BlockRegistry.rubyBlock) 26 | tag(CARPETS).add(BlockRegistry.rubyCarpet) 27 | tag(WOOL).add(BlockRegistry.rubyWool) 28 | tag(PRESSURE_PLATES).add(BlockRegistry.rubyPressurePlate) 29 | tag(BUTTONS).add(BlockRegistry.rubyButton) 30 | tag(WALLS).add(BlockRegistry.rubyWall) 31 | 32 | // Forge Tags 33 | tag(Blocks.ORES).add(BlockRegistry.rubyOre) 34 | tag(Blocks.STORAGE_BLOCKS).add(BlockRegistry.rubyBlock) 35 | } 36 | 37 | /** 38 | * Resolves a Path for the location to save the given tag. 39 | */ 40 | override fun getPath(id: ResourceLocation): Path = super.getPath(id) 41 | } 42 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/datagen/DataGenerators.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.datagen 2 | 3 | import com.google.gson.Gson 4 | import com.google.gson.GsonBuilder 5 | import com.theonlytails.rubymod.logger 6 | import net.minecraft.data.DataGenerator 7 | import net.minecraft.data.DirectoryCache 8 | import net.minecraft.data.IDataProvider 9 | import net.minecraft.loot.LootTable 10 | import net.minecraft.loot.LootTableManager 11 | import net.minecraft.util.ResourceLocation 12 | import net.minecraftforge.eventbus.api.SubscribeEvent 13 | import net.minecraftforge.fml.common.Mod 14 | import net.minecraftforge.fml.event.lifecycle.GatherDataEvent 15 | 16 | val gson: Gson = GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create() 17 | 18 | /** 19 | * Calls all of the data generators to regenerate their files. 20 | * 21 | * @author TheOnlyTails 22 | */ 23 | @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) 24 | object DataGenerators { 25 | 26 | @SubscribeEvent 27 | fun gatherData(event: GatherDataEvent) { 28 | val generator = event.generator 29 | val helper = event.existingFileHelper 30 | 31 | if (event.includeClient()) { 32 | generator.addProvider(LangGenerator.English(generator)) 33 | } 34 | 35 | if (event.includeServer()) { 36 | val blockTags = BlockTagDataGenerator(generator, helper) 37 | val itemModels = ItemModelsGenerator(generator, helper) 38 | 39 | generator.addProvider(RecipesGenerator(generator)) 40 | generator.addProvider(BlockLootTablesGenerator(generator)) 41 | generator.addProvider(EntityLootTablesGenerator(generator)) 42 | generator.addProvider(GiftLootTablesGenerator(generator)) 43 | generator.addProvider(blockTags) 44 | generator.addProvider(ItemTagGenerator(generator, blockTags, helper)) 45 | generator.addProvider(itemModels) 46 | } 47 | } 48 | } 49 | 50 | fun writeLootTables(generator: DataGenerator, tables: Map, cache: DirectoryCache) { 51 | val output = generator.outputFolder 52 | 53 | tables.forEach { (key, table) -> 54 | val path = output.resolve("data/${key.namespace}/loot_tables/${key.path}.json") 55 | 56 | try { 57 | IDataProvider.save(gson, cache, LootTableManager.serialize(table), path) 58 | } catch (e: Exception) { 59 | logger.error("Couldn't write loot table $path", e) 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/datagen/EntityLootTablesGenerator.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.datagen 2 | 3 | import com.theonlytails.rubymod.registries.EntityTypeRegistry 4 | import com.theonlytails.rubymod.registries.ItemRegistry 5 | import net.minecraft.data.DataGenerator 6 | import net.minecraft.data.DirectoryCache 7 | import net.minecraft.data.LootTableProvider 8 | import net.minecraft.data.loot.EntityLootTables 9 | import net.minecraft.entity.EntityType 10 | import net.minecraft.loot.LootParameterSets 11 | import net.minecraft.loot.LootTable 12 | import net.minecraft.util.ResourceLocation 13 | 14 | /** 15 | * Generates loot tables for entities. 16 | * 17 | * @author TheOnlyTails 18 | */ 19 | class EntityLootTablesGenerator(private val generator: DataGenerator) : LootTableProvider(generator) { 20 | private val tables = hashMapOf, LootTable.Builder>() 21 | 22 | private fun addLootTables(loot: EntityLootTablesGenerator) { 23 | // Ruby Sheep 24 | loot.addLoot( 25 | EntityTypeRegistry.rubySheep, 26 | EntityLootTables.createSheepTable { ItemRegistry.rubyWool }, 27 | ) 28 | } 29 | 30 | /** 31 | * Performs this provider's action. 32 | */ 33 | override fun run(cache: DirectoryCache) { 34 | addLootTables(this) 35 | 36 | val namespacedTables = hashMapOf() 37 | 38 | for (entry in tables) { 39 | namespacedTables[entry.key.defaultLootTable] = entry.value.setParamSet(LootParameterSets.ENTITY).build() 40 | } 41 | 42 | writeLootTables(generator, namespacedTables, cache) 43 | } 44 | 45 | private fun addLoot(entityType: EntityType<*>, loot: LootTable.Builder) { 46 | tables[entityType] = loot 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/datagen/GiftLootTablesGenerator.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.datagen 2 | 3 | import com.theonlytails.loottables.itemEntry 4 | import com.theonlytails.loottables.lootTable 5 | import com.theonlytails.loottables.pool 6 | import com.theonlytails.rubymod.id 7 | import net.minecraft.data.DataGenerator 8 | import net.minecraft.data.DirectoryCache 9 | import net.minecraft.data.LootTableProvider 10 | import net.minecraft.item.Items 11 | import net.minecraft.loot.LootParameterSets 12 | 13 | /** 14 | * Generates loot tables for hero of the village gifts. 15 | * 16 | * @author TheOnlyTails 17 | */ 18 | class GiftLootTablesGenerator(private val generator: DataGenerator) : LootTableProvider(generator) { 19 | private val jewelerGiftLootTable = id("gameplay/hero_of_the_village/jeweler_gift") 20 | 21 | private val tables = hashMapOf( 22 | jewelerGiftLootTable to lootTable(LootParameterSets.GIFT) { 23 | pool { 24 | itemEntry(Items.IRON_NUGGET) 25 | itemEntry(Items.IRON_INGOT) 26 | itemEntry(Items.GOLD_NUGGET) 27 | itemEntry(Items.GOLD_INGOT) 28 | } 29 | } 30 | ) 31 | 32 | /** 33 | * Performs this provider's action. 34 | */ 35 | override fun run(cache: DirectoryCache) { 36 | writeLootTables(generator, tables, cache) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/datagen/ItemModelsGenerator.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.datagen 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.id 5 | import net.minecraft.data.DataGenerator 6 | import net.minecraftforge.client.model.generators.ItemModelProvider 7 | import net.minecraftforge.client.model.generators.ModelFile 8 | import net.minecraftforge.common.data.ExistingFileHelper 9 | 10 | class ItemModelsGenerator(generator: DataGenerator, helper: ExistingFileHelper) : 11 | ItemModelProvider(generator, MOD_ID, helper) { 12 | 13 | override fun registerModels() { 14 | // ruby 15 | getBuilder("ruby") 16 | .parent(ModelFile.UncheckedModelFile("item/generated")) 17 | .texture("layer0", id("items/ruby")) 18 | 19 | // ghost water bucket 20 | getBuilder("ghost_water_bucket") 21 | .parent(ModelFile.UncheckedModelFile("item/generated")) 22 | .texture("layer0", id("items/ghost_water_bucket")) 23 | 24 | // poisoned apple 25 | getBuilder("poisoned_apple") 26 | .parent(ModelFile.UncheckedModelFile("item/generated")) 27 | .texture("layer0", id("items/poisoned_apple")) 28 | 29 | // ruby sheep spawn egg 30 | getBuilder("ruby_sheep_spawn_egg") 31 | .parent(ModelFile.UncheckedModelFile("item/template_spawn_egg")) 32 | 33 | generateToolModels() 34 | generateArmorModels() 35 | generateBlockItemModels() 36 | } 37 | 38 | private fun generateBlockItemModels() { 39 | // centrifuge 40 | getBuilder("centrifuge") 41 | .parent(ModelFile.UncheckedModelFile(id("block/centrifuge"))) 42 | 43 | // logic gate 44 | getBuilder("logic_gate") 45 | .parent(ModelFile.UncheckedModelFile("item/generated")) 46 | .texture("layer0", id("items/logic_gate")) 47 | 48 | // centrifuge 49 | getBuilder("ruby_barrel") 50 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_barrel"))) 51 | 52 | // ruby block 53 | getBuilder("ruby_block") 54 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_block"))) 55 | 56 | // ruby button 57 | getBuilder("ruby_button") 58 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_button_inventory"))) 59 | 60 | // ruby carpet 61 | getBuilder("ruby_carpet") 62 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_carpet"))) 63 | 64 | // ruby ore 65 | getBuilder("ruby_ore") 66 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_ore"))) 67 | 68 | // ruby pressure plate 69 | getBuilder("ruby_pressure_plate") 70 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_pressure_plate"))) 71 | 72 | // ruby slab 73 | getBuilder("ruby_slab") 74 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_slab"))) 75 | 76 | // ruby stairs 77 | getBuilder("ruby_stairs") 78 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_stairs"))) 79 | 80 | // ruby wall 81 | getBuilder("ruby_wall") 82 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_wall_inventory"))) 83 | 84 | // ruby wool 85 | getBuilder("ruby_wool") 86 | .parent(ModelFile.UncheckedModelFile(id("block/ruby_wool"))) 87 | } 88 | 89 | private fun generateToolModels() { 90 | getBuilder("ruby_pickaxe") 91 | .parent(ModelFile.UncheckedModelFile("item/handheld")) 92 | .texture("layer0", id("items/ruby_pickaxe")) 93 | 94 | getBuilder("ruby_sword") 95 | .parent(ModelFile.UncheckedModelFile("item/handheld")) 96 | .texture("layer0", id("items/ruby_sword")) 97 | 98 | getBuilder("ruby_axe") 99 | .parent(ModelFile.UncheckedModelFile("item/handheld")) 100 | .texture("layer0", id("items/ruby_axe")) 101 | 102 | getBuilder("ruby_shovel") 103 | .parent(ModelFile.UncheckedModelFile("item/handheld")) 104 | .texture("layer0", id("items/ruby_shovel")) 105 | 106 | getBuilder("ruby_hoe") 107 | .parent(ModelFile.UncheckedModelFile("item/handheld")) 108 | .texture("layer0", id("items/ruby_hoe")) 109 | } 110 | 111 | private fun generateArmorModels() { 112 | getBuilder("ruby_boots") 113 | .parent(ModelFile.UncheckedModelFile("item/generated")) 114 | .texture("layer0", id("items/ruby_boots")) 115 | 116 | getBuilder("ruby_chestplate") 117 | .parent(ModelFile.UncheckedModelFile("item/generated")) 118 | .texture("layer0", id("items/ruby_chestplate")) 119 | 120 | getBuilder("ruby_leggings") 121 | .parent(ModelFile.UncheckedModelFile("item/generated")) 122 | .texture("layer0", id("items/ruby_leggings")) 123 | 124 | getBuilder("ruby_helmet") 125 | .parent(ModelFile.UncheckedModelFile("item/generated")) 126 | .texture("layer0", id("items/ruby_helmet")) 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/datagen/ItemTagGenerator.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.datagen 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.registries.ItemRegistry 5 | import net.minecraft.data.DataGenerator 6 | import net.minecraft.data.ItemTagsProvider 7 | import net.minecraft.tags.ItemTags 8 | import net.minecraft.util.ResourceLocation 9 | import net.minecraftforge.common.Tags 10 | import net.minecraftforge.common.data.ExistingFileHelper 11 | import java.nio.file.Path 12 | 13 | /** 14 | * Generates item tags. 15 | * 16 | * @author TheOnlyTails 17 | */ 18 | class ItemTagGenerator( 19 | generator: DataGenerator, 20 | blockTags: BlockTagDataGenerator, 21 | helper: ExistingFileHelper, 22 | ) : ItemTagsProvider( 23 | generator, 24 | blockTags, 25 | MOD_ID, 26 | helper 27 | ) { 28 | 29 | /** 30 | * Register tags for each block. 31 | */ 32 | override fun addTags() { 33 | // Vanilla tags 34 | tag(ItemTags.CARPETS).add(ItemRegistry.rubyCarpet) 35 | tag(ItemTags.WOOL).add(ItemRegistry.rubyWool) 36 | tag(ItemTags.BEACON_PAYMENT_ITEMS).add(ItemRegistry.ruby) 37 | tag(ItemTags.BUTTONS).add(ItemRegistry.rubyButton) 38 | tag(ItemTags.WALLS).add(ItemRegistry.rubyWall) 39 | 40 | // Forge tags 41 | tag(Tags.Items.ORES).add(ItemRegistry.rubyOre) 42 | tag(Tags.Items.GEMS).add(ItemRegistry.ruby) 43 | tag(Tags.Items.STORAGE_BLOCKS).add(ItemRegistry.rubyBlock) 44 | } 45 | 46 | /** 47 | * Resolves a Path for the location to save the given tag. 48 | */ 49 | override fun getPath(id: ResourceLocation): Path = super.getPath(id) 50 | } 51 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/datagen/LangGenerator.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.datagen 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.registries.* 5 | import net.minecraft.data.DataGenerator 6 | import net.minecraftforge.common.data.LanguageProvider 7 | 8 | /** 9 | * Generates language files. 10 | * 11 | * @author TheOnlyTails 12 | */ 13 | abstract class LangGenerator(generator: DataGenerator, locale: String) : 14 | LanguageProvider(generator, MOD_ID, locale) { 15 | 16 | class English(generator: DataGenerator) : LangGenerator(generator, "en_us") { 17 | override fun addTranslations() { 18 | // Items 19 | add(ItemRegistry.ruby, "Ruby") 20 | add(ItemRegistry.poisonedApple, "Poisoned Apple") 21 | add(ItemRegistry.ghostWaterBucket, "Ghost Water Bucket") 22 | add(ItemRegistry.rubySheepSpawnEgg, "Ruby Sheep Spawn Egg") 23 | 24 | // Effects and Potions 25 | add("item.minecraft.potion.effect.motivation", "Potion of Motivation") 26 | add("item.minecraft.splash_potion.effect.motivation", "Splash Potion of Motivation") 27 | add("item.minecraft.lingering_potion.effect.motivation", "Lingering Potion of Motivation") 28 | add("item.minecraft.tipped_arrow.effect.motivation", "Tipped Arrow of Motivation") 29 | add("item.minecraft.potion.effect.laziness", "Potion of Laziness") 30 | add("item.minecraft.splash_potion.effect.laziness", "Splash Potion of Laziness") 31 | add("item.minecraft.lingering_potion.effect.laziness", "Lingering Potion of Laziness") 32 | add("item.minecraft.tipped_arrow.effect.laziness", "Tipped Arrow of Laziness") 33 | 34 | // Blocks 35 | add(BlockRegistry.rubyBlock, "Ruby Block") 36 | add(BlockRegistry.rubySlab, "Ruby Slab") 37 | add(BlockRegistry.rubyStairs, "Ruby Stairs") 38 | add(BlockRegistry.rubyPressurePlate, "Ruby Pressure Plate") 39 | add(BlockRegistry.rubyButton, "Ruby Button") 40 | add(BlockRegistry.rubyWall, "Ruby Wall") 41 | add(BlockRegistry.rubyOre, "Ruby Ore") 42 | add(BlockRegistry.rubyWool, "Ruby Wool") 43 | add(BlockRegistry.rubyCarpet, "Ruby Carpet") 44 | add(BlockRegistry.centrifuge, "Centrifuge") 45 | add(BlockRegistry.rubyBarrel, "Ruby Barrel") 46 | add(BlockRegistry.logicGate, "Logic Gate") 47 | 48 | // Tools 49 | add(ItemRegistry.rubySword, "Ruby Sword") 50 | add(ItemRegistry.rubyPickaxe, "Ruby Pickaxe") 51 | add(ItemRegistry.rubyAxe, "Ruby Axe") 52 | add(ItemRegistry.rubyShovel, "Ruby Shovel") 53 | add(ItemRegistry.rubyHoe, "Ruby Hoe") 54 | 55 | // Armor 56 | add(ItemRegistry.rubyHelmet, "Ruby Helmet") 57 | add(ItemRegistry.rubyChestplate, "Ruby Chestplate") 58 | add(ItemRegistry.rubyLeggings, "Ruby Leggings") 59 | add(ItemRegistry.rubyBoots, "Ruby Boots") 60 | 61 | // Entities 62 | add(EntityTypeRegistry.rubySheep, "Ruby Sheep") 63 | 64 | // Enchantments 65 | add(EnchantmentRegistry.stinger, "Stinger") 66 | 67 | // Biomes 68 | add("biome.$MOD_ID.ruby_hills", "Ruby Hills") 69 | 70 | // Villager Professions 71 | add("entity.minecraft.villager.$MOD_ID.jeweler", "Jeweler") 72 | 73 | // Creative tabs 74 | add("itemGroup.ruby_tab", "RubyMod") 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/enchantments/StingerEnchantment.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.enchantments 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.registries.EnchantmentRegistry 5 | import net.minecraft.enchantment.Enchantment 6 | import net.minecraft.enchantment.EnchantmentHelper 7 | import net.minecraft.enchantment.EnchantmentType 8 | import net.minecraft.enchantment.Enchantments 9 | import net.minecraft.entity.LivingEntity 10 | import net.minecraft.inventory.EquipmentSlotType 11 | import net.minecraft.item.ItemStack 12 | import net.minecraft.item.Items 13 | import net.minecraft.potion.EffectInstance 14 | import net.minecraft.potion.Effects 15 | import net.minecraftforge.event.entity.player.AttackEntityEvent 16 | import net.minecraftforge.eventbus.api.SubscribeEvent 17 | import net.minecraftforge.fml.common.Mod.EventBusSubscriber 18 | 19 | /** 20 | * Holds the properties of the stinger enchantment. 21 | * 22 | * @author TheOnlyTails 23 | */ 24 | class StingerEnchantment : Enchantment(Rarity.VERY_RARE, EnchantmentType.WEAPON, arrayOf(EquipmentSlotType.MAINHAND)) { 25 | override fun getMaxLevel() = 2 26 | 27 | override fun canEnchant(stack: ItemStack) = stack.item == Items.SHEARS || super.canEnchant(stack) 28 | 29 | override fun isTradeable() = false 30 | 31 | override fun checkCompatibility(enchant: Enchantment) = 32 | super.checkCompatibility(enchant) && enchant != Enchantments.SHARPNESS && enchant != Enchantments.MENDING 33 | 34 | /** 35 | * Holds the functionality of the stinger enchantment. 36 | * 37 | * @author TheOnlyTails 38 | */ 39 | @EventBusSubscriber(modid = MOD_ID, bus = EventBusSubscriber.Bus.FORGE) 40 | private object StingerEnchantmentEquipped { 41 | @SubscribeEvent 42 | fun damageWithEnchant(event: AttackEntityEvent) { 43 | val mainHandItem = event.player.mainHandItem 44 | val enchant = EnchantmentRegistry.stinger 45 | val enchantLevel = EnchantmentHelper.getItemEnchantmentLevel(enchant, mainHandItem) 46 | 47 | if (EnchantmentHelper.getEnchantments(mainHandItem).containsKey(enchant)) { 48 | val target = event.target 49 | if (target is LivingEntity) target.addEffect(EffectInstance(Effects.POISON, 100, enchantLevel)) 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/entities/RubySheepEntity.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.entities 2 | 3 | import com.theonlytails.rubymod.id 4 | import com.theonlytails.rubymod.registries.ItemRegistry 5 | import net.minecraft.block.BlockState 6 | import net.minecraft.entity.EntityType 7 | import net.minecraft.entity.ILivingEntityData 8 | import net.minecraft.entity.SpawnReason 9 | import net.minecraft.entity.ai.attributes.AttributeModifierMap 10 | import net.minecraft.entity.ai.attributes.Attributes 11 | import net.minecraft.entity.ai.goal.* 12 | import net.minecraft.entity.passive.AnimalEntity 13 | import net.minecraft.entity.passive.SheepEntity 14 | import net.minecraft.entity.player.PlayerEntity 15 | import net.minecraft.item.DyeColor 16 | import net.minecraft.item.ItemStack 17 | import net.minecraft.item.Items 18 | import net.minecraft.item.crafting.Ingredient 19 | import net.minecraft.nbt.CompoundNBT 20 | import net.minecraft.util.DamageSource 21 | import net.minecraft.util.SoundCategory 22 | import net.minecraft.util.SoundEvent 23 | import net.minecraft.util.SoundEvents 24 | import net.minecraft.util.math.BlockPos 25 | import net.minecraft.world.DifficultyInstance 26 | import net.minecraft.world.IServerWorld 27 | import net.minecraft.world.World 28 | import kotlin.math.max 29 | 30 | /** 31 | * The ruby sheep entity class. 32 | * 33 | * @author TheOnlyTails 34 | */ 35 | class RubySheepEntity(type: EntityType, worldIn: World) : SheepEntity(type, worldIn) { 36 | private lateinit var eatGrassGoal: EatGrassGoal 37 | private var rubySheepTimer = 0 38 | 39 | override fun registerGoals() { 40 | super.registerGoals() 41 | 42 | eatGrassGoal = EatGrassGoal(this) 43 | 44 | goalSelector.addGoal(0, SwimGoal(this)) 45 | goalSelector.addGoal(1, PanicGoal(this, 1.25)) 46 | goalSelector.addGoal(2, BreedGoal(this, 1.0)) 47 | goalSelector.addGoal(2, BreedGoal(this, 1.0, SheepEntity::class.java)) 48 | goalSelector.addGoal(3, TemptGoal(this, 1.1, TEMPTATION_ITEMS, false)) 49 | goalSelector.addGoal(4, FollowParentGoal(this, 1.1)) 50 | goalSelector.addGoal(5, this.eatGrassGoal) 51 | goalSelector.addGoal(6, WaterAvoidingRandomWalkingGoal(this, 1.0)) 52 | goalSelector.addGoal(7, LookAtGoal(this, PlayerEntity::class.java, 6.0f)) 53 | goalSelector.addGoal(8, LookRandomlyGoal(this)) 54 | } 55 | 56 | override fun getAmbientSound(): SoundEvent = SoundEvents.SHEEP_AMBIENT 57 | 58 | override fun getDeathSound(): SoundEvent = SoundEvents.SHEEP_DEATH 59 | 60 | override fun getHurtSound(damageSourceIn: DamageSource): SoundEvent = SoundEvents.SHEEP_HURT 61 | 62 | override fun playStepSound(pos: BlockPos, blockIn: BlockState) = 63 | playSound(SoundEvents.SHEEP_STEP, 0.1f, 1f) 64 | 65 | override fun customServerAiStep() { 66 | rubySheepTimer = this.eatGrassGoal.eatAnimationTick 67 | super.customServerAiStep() 68 | } 69 | 70 | override fun aiStep() { 71 | if (level.isClientSide) rubySheepTimer = max(0, rubySheepTimer - 1) 72 | super.aiStep() 73 | } 74 | 75 | override fun handleEntityEvent(id: Byte) = 76 | if (id.toInt() == 10) rubySheepTimer = 40 else super.handleEntityEvent(id) 77 | 78 | override fun shear(category: SoundCategory) { 79 | level.playSound(null, this, SoundEvents.SHEEP_SHEAR, category, 1.0f, 1.0f) 80 | this.isSheared = true 81 | 82 | for (j in 0 until 1 + random.nextInt(3)) { 83 | val itementity = this.spawnAtLocation(ItemRegistry.rubyWool, 1) 84 | if (itementity != null) { 85 | itementity.deltaMovement = itementity.deltaMovement.add( 86 | ((random.nextFloat() - random.nextFloat()) * 0.1f).toDouble(), 87 | (random.nextFloat() * 0.05f).toDouble(), 88 | ((random.nextFloat() - random.nextFloat()) * 0.1f).toDouble() 89 | ) 90 | } 91 | } 92 | } 93 | 94 | override fun onSheared( 95 | player: PlayerEntity?, 96 | item: ItemStack, 97 | world: World, 98 | pos: BlockPos, 99 | fortune: Int, 100 | ) = (if (!world.isClientSide) listOf(*((0 until 1 + random.nextInt(3)) 101 | .map { ItemStack(ItemRegistry.rubyWool) }.toTypedArray())) 102 | .also { isSheared = true } 103 | else emptyList()).also { 104 | world.playSound( 105 | null, 106 | this, 107 | SoundEvents.SHEEP_SHEAR, 108 | if (player == null) SoundCategory.BLOCKS else SoundCategory.PLAYERS, 109 | 1.0f, 110 | 1.0f 111 | ) 112 | } 113 | 114 | override fun finalizeSpawn( 115 | worldIn: IServerWorld, 116 | difficultyIn: DifficultyInstance, 117 | reason: SpawnReason, 118 | spawnDataIn: ILivingEntityData?, 119 | dataTag: CompoundNBT?, 120 | ) = super.finalizeSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag).also { 121 | this.color = DyeColor.WHITE 122 | } 123 | 124 | override fun getDefaultLootTable() = id("entities/ruby_sheep") 125 | 126 | override fun canMate(otherAnimal: AnimalEntity) = otherAnimal is SheepEntity && otherAnimal.isInLove() 127 | 128 | companion object { 129 | val TEMPTATION_ITEMS: Ingredient = Ingredient.of(ItemRegistry.ruby, Items.WHEAT) 130 | 131 | val customAttributes: AttributeModifierMap = createMobAttributes() 132 | .add(Attributes.MAX_HEALTH, 10.0) 133 | .add(Attributes.MOVEMENT_SPEED, 0.23) 134 | .build() 135 | } 136 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/items/CustomSpawnEggItem.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.items 2 | 3 | import com.theonlytails.rubymod.rubyTabProperty 4 | import net.minecraft.block.DispenserBlock 5 | import net.minecraft.dispenser.DefaultDispenseItemBehavior 6 | import net.minecraft.dispenser.IBlockSource 7 | import net.minecraft.entity.EntityType 8 | import net.minecraft.entity.SpawnReason 9 | import net.minecraft.item.ItemStack 10 | import net.minecraft.item.SpawnEggItem 11 | import net.minecraft.nbt.CompoundNBT 12 | import net.minecraft.util.Direction 13 | import net.minecraftforge.common.util.Lazy 14 | import java.util.function.Supplier 15 | 16 | /** 17 | * A custom spawn egg. 18 | * 19 | * @author TheOnlyTails 20 | */ 21 | class CustomSpawnEggItem( 22 | entityTypeSupplier: Supplier>, 23 | primaryColorIn: Int, 24 | secondaryColorIn: Int, 25 | builder: Properties = rubyTabProperty, 26 | ) : SpawnEggItem(@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") null, 27 | primaryColorIn, 28 | secondaryColorIn, 29 | builder) { 30 | private val entityTypeSupplier = Lazy.of(entityTypeSupplier::get) 31 | 32 | override fun getType(nbt: CompoundNBT?): EntityType<*> = entityTypeSupplier.get() 33 | 34 | companion object { 35 | private val unaddedEggs: MutableList = ArrayList() 36 | 37 | fun initSpawnEggs() { 38 | val dispenserBehavior: DefaultDispenseItemBehavior = object : DefaultDispenseItemBehavior() { 39 | override fun execute(source: IBlockSource, stack: ItemStack): ItemStack { 40 | val direction = source.blockState.getValue(DispenserBlock.FACING) 41 | 42 | (stack.item as SpawnEggItem).getType(stack.tag).apply { 43 | spawn( 44 | source.level, stack, null, source.pos.relative(direction), 45 | SpawnReason.DISPENSER, direction != Direction.UP, false 46 | ) 47 | } 48 | 49 | stack.shrink(1) 50 | return stack 51 | } 52 | } 53 | 54 | unaddedEggs.forEach { 55 | BY_ID[it.getType(null)] = it 56 | DispenserBlock.registerBehavior(it, dispenserBehavior) 57 | } 58 | 59 | unaddedEggs.clear() 60 | } 61 | } 62 | 63 | init { 64 | unaddedEggs.add(this) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/items/PoisonedApple.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.items 2 | 3 | import com.theonlytails.rubymod.entities.RubySheepEntity 4 | import com.theonlytails.rubymod.util.effect 5 | import net.minecraft.entity.LivingEntity 6 | import net.minecraft.entity.player.PlayerEntity 7 | import net.minecraft.item.Food 8 | import net.minecraft.item.Item 9 | import net.minecraft.item.ItemGroup 10 | import net.minecraft.item.ItemStack 11 | import net.minecraft.potion.EffectInstance 12 | import net.minecraft.potion.Effects 13 | import net.minecraft.util.ActionResultType 14 | import net.minecraft.util.Hand 15 | import net.minecraft.util.text.StringTextComponent 16 | 17 | /** 18 | * The poisoned apple class. 19 | * 20 | * @author TheOnlyTails 21 | */ 22 | class PoisonedApple : Item(Properties() 23 | .tab(ItemGroup.TAB_FOOD) 24 | .food(Food.Builder() 25 | .nutrition(7) 26 | .saturationMod(1.2f) 27 | // Gives you Nausea 2 for 7 seconds 100% of the time; 28 | .effect(1f) { EffectInstance(Effects.CONFUSION, 7 * 20, 1) } 29 | // Gives you Poison 2 for 9 seconds 100% of the time; 30 | .effect(1f) { EffectInstance(Effects.POISON, 9 * 20, 1) } 31 | // Gives you Glowing 1 for 10 seconds 100% of the time; 32 | .effect(1f) { EffectInstance(Effects.GLOWING, 10 * 20, 0) } 33 | // Gives you Hunger 3 for 3 seconds 10% of the time; 34 | .effect(0.1f) { EffectInstance(Effects.HUNGER, 3 * 20, 2) } 35 | // Gives you Blindness (!) 3 for 5 seconds 5% of the time; 36 | .effect(0.05f) { EffectInstance(Effects.BLINDNESS, 5 * 20, 2) } 37 | // Gives you Luck (!) 1 for 1 seconds 50% of the time; 38 | .effect(0.5f) { EffectInstance(Effects.LUCK, 20, 0) } 39 | .alwaysEat() 40 | .build()) 41 | ) { 42 | 43 | override fun interactLivingEntity( 44 | stack: ItemStack, 45 | player: PlayerEntity, 46 | target: LivingEntity, 47 | hand: Hand, 48 | ): ActionResultType = if (target is RubySheepEntity && target.isAlive) { 49 | target.addEffect(EffectInstance(Effects.POISON, 9 * 20, 1)) 50 | target.setGlowing(true) 51 | 52 | if (!player.level.isClientSide) { 53 | player.sendMessage( 54 | StringTextComponent("I don't think that sheep is feeling so well..."), 55 | player.uuid 56 | ) 57 | 58 | stack.shrink(1) 59 | } 60 | 61 | ActionResultType.sidedSuccess(player.level.isClientSide) 62 | } else ActionResultType.PASS 63 | } 64 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/items/Ruby.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.items 2 | 3 | import com.theonlytails.rubymod.entities.RubySheepEntity 4 | import com.theonlytails.rubymod.registries.EntityTypeRegistry 5 | import com.theonlytails.rubymod.rubyTabProperty 6 | import net.minecraft.entity.LivingEntity 7 | import net.minecraft.entity.SpawnReason 8 | import net.minecraft.entity.passive.SheepEntity 9 | import net.minecraft.entity.player.PlayerEntity 10 | import net.minecraft.item.Item 11 | import net.minecraft.item.ItemStack 12 | import net.minecraft.util.ActionResultType 13 | import net.minecraft.util.Hand 14 | import net.minecraft.world.IServerWorld 15 | 16 | /** 17 | * Holds the custom functionality of rubies. 18 | * 19 | * @author TheOnlyTails 20 | */ 21 | class Ruby : Item(rubyTabProperty) { 22 | override fun interactLivingEntity( 23 | stack: ItemStack, 24 | playerIn: PlayerEntity, 25 | target: LivingEntity, 26 | hand: Hand, 27 | ): ActionResultType = 28 | if (target is SheepEntity && target.isAlive && !target.isSheared && target !is RubySheepEntity) { 29 | if (!playerIn.level.isClientSide) { 30 | EntityTypeRegistry.rubySheep.create(playerIn.level)?.apply { 31 | moveTo( 32 | target.x, 33 | target.y, 34 | target.z, 35 | target.yRot, 36 | target.xRot 37 | ) 38 | 39 | finalizeSpawn( 40 | playerIn.level as IServerWorld, 41 | playerIn.level.getCurrentDifficultyAt(blockPosition()), 42 | SpawnReason.CONVERSION, 43 | null, 44 | null 45 | ) 46 | 47 | playerIn.level.addFreshEntity(this) 48 | target.remove() 49 | 50 | stack.shrink(1) 51 | } 52 | } 53 | 54 | ActionResultType.sidedSuccess(playerIn.level.isClientSide) 55 | } else ActionResultType.PASS 56 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/items/RubyArmor.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.items 2 | 3 | import com.theonlytails.rubymod.registries.ItemRegistry 4 | import com.theonlytails.rubymod.rubyTabProperty 5 | import com.theonlytails.rubymod.util.enums.RubyArmorMaterial 6 | import net.minecraft.entity.player.PlayerEntity 7 | import net.minecraft.inventory.EquipmentSlotType 8 | import net.minecraft.item.ArmorItem 9 | import net.minecraft.item.ItemStack 10 | import net.minecraft.potion.EffectInstance 11 | import net.minecraft.potion.Effects 12 | import net.minecraft.world.World 13 | 14 | /** 15 | * Holds the custom functionality of ruby armor. 16 | * 17 | * @author TheOnlyTails 18 | */ 19 | class RubyArmor(slot: EquipmentSlotType) : ArmorItem(RubyArmorMaterial.RUBY, slot, rubyTabProperty) { 20 | override fun onArmorTick(stack: ItemStack, world: World, player: PlayerEntity) { 21 | if (player.armorSlots.all { it.item is RubyArmor } && player.mainHandItem.item == ItemRegistry.rubyPickaxe) 22 | player.addEffect(EffectInstance(Effects.DIG_SPEED, 220, 0, true, true)) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/BiomeRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.registries 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.id 5 | import com.theonlytails.rubymod.world.makeRubyHills 6 | import net.minecraft.util.RegistryKey 7 | import net.minecraft.util.registry.Registry 8 | import net.minecraft.world.biome.Biome 9 | import net.minecraftforge.common.BiomeManager 10 | import net.minecraftforge.event.world.BiomeLoadingEvent 11 | import net.minecraftforge.registries.ForgeRegistries 12 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 13 | 14 | /** 15 | * Registers and adds custom biomes to the world. 16 | * 17 | * @author TheOnlyTails 18 | */ 19 | object BiomeRegistry { 20 | val biomes = KDeferredRegister(ForgeRegistries.BIOMES, MOD_ID) 21 | 22 | val rubyHills by biomes.registerObject("ruby_hills", ::makeRubyHills) 23 | val rubyHillsRegistryKey: RegistryKey = RegistryKey.create(Registry.BIOME_REGISTRY, id("ruby_hills")) 24 | } 25 | 26 | fun biomeLoading(event: BiomeLoadingEvent) { 27 | if (event.name == BiomeRegistry.rubyHills.registryName) 28 | BiomeManager.addBiome(BiomeManager.BiomeType.WARM, 29 | BiomeManager.BiomeEntry(BiomeRegistry.rubyHillsRegistryKey, 6)) 30 | } 31 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/BlockRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.registries 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.blocks.Centrifuge 5 | import com.theonlytails.rubymod.blocks.LogicGate 6 | import com.theonlytails.rubymod.blocks.RubyBarrel 7 | import com.theonlytails.rubymod.blocks.RubyCarpet 8 | import net.minecraft.block.* 9 | import net.minecraft.block.AbstractBlock.Properties 10 | import net.minecraft.block.PressurePlateBlock.Sensitivity 11 | import net.minecraft.block.material.Material 12 | import net.minecraft.block.material.MaterialColor 13 | import net.minecraft.util.math.BlockPos 14 | import net.minecraft.world.IWorldReader 15 | import net.minecraftforge.common.ToolType 16 | import net.minecraftforge.registries.ForgeRegistries 17 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 18 | 19 | /** 20 | * Registers custom blocks. 21 | * 22 | * @author TheOnlyTails 23 | */ 24 | object BlockRegistry { 25 | val blocks = KDeferredRegister(ForgeRegistries.BLOCKS, MOD_ID) 26 | 27 | val rubyBlock by blocks.registerObject("ruby_block") { 28 | Block( 29 | Properties.of(Material.METAL) 30 | .strength(5.0f, 6.0f) 31 | .sound(SoundType.METAL) 32 | .harvestTool(ToolType.PICKAXE) 33 | .harvestLevel(2) 34 | .requiresCorrectToolForDrops() 35 | ) 36 | } 37 | 38 | val rubySlab by blocks.registerObject("ruby_slab") { 39 | SlabBlock(Properties.copy(rubyBlock)) 40 | } 41 | 42 | val rubyPressurePlate by blocks.registerObject("ruby_pressure_plate") { 43 | PressurePlateBlock(Sensitivity.MOBS, Properties.copy(rubyBlock)) 44 | } 45 | 46 | val rubyButton by blocks.registerObject("ruby_button") { 47 | StoneButtonBlock(Properties.copy(rubyBlock)) 48 | } 49 | 50 | val rubyStairs by blocks.registerObject("ruby_stairs") { 51 | StairsBlock({ rubyBlock.defaultBlockState() }, Properties.copy(rubyBlock)) 52 | } 53 | 54 | val rubyWall by blocks.registerObject("ruby_wall") { 55 | WallBlock(Properties.copy(rubyBlock)) 56 | } 57 | 58 | val rubyOre by blocks.registerObject("ruby_ore") { 59 | object : OreBlock( 60 | Properties.of(Material.STONE) 61 | .strength(3.0f, 3.0f) 62 | .sound(SoundType.STONE) 63 | .harvestTool(ToolType.PICKAXE) 64 | .harvestLevel(2) 65 | .requiresCorrectToolForDrops() 66 | ) { 67 | override fun getExpDrop( 68 | state: BlockState, 69 | reader: IWorldReader, 70 | pos: BlockPos, 71 | fortune: Int, 72 | silktouch: Int, 73 | ) = 3 74 | } 75 | } 76 | 77 | val centrifuge by blocks.registerObject("centrifuge", ::Centrifuge) 78 | 79 | val rubyWool by blocks.registerObject("ruby_wool") { 80 | Block( 81 | Properties.of(Material.WOOL, MaterialColor.CRIMSON_HYPHAE) 82 | .strength(0.8f) 83 | .sound(SoundType.WOOL) 84 | ) 85 | } 86 | 87 | val rubyCarpet by blocks.registerObject("ruby_carpet", ::RubyCarpet) 88 | 89 | val rubyBarrel by blocks.registerObject("ruby_barrel", ::RubyBarrel) 90 | 91 | val logicGate by blocks.registerObject("logic_gate", ::LogicGate) 92 | } 93 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/ContainerTypeRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.registries 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.containers.RubyBarrelContainer 5 | import net.minecraft.inventory.container.ContainerType 6 | import net.minecraftforge.common.extensions.IForgeContainerType 7 | import net.minecraftforge.registries.ForgeRegistries 8 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 9 | 10 | /** 11 | * Registers custom containers. 12 | * 13 | * @author TheOnlyTails 14 | */ 15 | object ContainerTypeRegistry { 16 | val containerTypes = KDeferredRegister(ForgeRegistries.CONTAINERS, MOD_ID) 17 | 18 | val rubyBarrel: ContainerType by containerTypes.registerObject("ruby_barrel") { 19 | IForgeContainerType.create { windowId, playerInventory, data -> 20 | RubyBarrelContainer(windowId, 21 | playerInventory, 22 | data) 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/EnchantmentRegistry.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("unused") 2 | 3 | package com.theonlytails.rubymod.registries 4 | 5 | import com.theonlytails.rubymod.MOD_ID 6 | import com.theonlytails.rubymod.enchantments.StingerEnchantment 7 | import net.minecraftforge.registries.ForgeRegistries 8 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 9 | 10 | /** 11 | * Registers custom enchantments. 12 | * 13 | * @author TheOnlyTails 14 | */ 15 | object EnchantmentRegistry { 16 | val enchantments = KDeferredRegister(ForgeRegistries.ENCHANTMENTS, MOD_ID) 17 | 18 | val stinger by enchantments.registerObject("stinger", ::StingerEnchantment) 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/EntityTypeRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.registries 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.entities.RubySheepEntity 5 | import com.theonlytails.rubymod.id 6 | import net.minecraft.entity.EntityClassification 7 | import net.minecraft.entity.EntityType 8 | import net.minecraftforge.registries.ForgeRegistries 9 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 10 | 11 | /** 12 | * Registers custom entities, i.e. mobs. 13 | * 14 | * @author TheOnlyTails 15 | */ 16 | object EntityTypeRegistry { 17 | val entityTypes = KDeferredRegister(ForgeRegistries.ENTITIES, MOD_ID) 18 | 19 | val rubySheep: EntityType by entityTypes.registerObject("ruby_sheep") { 20 | EntityType.Builder.of( 21 | ::RubySheepEntity, 22 | EntityClassification.CREATURE 23 | ).sized(0.625f, 1.25f) 24 | .build(id("ruby_sheep").toString()) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/FeatureRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.registries 2 | 3 | import com.theonlytails.rubymod.id 4 | import net.minecraft.util.registry.Registry 5 | import net.minecraft.util.registry.WorldGenRegistries 6 | import net.minecraft.world.gen.feature.* 7 | import net.minecraft.world.gen.placement.Placement 8 | import net.minecraft.world.gen.placement.TopSolidRangeConfig 9 | 10 | object FeatureRegistry { 11 | val oreRuby = registerFeature( 12 | "ore_ruby", Feature.NO_SURFACE_ORE.configured( 13 | OreFeatureConfig( 14 | OreFeatureConfig.FillerBlockType.NETHERRACK, 15 | BlockRegistry.rubyOre.defaultBlockState(), 16 | 2 // vein size 17 | ) 18 | ).decorated( 19 | Placement.RANGE.configured( 20 | TopSolidRangeConfig(23 /* min height */, 0, 30 /* max height */) 21 | ) 22 | ).squared().count(10 /* veins per chunk */) 23 | ) 24 | } 25 | 26 | private fun registerFeature( 27 | @Suppress("SameParameterValue") path: String, 28 | feature: ConfiguredFeature, 29 | ): ConfiguredFeature { 30 | return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, id(path), feature) 31 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/FluidRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.registries 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.id 5 | import net.minecraft.block.AbstractBlock 6 | import net.minecraft.block.FlowingFluidBlock 7 | import net.minecraft.block.material.Material 8 | import net.minecraft.item.Rarity 9 | import net.minecraft.util.SoundEvents 10 | import net.minecraftforge.fluids.FluidAttributes 11 | import net.minecraftforge.fluids.ForgeFlowingFluid 12 | import net.minecraftforge.registries.ForgeRegistries 13 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 14 | import java.awt.Color 15 | 16 | /** 17 | * Registers custom fluids. 18 | * 19 | * @author TheOnlyTails 20 | */ 21 | object FluidRegistry { 22 | val fluids = KDeferredRegister(ForgeRegistries.FLUIDS, MOD_ID) 23 | 24 | private val stillGhostWaterTexture = id("blocks/ghost_water_still") 25 | private val flowingGhostWaterTexture = id("blocks/ghost_water_flow") 26 | private val ghostWaterOverlay = id("blocks/ghost_water_overlay") 27 | 28 | private val ghostWaterBlock by BlockRegistry.blocks.registerObject("ghost_water_block") { 29 | FlowingFluidBlock( 30 | ::stillGhostWater, 31 | AbstractBlock.Properties.of(Material.WATER) 32 | .noCollission() 33 | .strength(100f) 34 | .noDrops() 35 | ) 36 | } 37 | 38 | val stillGhostWater by fluids.registerObject("ghost_water") { 39 | ForgeFlowingFluid.Source(ghostWaterProperties) 40 | } 41 | 42 | private val flowingGhostWater by fluids.registerObject("ghost_water_flow") { 43 | ForgeFlowingFluid.Flowing(ghostWaterProperties) 44 | } 45 | 46 | private val ghostWaterProperties: ForgeFlowingFluid.Properties = ForgeFlowingFluid.Properties( 47 | { stillGhostWater.fluid }, 48 | ::flowingGhostWater, 49 | FluidAttributes.builder( 50 | stillGhostWaterTexture, 51 | flowingGhostWaterTexture 52 | ).rarity(Rarity.RARE) 53 | .sound(SoundEvents.WATER_AMBIENT) 54 | .color(Color(228, 80, 63, 255).rgb) 55 | .overlay(ghostWaterOverlay) 56 | ).block(::ghostWaterBlock).bucket(ItemRegistry::ghostWaterBucket) 57 | } 58 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/ItemRegistry.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("unused") 2 | 3 | package com.theonlytails.rubymod.registries 4 | 5 | import com.theonlytails.rubymod.MOD_ID 6 | import com.theonlytails.rubymod.items.CustomSpawnEggItem 7 | import com.theonlytails.rubymod.items.PoisonedApple 8 | import com.theonlytails.rubymod.items.Ruby 9 | import com.theonlytails.rubymod.items.RubyArmor 10 | import com.theonlytails.rubymod.rubyTab 11 | import com.theonlytails.rubymod.rubyTabProperty 12 | import com.theonlytails.rubymod.util.enums.RubyItemTier 13 | import net.minecraft.inventory.EquipmentSlotType 14 | import net.minecraft.item.* 15 | import net.minecraftforge.registries.ForgeRegistries 16 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 17 | 18 | /** 19 | * Registers custom items. 20 | * 21 | * @author TheOnlyTails 22 | */ 23 | object ItemRegistry { 24 | val items = KDeferredRegister(ForgeRegistries.ITEMS, MOD_ID) 25 | 26 | val ghostWaterBucket by items.registerObject("ghost_water_bucket") { 27 | BucketItem( 28 | FluidRegistry::stillGhostWater, 29 | Item.Properties() 30 | .craftRemainder(Items.BUCKET) 31 | .stacksTo(1) 32 | .tab(rubyTab) 33 | ) 34 | } 35 | 36 | //items 37 | val poisonedApple by items.registerObject("poisoned_apple", ::PoisonedApple) 38 | 39 | val rubySheepSpawnEgg by items.registerObject("ruby_sheep_spawn_egg") { 40 | CustomSpawnEggItem(EntityTypeRegistry::rubySheep, 41 | 0xE3E6E7, 42 | 0xFD0D0D) 43 | } 44 | 45 | val ruby by items.registerObject("ruby", ::Ruby) 46 | 47 | val rubyBlock by items.registerObject("ruby_block") { 48 | BlockItem(BlockRegistry.rubyBlock, rubyTabProperty) 49 | } 50 | 51 | val rubySlab by items.registerObject("ruby_slab") { 52 | BlockItem(BlockRegistry.rubySlab, rubyTabProperty) 53 | } 54 | 55 | val rubyStairs by items.registerObject("ruby_stairs") { 56 | BlockItem(BlockRegistry.rubyStairs, rubyTabProperty) 57 | } 58 | 59 | val rubyPressurePlate by items.registerObject("ruby_pressure_plate") { 60 | BlockItem(BlockRegistry.rubyPressurePlate, rubyTabProperty) 61 | } 62 | 63 | val rubyButton by items.registerObject("ruby_button") { 64 | BlockItem(BlockRegistry.rubyButton, rubyTabProperty) 65 | } 66 | 67 | val rubyWall by items.registerObject("ruby_wall") { 68 | BlockItem(BlockRegistry.rubyWall, rubyTabProperty) 69 | } 70 | 71 | val rubyOre by items.registerObject("ruby_ore") { 72 | BlockItem(BlockRegistry.rubyOre, rubyTabProperty) 73 | } 74 | 75 | val centrifuge by items.registerObject("centrifuge") { 76 | BlockItem(BlockRegistry.centrifuge, rubyTabProperty) 77 | } 78 | 79 | val rubyWool by items.registerObject("ruby_wool") { 80 | object : BlockItem(BlockRegistry.rubyWool, rubyTabProperty) { 81 | override fun getBurnTime(itemStack: ItemStack) = 100 82 | } 83 | } 84 | 85 | val rubyCarpet by items.registerObject("ruby_carpet") { 86 | object : BlockItem(BlockRegistry.rubyCarpet, rubyTabProperty) { 87 | override fun getBurnTime(itemStack: ItemStack) = 67 88 | } 89 | } 90 | 91 | val rubyBarrel by items.registerObject("ruby_barrel") { 92 | BlockItem(BlockRegistry.rubyBarrel, rubyTabProperty) 93 | } 94 | 95 | val logicGate by items.registerObject("logic_gate") { 96 | BlockItem(BlockRegistry.logicGate, rubyTabProperty) 97 | } 98 | 99 | //armor 100 | val rubyHelmet by items.registerObject("ruby_helmet") { RubyArmor(EquipmentSlotType.HEAD) } 101 | 102 | val rubyChestplate by items.registerObject("ruby_chestplate") { RubyArmor(EquipmentSlotType.CHEST) } 103 | 104 | val rubyLeggings by items.registerObject("ruby_leggings") { RubyArmor(EquipmentSlotType.LEGS) } 105 | 106 | val rubyBoots by items.registerObject("ruby_boots") { RubyArmor(EquipmentSlotType.FEET) } 107 | 108 | //tools 109 | val rubyPickaxe by items.registerObject("ruby_pickaxe") { 110 | PickaxeItem(RubyItemTier.RUBY, 1, -2.8f, rubyTabProperty) 111 | } 112 | 113 | val rubySword by items.registerObject("ruby_sword") { 114 | SwordItem(RubyItemTier.RUBY, 2, -2.4f, rubyTabProperty) 115 | } 116 | 117 | val rubyAxe by items.registerObject("ruby_axe") { 118 | AxeItem(RubyItemTier.RUBY, 5f, -3.05f, rubyTabProperty) 119 | } 120 | 121 | val rubyShovel by items.registerObject("ruby_shovel") { 122 | ShovelItem(RubyItemTier.RUBY, 1f, -3f, rubyTabProperty) 123 | } 124 | 125 | val rubyHoe by items.registerObject("ruby_hoe") { 126 | HoeItem(RubyItemTier.RUBY, -2, -0.5f, rubyTabProperty) 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/PotionRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.registries 2 | 3 | import net.minecraft.potion.EffectInstance 4 | import net.minecraft.potion.Effects 5 | import net.minecraft.potion.Potion 6 | import net.minecraftforge.registries.ForgeRegistries 7 | import net.minecraftforge.versions.forge.ForgeVersion.MOD_ID 8 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 9 | 10 | /** 11 | * Registers custom potions. 12 | * 13 | * @author TheOnlyTails 14 | */ 15 | object PotionRegistry { 16 | val potions = KDeferredRegister(ForgeRegistries.POTION_TYPES, MOD_ID) 17 | 18 | val motivation by potions.registerObject("motivation") { 19 | Potion( 20 | "motivation", 21 | EffectInstance(Effects.MOVEMENT_SPEED, 90 * 20), 22 | EffectInstance(Effects.JUMP, 90 * 20) 23 | ) 24 | } 25 | 26 | val longMotivation by potions.registerObject("long_motivation") { 27 | Potion( 28 | "motivation", 29 | EffectInstance(Effects.MOVEMENT_SPEED, 240 * 20), 30 | EffectInstance(Effects.JUMP, 240 * 20) 31 | ) 32 | } 33 | 34 | val strongMotivation by potions.registerObject("strong_motivation") { 35 | Potion( 36 | "motivation", 37 | EffectInstance(Effects.MOVEMENT_SPEED, 90 * 20, 1), 38 | EffectInstance(Effects.JUMP, 90 * 20, 1) 39 | ) 40 | } 41 | 42 | val laziness by potions.registerObject("laziness") { 43 | Potion( 44 | "laziness", 45 | EffectInstance(Effects.MOVEMENT_SLOWDOWN, 90 * 20), 46 | EffectInstance(Effects.CONFUSION, 90 * 20) 47 | ) 48 | } 49 | 50 | val longLaziness by potions.registerObject("long_laziness") { 51 | Potion( 52 | "laziness", 53 | EffectInstance(Effects.MOVEMENT_SLOWDOWN, 240 * 20), 54 | EffectInstance(Effects.CONFUSION, 240 * 20) 55 | ) 56 | } 57 | 58 | val strongLaziness by potions.registerObject("strong_laziness") { 59 | Potion( 60 | "laziness", 61 | EffectInstance(Effects.MOVEMENT_SLOWDOWN, 90 * 20, 1), 62 | EffectInstance(Effects.CONFUSION, 90 * 20, 1) 63 | ) 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/TileEntityTypes.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.registries 2 | 3 | import com.theonlytails.rubymod.MOD_ID 4 | import com.theonlytails.rubymod.tileentities.RubyBarrelTileEntity 5 | import net.minecraft.tileentity.TileEntityType 6 | import net.minecraftforge.registries.ForgeRegistries 7 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 8 | 9 | /** 10 | * Registers custom tile entities. 11 | * 12 | * @author TheOnlyTails 13 | */ 14 | object TileEntityTypes { 15 | val tileEntities = KDeferredRegister(ForgeRegistries.TILE_ENTITIES, MOD_ID) 16 | 17 | val rubyBarrel: TileEntityType by tileEntities.registerObject("ruby_barrel") { 18 | @Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") 19 | TileEntityType.Builder 20 | .of(::RubyBarrelTileEntity, BlockRegistry.rubyBarrel) 21 | .build(null) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/registries/VillagerProfessionsRegistry.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.registries 2 | 3 | import com.google.common.collect.ImmutableSet 4 | import com.theonlytails.rubymod.MOD_ID 5 | import net.minecraft.block.Block 6 | import net.minecraft.entity.merchant.villager.VillagerProfession 7 | import net.minecraft.util.SoundEvents 8 | import net.minecraft.village.PointOfInterestType 9 | import net.minecraftforge.registries.ForgeRegistries 10 | import thedarkcolour.kotlinforforge.forge.KDeferredRegister 11 | 12 | /** 13 | * Registers custom villager professions and points of interest. 14 | * 15 | * @author TheOnlyTails 16 | */ 17 | object VillagerProfessionsRegistry { 18 | val professions = KDeferredRegister(ForgeRegistries.PROFESSIONS, MOD_ID) 19 | val pointsOfInterest = KDeferredRegister(ForgeRegistries.POI_TYPES, MOD_ID) 20 | 21 | val jeweler by professions.registerObject("jeweler") { 22 | VillagerProfession( 23 | "jeweler", 24 | jewelerPOI, 25 | ImmutableSet.of(), 26 | ImmutableSet.of(), 27 | SoundEvents.VILLAGER_WORK_TOOLSMITH 28 | ) 29 | } 30 | 31 | val jewelerPOI by pointsOfInterest.registerObject("jeweler") { 32 | PointOfInterestType( 33 | "jeweler", 34 | allBlockStates.invoke(BlockRegistry.rubyBarrel), 35 | 1, 36 | 1, 37 | ) 38 | } 39 | 40 | private val allBlockStates = { it: Block -> ImmutableSet.copyOf(it.stateDefinition.possibleStates) } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/tileentities/RubyBarrelTileEntity.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.tileentities 2 | 3 | import com.theonlytails.rubymod.blocks.RubyBarrel 4 | import com.theonlytails.rubymod.containers.RubyBarrelContainer 5 | import com.theonlytails.rubymod.registries.TileEntityTypes 6 | import net.minecraft.block.BlockState 7 | import net.minecraft.entity.player.PlayerEntity 8 | import net.minecraft.entity.player.PlayerInventory 9 | import net.minecraft.inventory.container.INamedContainerProvider 10 | import net.minecraft.nbt.CompoundNBT 11 | import net.minecraft.network.NetworkManager 12 | import net.minecraft.network.play.server.SUpdateTileEntityPacket 13 | import net.minecraft.tileentity.TileEntity 14 | import net.minecraft.util.Direction 15 | import net.minecraft.util.SoundCategory 16 | import net.minecraft.util.SoundEvent 17 | import net.minecraft.util.text.TranslationTextComponent 18 | import net.minecraftforge.common.capabilities.Capability 19 | import net.minecraftforge.common.util.LazyOptional 20 | import net.minecraftforge.items.CapabilityItemHandler 21 | import net.minecraftforge.items.ItemStackHandler 22 | 23 | const val rubyBarrelTileEntitySize = 45 24 | 25 | /** 26 | * The tile entity for [RubyBarrel]. 27 | * 28 | * @author TheOnlyTails 29 | */ 30 | class RubyBarrelTileEntity : TileEntity(TileEntityTypes.rubyBarrel), INamedContainerProvider { 31 | private val optional = LazyOptional.of { itemHandler } 32 | val itemHandler = createHandler() 33 | var players = 0 34 | 35 | private fun createHandler() = object : ItemStackHandler(rubyBarrelTileEntitySize) { 36 | override fun onContentsChanged(slot: Int) { 37 | super.onContentsChanged(slot) 38 | setChanged() 39 | } 40 | } 41 | 42 | override fun getDisplayName() = TranslationTextComponent(blockState.block.descriptionId) 43 | 44 | override fun createMenu(id: Int, playerInventory: PlayerInventory, player: PlayerEntity) = 45 | RubyBarrelContainer(id, playerInventory, this) 46 | 47 | fun changeState(blockState: BlockState, value: Boolean) { 48 | if (blockState.block is RubyBarrel) { 49 | level?.setBlockAndUpdate(worldPosition, blockState.setValue(RubyBarrel.PROPERTY_OPEN, value)) 50 | } 51 | } 52 | 53 | fun playSound(soundEvent: SoundEvent) { 54 | if (this.blockState.block is RubyBarrel) { 55 | val x = worldPosition.x + 0.5 56 | val y = worldPosition.y + 0.5 57 | val z = worldPosition.z + 0.5 58 | 59 | level?.playSound( 60 | null, x, y, z, soundEvent, 61 | SoundCategory.BLOCKS, 0.5f, level?.random?.nextFloat() ?: 0 * 0.1f + 0.9f 62 | ) 63 | } 64 | } 65 | 66 | override fun save(nbt: CompoundNBT): CompoundNBT { 67 | optional.ifPresent { nbt.put("inv", it.serializeNBT()) } 68 | itemHandler.serializeNBT() 69 | 70 | return super.save(nbt) 71 | } 72 | 73 | override fun load(state: BlockState, nbt: CompoundNBT) { 74 | optional.ifPresent { it.deserializeNBT(nbt.getCompound("inv")) } 75 | itemHandler.deserializeNBT(nbt.getCompound("inv")) 76 | 77 | super.load(state, nbt) 78 | } 79 | 80 | override fun getUpdateTag(): CompoundNBT = super.save(CompoundNBT()) 81 | 82 | override fun getUpdatePacket(): SUpdateTileEntityPacket { 83 | val nbt = CompoundNBT() 84 | save(nbt) 85 | return SUpdateTileEntityPacket(worldPosition, 0, nbt) 86 | } 87 | 88 | override fun onDataPacket(net: NetworkManager, pkt: SUpdateTileEntityPacket) = load(this.blockState, pkt.tag) 89 | 90 | override fun getCapability(cap: Capability, side: Direction?): LazyOptional = 91 | if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) optional.cast() 92 | else super.getCapability(cap, side) 93 | 94 | override fun setRemoved() { 95 | super.setRemoved() 96 | optional.invalidate() 97 | } 98 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/trades/ItemsForRubyAndItemsTrade.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.trades 2 | 3 | import com.theonlytails.rubymod.registries.ItemRegistry 4 | import net.minecraft.entity.Entity 5 | import net.minecraft.entity.merchant.villager.VillagerTrades 6 | import net.minecraft.item.Item 7 | import net.minecraft.item.MerchantOffer 8 | import java.util.Random 9 | import net.minecraft.item.ItemStack as IS 10 | 11 | /** 12 | * A trade that takes rubies and items, and returns items. 13 | * 14 | * @author TheOnlyTails 15 | * 16 | * @property buyingItem The item being returned from the trade. 17 | * @property buyingItemCount The number of items in the stack being returned from the trade. 18 | * @property rubyCount The number of rubies taken. 19 | * @property sellingItem The item being taken. 20 | * @property sellingItemCount The number of items being taken. 21 | * @property maxUses The number of times this trade can be used before restocking is required. 22 | * @property xpValue The number of XP the villager receives when the trade is done. 23 | */ 24 | class ItemsForRubyAndItemsTrade( 25 | private val buyingItem: Item, 26 | private val buyingItemCount: Int = 1, 27 | private val rubyCount: Int = 1, 28 | private val sellingItem: Item, 29 | private val sellingItemCount: Int = 1, 30 | private val maxUses: Int, 31 | private val xpValue: Int = 2, 32 | ) : VillagerTrades.ITrade { 33 | private val priceMultiplier = 0.05f 34 | 35 | override fun getOffer(p0: Entity, p1: Random) = 36 | MerchantOffer( 37 | IS(ItemRegistry.ruby, rubyCount), 38 | IS(buyingItem, buyingItemCount), 39 | IS(sellingItem, sellingItemCount), 40 | maxUses, 41 | xpValue, 42 | priceMultiplier 43 | ) 44 | } 45 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/trades/ItemsForRubyTrade.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.trades 2 | 3 | import com.theonlytails.rubymod.registries.ItemRegistry 4 | import net.minecraft.entity.Entity 5 | import net.minecraft.entity.merchant.villager.VillagerTrades 6 | import net.minecraft.item.Item 7 | import net.minecraft.item.MerchantOffer 8 | import java.util.Random 9 | import net.minecraft.item.ItemStack as IS 10 | 11 | /** 12 | * A trade that takes rubies, and returns items. 13 | * 14 | * @author TheOnlyTails 15 | * 16 | * @property rubyCount The number of rubies taken. 17 | * @property sellingItem The item being returned. 18 | * @property sellingItemCount The number of items being returned. 19 | * @property maxUses The number of times this trade can be used before restocking is required. 20 | * @property xpValue The number of XP the villager receives when the trade is done. 21 | */ 22 | class ItemsForRubyTrade( 23 | private val sellingItem: Item, 24 | private val sellingItemCount: Int = 1, 25 | private val rubyCount: Int = 1, 26 | private val maxUses: Int, 27 | private val xpValue: Int = 2, 28 | ) : VillagerTrades.ITrade { 29 | private val priceMultiplier = 0.05f 30 | 31 | override fun getOffer(p0: Entity, p1: Random) = 32 | MerchantOffer( 33 | IS(ItemRegistry.ruby, rubyCount), 34 | IS(sellingItem, sellingItemCount), 35 | maxUses, 36 | xpValue, 37 | priceMultiplier 38 | ) 39 | } 40 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/trades/TradesRegisterer.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.trades 2 | 3 | import com.theonlytails.rubymod.registries.ItemRegistry 4 | import com.theonlytails.rubymod.registries.VillagerProfessionsRegistry 5 | import net.minecraft.item.Items 6 | import net.minecraftforge.event.village.VillagerTradesEvent 7 | 8 | fun addVillagerTrades(event: VillagerTradesEvent) { 9 | if (event.type == VillagerProfessionsRegistry.jeweler) { 10 | // Level 1 trades 11 | event.trades[1].add(ItemsForRubyTrade(Items.COAL, 45, maxUses = 12)) 12 | event.trades[1].add(ItemsForRubyTrade(Items.IRON_NUGGET, 16, maxUses = 9)) 13 | event.trades[1].add(ItemsForRubyTrade(Items.IRON_INGOT, 3, maxUses = 8)) 14 | event.trades[1].add(ItemsForRubyTrade(Items.GOLD_NUGGET, 16, maxUses = 10)) 15 | 16 | // Level 2 trades 17 | event.trades[2].add(ItemsForRubyTrade(Items.GOLD_INGOT, 4, maxUses = 9)) 18 | event.trades[2].add(ItemsForRubyTrade(Items.LAPIS_LAZULI, 25, maxUses = 10)) 19 | event.trades[2].add( 20 | ItemsForRubyAndItemsTrade( 21 | Items.IRON_PICKAXE, 22 | sellingItem = ItemRegistry.rubyPickaxe, 23 | maxUses = 1, 24 | xpValue = 5, 25 | ) 26 | ) 27 | event.trades[2].add( 28 | ItemsForRubyAndItemsTrade( 29 | Items.IRON_SWORD, 30 | sellingItem = ItemRegistry.rubySword, 31 | maxUses = 1, 32 | xpValue = 5, 33 | ) 34 | ) 35 | event.trades[2].add( 36 | ItemsForRubyAndItemsTrade( 37 | Items.IRON_AXE, 38 | sellingItem = ItemRegistry.rubyAxe, 39 | maxUses = 1, 40 | xpValue = 5, 41 | ) 42 | ) 43 | event.trades[2].add( 44 | ItemsForRubyAndItemsTrade( 45 | Items.IRON_SHOVEL, 46 | sellingItem = ItemRegistry.rubyShovel, 47 | maxUses = 1, 48 | xpValue = 5, 49 | ) 50 | ) 51 | event.trades[2].add( 52 | ItemsForRubyAndItemsTrade( 53 | Items.IRON_HOE, 54 | sellingItem = ItemRegistry.rubyHoe, 55 | maxUses = 1, 56 | xpValue = 5, 57 | ) 58 | ) 59 | 60 | // Level 3 trades 61 | event.trades[3].add(ItemsForRubyTrade(Items.EMERALD_BLOCK, sellingItemCount = 10, maxUses = 8)) 62 | 63 | // Level 4 trades 64 | event.trades[4].add(ItemsForRubyTrade(Items.DIAMOND, sellingItemCount = 2, maxUses = 2)) 65 | 66 | // Level 5 trades 67 | event.trades[5].add( 68 | ItemsForRubyAndItemsTrade( 69 | Items.IRON_HELMET, 70 | sellingItem = ItemRegistry.rubyHelmet, 71 | maxUses = 1, 72 | ) 73 | ) 74 | event.trades[5].add( 75 | ItemsForRubyAndItemsTrade( 76 | Items.IRON_CHESTPLATE, 77 | sellingItem = ItemRegistry.rubyChestplate, 78 | maxUses = 1, 79 | ) 80 | ) 81 | event.trades[5].add( 82 | ItemsForRubyAndItemsTrade( 83 | Items.IRON_LEGGINGS, 84 | sellingItem = ItemRegistry.rubyLeggings, 85 | maxUses = 1, 86 | ) 87 | ) 88 | event.trades[5].add( 89 | ItemsForRubyAndItemsTrade( 90 | Items.IRON_BOOTS, 91 | sellingItem = ItemRegistry.rubyBoots, 92 | maxUses = 1, 93 | ) 94 | ) 95 | } 96 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/util/BrewingRecipes.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.util 2 | 3 | import com.theonlytails.rubymod.registries.ItemRegistry 4 | import com.theonlytails.rubymod.registries.PotionRegistry 5 | import net.minecraft.item.Items 6 | import net.minecraft.potion.Potion 7 | import net.minecraft.potion.PotionBrewing 8 | import net.minecraft.potion.Potions 9 | import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent 10 | 11 | /** 12 | * Registers brewing recipes. 13 | * 14 | * @author TheOnlyTails 15 | */ 16 | fun registerBrewingRecipes(@Suppress("UNUSED_PARAMETER") event: FMLCommonSetupEvent) { 17 | PotionBrewing.addMix(Potions.WATER, ItemRegistry.ruby, PotionRegistry.motivation) 18 | 19 | addPotency(PotionRegistry.motivation, PotionRegistry.strongMotivation) 20 | addTime(PotionRegistry.motivation, PotionRegistry.longMotivation) 21 | 22 | addInverted(PotionRegistry.motivation, PotionRegistry.laziness) 23 | addPotency(PotionRegistry.laziness, PotionRegistry.strongLaziness) 24 | addTime(PotionRegistry.laziness, PotionRegistry.longLaziness) 25 | } 26 | 27 | fun addPotency(input: Potion, output: Potion) = PotionBrewing.addMix(input, Items.GLOWSTONE_DUST, output) 28 | 29 | fun addTime(input: Potion, output: Potion) = PotionBrewing.addMix(input, Items.REDSTONE, output) 30 | 31 | fun addInverted(input: Potion, output: Potion) = PotionBrewing.addMix(input, Items.FERMENTED_SPIDER_EYE, output) 32 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/util/ExtensionStuff.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.util 2 | 3 | import net.minecraft.item.Food 4 | import net.minecraft.potion.EffectInstance 5 | 6 | fun Food.Builder.effect(probability: Float, effectIn: () -> EffectInstance): Food.Builder = 7 | this.effect(effectIn, probability) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/util/enums/LogicGateModes.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.util.enums 2 | 3 | import net.minecraft.util.IStringSerializable 4 | 5 | enum class LogicGateModes(val type: String, val function: (Boolean, Boolean) -> Int) : IStringSerializable { 6 | OR("or", { isFirstInputOn, isSecondInputOn -> if (isFirstInputOn || isSecondInputOn) 15 else 0 }), 7 | AND("and", { isFirstInputOn, isSecondInputOn -> if (isFirstInputOn && isSecondInputOn) 15 else 0 }); 8 | 9 | override fun getSerializedName() = this.type 10 | 11 | operator fun invoke(firstInput: Boolean, secondInput: Boolean) = this.function(firstInput, secondInput) 12 | } 13 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/util/enums/RubyArmorMaterial.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.util.enums 2 | 3 | import com.theonlytails.rubymod.id 4 | import com.theonlytails.rubymod.registries.ItemRegistry 5 | import net.minecraft.inventory.EquipmentSlotType 6 | import net.minecraft.item.IArmorMaterial 7 | import net.minecraft.item.crafting.Ingredient 8 | import net.minecraft.util.SoundEvent 9 | import net.minecraft.util.SoundEvents 10 | import net.minecraftforge.common.util.Lazy 11 | 12 | /** 13 | * Holds the properties of any ruby armor piece. 14 | * 15 | * @author TheOnlyTails 16 | * 17 | * @property materialName The name of this armor material. 18 | * @property maxDamageFactor Determines the durability of each piece. 19 | * @property damageReductionAmount Determines how much each piece can block damage. 20 | * @property enchantability Determines how good the enchantments will be when enchanting this armor in an enchanting table. 21 | * @property soundEvent The sound this armor makes. 22 | * @property toughness How much this armor protects against powerful hits. 23 | * @property repairMaterial What item is used to repair this armor. 24 | * @property knockbackResistance How resistant this armor is to knockback. 25 | */ 26 | enum class RubyArmorMaterial( 27 | private val materialName: String, private val maxDamageFactor: Int, 28 | private val damageReductionAmount: IntArray, private val enchantability: Int, 29 | private val soundEvent: SoundEvent, private val toughness: Float, 30 | private val repairMaterial: Lazy, private val knockbackResistance: Float, 31 | ) : IArmorMaterial { 32 | RUBY( 33 | id("ruby").toString(), 34 | 24, intArrayOf(2, 5, 6, 2), 35 | 18, 36 | SoundEvents.ARMOR_EQUIP_GENERIC, 37 | 0f, 38 | Lazy.of { Ingredient.of(ItemRegistry.ruby) }, 39 | 0.5f 40 | ); 41 | 42 | override fun getDurabilityForSlot(slotIn: EquipmentSlotType) = 43 | intArrayOf(11, 16, 15, 13)[slotIn.index] * maxDamageFactor 44 | 45 | override fun getDefenseForSlot(slotIn: EquipmentSlotType) = damageReductionAmount[slotIn.index] 46 | 47 | override fun getEnchantmentValue() = enchantability 48 | 49 | override fun getEquipSound(): SoundEvent = soundEvent 50 | 51 | override fun getRepairIngredient(): Ingredient = repairMaterial.get() 52 | 53 | override fun getToughness() = toughness 54 | 55 | override fun getName() = materialName 56 | 57 | override fun getKnockbackResistance() = knockbackResistance 58 | } 59 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/util/enums/RubyItemTier.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.util.enums 2 | 3 | import com.theonlytails.rubymod.registries.ItemRegistry 4 | import net.minecraft.item.IItemTier 5 | import net.minecraft.item.crafting.Ingredient 6 | import net.minecraftforge.common.util.Lazy 7 | 8 | /** 9 | * Holds the properties of any ruby tool. 10 | * 11 | * @author TheOnlyTails 12 | * 13 | * @property harvestLevel Determines which blocks can or cannot be mined with a tool of this tier. 14 | * @property maxUses The base durability of a tool of this tier (adjusted later per tool). 15 | * @property efficiency How fast a tool of this tier can break blocks. 16 | * @property attackDamage How much damage a tool of this tier does when fully loaded. 17 | * @property enchantability Determines how good the enchantments will be when enchanting a tool of this tier in an enchanting table. 18 | * @property repairMaterial What item is used to repair tools of this tier. 19 | */ 20 | enum class RubyItemTier( 21 | private val harvestLevel: Int, private val maxUses: Int, private val efficiency: Float, 22 | private val attackDamage: Float, private val enchantability: Int, 23 | private val repairMaterial: Lazy, 24 | ) : IItemTier { 25 | RUBY(3, 26 | 850, 27 | 7f, 28 | 3f, 29 | 12, 30 | Lazy.of { Ingredient.of(ItemRegistry.ruby) } 31 | ); 32 | 33 | override fun getUses() = maxUses 34 | 35 | override fun getSpeed() = efficiency 36 | 37 | override fun getAttackDamageBonus() = attackDamage 38 | 39 | override fun getLevel() = harvestLevel 40 | 41 | override fun getEnchantmentValue() = enchantability 42 | 43 | override fun getRepairIngredient(): Ingredient = repairMaterial.get() 44 | } 45 | -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/world/BiomeMaker.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.world 2 | 3 | import com.theonlytails.rubymod.registries.EntityTypeRegistry 4 | import net.minecraft.entity.EntityClassification 5 | import net.minecraft.entity.EntityType 6 | import net.minecraft.util.math.MathHelper 7 | import net.minecraft.world.biome.* 8 | import net.minecraft.world.biome.Biome.* 9 | import net.minecraft.world.gen.feature.structure.StructureFeatures 10 | import net.minecraft.world.gen.surfacebuilders.ISurfaceBuilderConfig 11 | import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder 12 | 13 | /** 14 | * Creates the biomes for registration. 15 | * 16 | * @author TheOnlyTails 17 | */ 18 | fun makeRubyHills(): Biome { 19 | val genSettings = genSettings(SurfaceBuilder.DEFAULT, SurfaceBuilder.CONFIG_GRASS).apply { 20 | addStructureStart(StructureFeatures.PILLAGER_OUTPOST) 21 | addStructureStart(StructureFeatures.VILLAGE_PLAINS) 22 | addStructureStart(StructureFeatures.RUINED_PORTAL_STANDARD) 23 | }.also { 24 | DefaultBiomeFeatures.addDefaultCarvers(it) 25 | DefaultBiomeFeatures.addDefaultOverworldLandStructures(it) 26 | DefaultBiomeFeatures.addDefaultMonsterRoom(it) 27 | DefaultBiomeFeatures.addDefaultUndergroundVariety(it) 28 | DefaultBiomeFeatures.addDefaultOres(it) 29 | DefaultBiomeFeatures.addDefaultSoftDisks(it) 30 | DefaultBiomeFeatures.addMushroomFieldVegetation(it) 31 | DefaultBiomeFeatures.addDefaultSprings(it) 32 | DefaultBiomeFeatures.addDefaultLakes(it) 33 | } 34 | 35 | val spawnSettings = spawnSettings() 36 | .addSpawn(EntityClassification.CREATURE, EntityTypeRegistry.rubySheep, 12, 2, 3) 37 | .addSpawn(EntityClassification.CREATURE, EntityType.MULE, 5, 1, 3) 38 | .also { 39 | DefaultBiomeFeatures.farmAnimals(it) 40 | DefaultBiomeFeatures.commonSpawns(it) 41 | } 42 | 43 | return biome( 44 | precipitation = RainType.NONE, 45 | category = Category.EXTREME_HILLS, 46 | depth = 0.13f, 47 | scale = 0.5f, 48 | temperature = 0.5f, 49 | downfall = 0.3f, 50 | effects(grassColor = 0xe80a0a, skyColor = getSkyForTemp(0.5f)), 51 | genSettings, 52 | spawnSettings.build() 53 | ) 54 | } 55 | 56 | /** 57 | * Base biome function 58 | * Sky color is not generated 59 | */ 60 | @Suppress("SameParameterValue") 61 | private fun biome( 62 | precipitation: RainType, 63 | category: Category, 64 | depth: Float, 65 | scale: Float, 66 | temperature: Float, 67 | downfall: Float, 68 | effects: BiomeAmbience.Builder, 69 | genSettings: BiomeGenerationSettings.Builder, 70 | spawnSettings: MobSpawnInfo = MobSpawnInfo.EMPTY, 71 | ) = Builder() 72 | .precipitation(precipitation) 73 | .biomeCategory(category) 74 | .depth(depth) 75 | .scale(scale) 76 | .temperature(temperature) 77 | .downfall(downfall) 78 | .specialEffects(effects.build()) 79 | .generationSettings(genSettings.build()) 80 | .mobSpawnSettings(spawnSettings) 81 | .build() 82 | 83 | /** 84 | * Biome ambience with default parameters and enforced the required ones. 85 | * Should prevent slip ups on my part :) 86 | */ 87 | private fun effects( 88 | waterColor: Int = 0x3f76e4, 89 | waterFogColor: Int = 0x50533, 90 | grassColor: Int = 0x91bd59, 91 | foliageColor: Int = 0x77ab2f, 92 | skyColor: Int, 93 | skyFogColor: Int = 12638463, 94 | ) = BiomeAmbience.Builder() 95 | .waterColor(waterColor) 96 | .waterFogColor(waterFogColor) 97 | .grassColorOverride(grassColor) 98 | .foliageColorOverride(foliageColor) 99 | .skyColor(skyColor) 100 | .fogColor(skyFogColor) 101 | 102 | /** Shortcut function and enforces surface builder */ 103 | @Suppress("SameParameterValue") 104 | private fun genSettings( 105 | surfaceBuilder: SurfaceBuilder, 106 | config: C, 107 | ) = BiomeGenerationSettings.Builder().surfaceBuilder(surfaceBuilder.configured(config)) 108 | 109 | /** Shortcut function */ 110 | private fun spawnSettings() = MobSpawnInfo.Builder() 111 | 112 | /** Shortcut function */ 113 | private fun MobSpawnInfo.Builder.addSpawn( 114 | classification: EntityClassification, 115 | entityType: EntityType<*>, 116 | weight: Int, 117 | min: Int, 118 | max: Int, 119 | ) = addSpawn(classification, MobSpawnInfo.Spawners(entityType, weight, min, max)) 120 | 121 | private fun getSkyForTemp(@Suppress("SameParameterValue") temperature: Float): Int { 122 | val a = MathHelper.clamp(temperature / 3.0f, -1.0f, 1.0f) 123 | return MathHelper.hsvToRgb(0.62222224f - a * 0.05f, 0.5f + a * 0.1f, 1.0f) 124 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/theonlytails/rubymod/world/FeatureGen.kt: -------------------------------------------------------------------------------- 1 | package com.theonlytails.rubymod.world 2 | 3 | import com.theonlytails.rubymod.registries.FeatureRegistry 4 | import net.minecraft.world.biome.Biome 5 | import net.minecraft.world.gen.GenerationStage 6 | import net.minecraftforge.event.world.BiomeLoadingEvent 7 | 8 | /** 9 | * Adds features to existing biomes. 10 | * 11 | * @author TheOnlyTails 12 | */ 13 | fun addFeaturesToBiomes(event: BiomeLoadingEvent) { 14 | if (event.category == Biome.Category.NETHER) 15 | event.generation.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, FeatureRegistry.oreRuby) 16 | } -------------------------------------------------------------------------------- /src/main/resources/META-INF/accesstransformer.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.potion.PotionBrewing func_193357_a(Lnet/minecraft/potion/Potion;Lnet/minecraft/item/Item;Lnet/minecraft/potion/Potion;)V # addMix 2 | public net.minecraft.item.SpawnEggItem field_195987_b # EGGS 3 | public net.minecraft.data.loot.EntityLootTables func_218583_a(Lnet/minecraft/util/IItemProvider;)Lnet/minecraft/loot/LootTable$Builder; # sheepLootTableBuilderWithDrop 4 | public net.minecraft.util.RegistryKey func_240905_a_(Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/util/RegistryKey; # getOrCreateKey 5 | public net.minecraft.village.PointOfInterestType func_221052_a(Lnet/minecraft/village/PointOfInterestType;)Lnet/minecraft/village/PointOfInterestType; # registerBlockStates -------------------------------------------------------------------------------- /src/main/resources/META-INF/mods.toml: -------------------------------------------------------------------------------- 1 | modLoader = "kotlinforforge" 2 | 3 | loaderVersion = "[1,)" 4 | 5 | license = "MIT License" 6 | 7 | issueTrackerURL = "https://github.com/TheOnlyTails/RubyMod/issues/" 8 | 9 | [[mods]] 10 | modId = "rubymod" 11 | 12 | version = "1.0.0-beta" 13 | 14 | displayName = "RubyMod" 15 | 16 | displayURL = "https://github.com/TheOnlyTails/RubyMod/" 17 | 18 | logoFile = "logo.png" 19 | 20 | credits = "TheOnlyTails" 21 | 22 | authors = "TheOnlyTails" 23 | 24 | description = """ 25 | RubyMod is an open-source mod, which prioritizes sharing its code to help other modders learn. 26 | 27 | Thanks to The Forge Team, for providing the modding framework, 28 | thedarkcolor, for creating the KotlinForForge library for Forge modding in Kotlin, 29 | TechnoVision and TurtyWurty, for creating the tutorial series that inspired the mod, 30 | Jelly Dash, for creating the beautiful textures for the Ruby sheep and the ruby wool, 31 | xf8b, for helping a lot with the mod, and a lot of other people. 32 | """ 33 | 34 | [[dependencies.rubymod]] 35 | modId = "forge" 36 | mandatory = true 37 | versionRange = "[35,)" 38 | ordering = "NONE" 39 | side = "BOTH" 40 | 41 | [[dependencies.rubymod]] 42 | modId = "minecraft" 43 | mandatory = true 44 | versionRange = "[1.16.4,1.16.5]" 45 | ordering = "NONE" 46 | side = "BOTH" 47 | -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/centrifuge.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "facing=north": { 4 | "model": "rubymod:block/centrifuge" 5 | }, 6 | "facing=south": { 7 | "model": "rubymod:block/centrifuge", 8 | "y": 180 9 | }, 10 | "facing=west": { 11 | "model": "rubymod:block/centrifuge", 12 | "y": 270 13 | }, 14 | "facing=east": { 15 | "model": "rubymod:block/centrifuge", 16 | "y": 90 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ghost_water.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "rubymod:block/ghost_water" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ghost_water_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "rubymod:block/ghost_water" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/logic_gate.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "facing=east,logic_gate_mode=or,powered=false": { 4 | "y": 270, 5 | "model": "rubymod:block/logic_gate" 6 | }, 7 | "facing=east,logic_gate_mode=or,powered=true": { 8 | "y": 270, 9 | "model": "rubymod:block/logic_gate_on" 10 | }, 11 | "facing=east,logic_gate_mode=and,powered=false": { 12 | "y": 270, 13 | "model": "rubymod:block/logic_gate_and" 14 | }, 15 | "facing=east,logic_gate_mode=and,powered=true": { 16 | "y": 270, 17 | "model": "rubymod:block/logic_gate_on_and" 18 | }, 19 | "facing=north,logic_gate_mode=or,powered=false": { 20 | "y": 180, 21 | "model": "rubymod:block/logic_gate" 22 | }, 23 | "facing=north,logic_gate_mode=or,powered=true": { 24 | "y": 180, 25 | "model": "rubymod:block/logic_gate_on" 26 | }, 27 | "facing=north,logic_gate_mode=and,powered=false": { 28 | "y": 180, 29 | "model": "rubymod:block/logic_gate_and" 30 | }, 31 | "facing=north,logic_gate_mode=and,powered=true": { 32 | "y": 180, 33 | "model": "rubymod:block/logic_gate_on_and" 34 | }, 35 | "facing=south,logic_gate_mode=or,powered=false": { 36 | "model": "rubymod:block/logic_gate" 37 | }, 38 | "facing=south,logic_gate_mode=or,powered=true": { 39 | "model": "rubymod:block/logic_gate_on" 40 | }, 41 | "facing=south,logic_gate_mode=and,powered=false": { 42 | "model": "rubymod:block/logic_gate_and" 43 | }, 44 | "facing=south,logic_gate_mode=and,powered=true": { 45 | "model": "rubymod:block/logic_gate_on_and" 46 | }, 47 | "facing=west,logic_gate_mode=or,powered=false": { 48 | "y": 90, 49 | "model": "rubymod:block/logic_gate" 50 | }, 51 | "facing=west,logic_gate_mode=or,powered=true": { 52 | "y": 90, 53 | "model": "rubymod:block/logic_gate_on" 54 | }, 55 | "facing=west,logic_gate_mode=and,powered=false": { 56 | "y": 90, 57 | "model": "rubymod:block/logic_gate_and" 58 | }, 59 | "facing=west,logic_gate_mode=and,powered=true": { 60 | "y": 90, 61 | "model": "rubymod:block/logic_gate_on_and" 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ruby_barrel.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "open=false": { 4 | "model": "rubymod:block/ruby_barrel" 5 | }, 6 | "open=true": { 7 | "model": "rubymod:block/ruby_barrel_open" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "rubymod:block/ruby_block" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ruby_button.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "face=ceiling,facing=east,powered=false": { 4 | "model": "rubymod:block/ruby_button", 5 | "y": 270, 6 | "x": 180 7 | }, 8 | "face=ceiling,facing=east,powered=true": { 9 | "model": "rubymod:block/ruby_button_pressed", 10 | "y": 270, 11 | "x": 180 12 | }, 13 | "face=ceiling,facing=north,powered=false": { 14 | "model": "rubymod:block/ruby_button", 15 | "y": 180, 16 | "x": 180 17 | }, 18 | "face=ceiling,facing=north,powered=true": { 19 | "model": "rubymod:block/ruby_button_pressed", 20 | "y": 180, 21 | "x": 180 22 | }, 23 | "face=ceiling,facing=south,powered=false": { 24 | "model": "rubymod:block/ruby_button", 25 | "x": 180 26 | }, 27 | "face=ceiling,facing=south,powered=true": { 28 | "model": "rubymod:block/ruby_button_pressed", 29 | "x": 180 30 | }, 31 | "face=ceiling,facing=west,powered=false": { 32 | "model": "rubymod:block/ruby_button", 33 | "y": 90, 34 | "x": 180 35 | }, 36 | "face=ceiling,facing=west,powered=true": { 37 | "model": "rubymod:block/ruby_button_pressed", 38 | "y": 90, 39 | "x": 180 40 | }, 41 | "face=floor,facing=east,powered=false": { 42 | "model": "rubymod:block/ruby_button", 43 | "y": 90 44 | }, 45 | "face=floor,facing=east,powered=true": { 46 | "model": "rubymod:block/ruby_button_pressed", 47 | "y": 90 48 | }, 49 | "face=floor,facing=north,powered=false": { 50 | "model": "rubymod:block/ruby_button" 51 | }, 52 | "face=floor,facing=north,powered=true": { 53 | "model": "rubymod:block/ruby_button_pressed" 54 | }, 55 | "face=floor,facing=south,powered=false": { 56 | "model": "rubymod:block/ruby_button", 57 | "y": 180 58 | }, 59 | "face=floor,facing=south,powered=true": { 60 | "model": "rubymod:block/ruby_button_pressed", 61 | "y": 180 62 | }, 63 | "face=floor,facing=west,powered=false": { 64 | "model": "rubymod:block/ruby_button", 65 | "y": 270 66 | }, 67 | "face=floor,facing=west,powered=true": { 68 | "model": "rubymod:block/ruby_button_pressed", 69 | "y": 270 70 | }, 71 | "face=wall,facing=east,powered=false": { 72 | "model": "rubymod:block/ruby_button", 73 | "y": 90, 74 | "x": 90, 75 | "uvlock": true 76 | }, 77 | "face=wall,facing=east,powered=true": { 78 | "model": "rubymod:block/ruby_button_pressed", 79 | "y": 90, 80 | "x": 90, 81 | "uvlock": true 82 | }, 83 | "face=wall,facing=north,powered=false": { 84 | "model": "rubymod:block/ruby_button", 85 | "x": 90, 86 | "uvlock": true 87 | }, 88 | "face=wall,facing=north,powered=true": { 89 | "model": "rubymod:block/ruby_button_pressed", 90 | "x": 90, 91 | "uvlock": true 92 | }, 93 | "face=wall,facing=south,powered=false": { 94 | "model": "rubymod:block/ruby_button", 95 | "y": 180, 96 | "x": 90, 97 | "uvlock": true 98 | }, 99 | "face=wall,facing=south,powered=true": { 100 | "model": "rubymod:block/ruby_button_pressed", 101 | "y": 180, 102 | "x": 90, 103 | "uvlock": true 104 | }, 105 | "face=wall,facing=west,powered=false": { 106 | "model": "rubymod:block/ruby_button", 107 | "y": 270, 108 | "x": 90, 109 | "uvlock": true 110 | }, 111 | "face=wall,facing=west,powered=true": { 112 | "model": "rubymod:block/ruby_button_pressed", 113 | "y": 270, 114 | "x": 90, 115 | "uvlock": true 116 | } 117 | } 118 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ruby_carpet.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "rubymod:block/ruby_carpet" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ruby_ore.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "rubymod:block/ruby_ore" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ruby_pressure_plate.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "powered=false": { 4 | "model": "rubymod:block/ruby_pressure_plate" 5 | }, 6 | "powered=true": { 7 | "model": "rubymod:block/ruby_pressure_plate_down" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ruby_slab.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "type=bottom": { 4 | "model": "rubymod:block/ruby_slab" 5 | }, 6 | "type=double": { 7 | "model": "rubymod:block/ruby_block" 8 | }, 9 | "type=top": { 10 | "model": "rubymod:block/ruby_slab_top" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ruby_wall.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "when": { 5 | "up": "true" 6 | }, 7 | "apply": { 8 | "model": "rubymod:block/ruby_wall_post" 9 | } 10 | }, 11 | { 12 | "when": { 13 | "north": "low" 14 | }, 15 | "apply": { 16 | "model": "rubymod:block/ruby_wall_side", 17 | "uvlock": true 18 | } 19 | }, 20 | { 21 | "when": { 22 | "east": "low" 23 | }, 24 | "apply": { 25 | "model": "rubymod:block/ruby_wall_side", 26 | "y": 90, 27 | "uvlock": true 28 | } 29 | }, 30 | { 31 | "when": { 32 | "south": "low" 33 | }, 34 | "apply": { 35 | "model": "rubymod:block/ruby_wall_side", 36 | "y": 180, 37 | "uvlock": true 38 | } 39 | }, 40 | { 41 | "when": { 42 | "west": "low" 43 | }, 44 | "apply": { 45 | "model": "rubymod:block/ruby_wall_side", 46 | "y": 270, 47 | "uvlock": true 48 | } 49 | }, 50 | { 51 | "when": { 52 | "north": "tall" 53 | }, 54 | "apply": { 55 | "model": "rubymod:block/ruby_wall_side_tall", 56 | "uvlock": true 57 | } 58 | }, 59 | { 60 | "when": { 61 | "east": "tall" 62 | }, 63 | "apply": { 64 | "model": "rubymod:block/ruby_wall_side_tall", 65 | "y": 90, 66 | "uvlock": true 67 | } 68 | }, 69 | { 70 | "when": { 71 | "south": "tall" 72 | }, 73 | "apply": { 74 | "model": "rubymod:block/ruby_wall_side_tall", 75 | "y": 180, 76 | "uvlock": true 77 | } 78 | }, 79 | { 80 | "when": { 81 | "west": "tall" 82 | }, 83 | "apply": { 84 | "model": "rubymod:block/ruby_wall_side_tall", 85 | "y": 270, 86 | "uvlock": true 87 | } 88 | } 89 | ] 90 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/blockstates/ruby_wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "rubymod:block/ruby_wool" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ghost_water.json: -------------------------------------------------------------------------------- 1 | { 2 | "textures": { 3 | "particle": "rubymod:blocks/ghost_water_still" 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_barrel.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_bottom_top", 3 | "textures": { 4 | "top": "rubymod:blocks/ruby_barrel_top", 5 | "bottom": "rubymod:blocks/ruby_barrel_bottom", 6 | "side": "rubymod:blocks/ruby_barrel_side" 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_barrel_open.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_bottom_top", 3 | "textures": { 4 | "top": "rubymod:blocks/ruby_barrel_top_open", 5 | "bottom": "rubymod:blocks/ruby_barrel_bottom", 6 | "side": "rubymod:blocks/ruby_barrel_side" 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "textures": { 4 | "all": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_button.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/button", 3 | "textures": { 4 | "texture": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_button_inventory.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/button_inventory", 3 | "textures": { 4 | "texture": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_button_pressed.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/button_pressed", 3 | "textures": { 4 | "texture": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_carpet.json: -------------------------------------------------------------------------------- 1 | { 2 | "textures": { 3 | "all": "rubymod:blocks/ruby_carpet", 4 | "particle": "rubymod:blocks/ruby_carpet" 5 | }, 6 | "elements": [ 7 | { 8 | "from": [ 9 | 0, 10 | 0, 11 | 0 12 | ], 13 | "to": [ 14 | 16, 15 | 1, 16 | 16 17 | ], 18 | "faces": { 19 | "down": { 20 | "uv": [ 21 | 0, 22 | 16, 23 | 16, 24 | 0 25 | ], 26 | "texture": "#all" 27 | }, 28 | "up": { 29 | "uv": [ 30 | 0, 31 | 0, 32 | 16, 33 | 16 34 | ], 35 | "texture": "#all" 36 | }, 37 | "north": { 38 | "uv": [ 39 | 16, 40 | 15, 41 | 0, 42 | 16 43 | ], 44 | "texture": "#all" 45 | }, 46 | "south": { 47 | "uv": [ 48 | 0, 49 | 15, 50 | 16, 51 | 16 52 | ], 53 | "texture": "#all" 54 | }, 55 | "west": { 56 | "uv": [ 57 | 0, 58 | 15, 59 | 15, 60 | 16 61 | ], 62 | "texture": "#all" 63 | }, 64 | "east": { 65 | "uv": [ 66 | 15, 67 | 15, 68 | 0, 69 | 16 70 | ], 71 | "texture": "#all" 72 | } 73 | } 74 | } 75 | ], 76 | "display": { 77 | "gui": { 78 | "rotation": [ 79 | 30, 80 | 225, 81 | 0 82 | ], 83 | "translation": [ 84 | 0, 85 | 0, 86 | 0 87 | ], 88 | "scale": [ 89 | 0.625, 90 | 0.625, 91 | 0.625 92 | ] 93 | }, 94 | "ground": { 95 | "rotation": [ 96 | 0, 97 | 0, 98 | 0 99 | ], 100 | "translation": [ 101 | 0, 102 | 3, 103 | 0 104 | ], 105 | "scale": [ 106 | 0.25, 107 | 0.25, 108 | 0.25 109 | ] 110 | }, 111 | "fixed": { 112 | "rotation": [ 113 | 0, 114 | 0, 115 | 0 116 | ], 117 | "translation": [ 118 | 0, 119 | 0, 120 | 0 121 | ], 122 | "scale": [ 123 | 0.5, 124 | 0.5, 125 | 0.5 126 | ] 127 | }, 128 | "thirdperson_righthand": { 129 | "rotation": [ 130 | 75, 131 | 45, 132 | 0 133 | ], 134 | "translation": [ 135 | 0, 136 | 2.5, 137 | 2 138 | ], 139 | "scale": [ 140 | 0.375, 141 | 0.375, 142 | 0.375 143 | ] 144 | }, 145 | "firstperson_righthand": { 146 | "rotation": [ 147 | 0, 148 | 45, 149 | 0 150 | ], 151 | "translation": [ 152 | 0, 153 | 4.2, 154 | 0 155 | ], 156 | "scale": [ 157 | 0.40, 158 | 0.40, 159 | 0.40 160 | ] 161 | }, 162 | "firstperson_lefthand": { 163 | "rotation": [ 164 | 0, 165 | 225, 166 | 0 167 | ], 168 | "translation": [ 169 | 0, 170 | 4.2, 171 | 0 172 | ], 173 | "scale": [ 174 | 0.40, 175 | 0.40, 176 | 0.40 177 | ] 178 | } 179 | } 180 | } 181 | 182 | -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_ore.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "textures": { 4 | "all": "rubymod:blocks/ruby_ore" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_pressure_plate.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/pressure_plate_up", 3 | "textures": { 4 | "texture": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_pressure_plate_down.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/pressure_plate_down", 3 | "textures": { 4 | "texture": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_slab.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/slab", 3 | "textures": { 4 | "bottom": "rubymod:blocks/ruby_block", 5 | "top": "rubymod:blocks/ruby_block", 6 | "side": "rubymod:blocks/ruby_block" 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_slab_top.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/slab_top", 3 | "textures": { 4 | "bottom": "rubymod:blocks/ruby_block", 5 | "top": "rubymod:blocks/ruby_block", 6 | "side": "rubymod:blocks/ruby_block" 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_stairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/stairs", 3 | "textures": { 4 | "bottom": "rubymod:blocks/ruby_block", 5 | "top": "rubymod:blocks/ruby_block", 6 | "side": "rubymod:blocks/ruby_block" 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_stairs_inner.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/inner_stairs", 3 | "textures": { 4 | "bottom": "rubymod:blocks/ruby_block", 5 | "top": "rubymod:blocks/ruby_block", 6 | "side": "rubymod:blocks/ruby_block" 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_stairs_outer.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/outer_stairs", 3 | "textures": { 4 | "bottom": "rubymod:blocks/ruby_block", 5 | "top": "rubymod:blocks/ruby_block", 6 | "side": "rubymod:blocks/ruby_block" 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_wall_inventory.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/wall_inventory", 3 | "textures": { 4 | "wall": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_wall_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/template_wall_post", 3 | "textures": { 4 | "wall": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_wall_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/template_wall_side", 3 | "textures": { 4 | "wall": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_wall_side_tall.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/template_wall_side_tall", 3 | "textures": { 4 | "wall": "rubymod:blocks/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/models/block/ruby_wool.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "textures": { 4 | "all": "rubymod:blocks/ruby_wool" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/centrifuge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/centrifuge.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ghost_water_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ghost_water_flow.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ghost_water_flow.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": {} 3 | } -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ghost_water_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ghost_water_overlay.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ghost_water_still.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ghost_water_still.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ghost_water_still.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 2 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/logic_gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/logic_gate.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/logic_gate_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/logic_gate_on.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ruby_barrel_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ruby_barrel_bottom.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ruby_barrel_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ruby_barrel_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ruby_barrel_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ruby_barrel_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ruby_barrel_top_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ruby_barrel_top_open.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ruby_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ruby_block.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ruby_carpet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ruby_carpet.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ruby_ore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ruby_ore.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/blocks/ruby_wool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/blocks/ruby_wool.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/entity/ruby_sheep/ruby_sheep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/entity/ruby_sheep/ruby_sheep.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/entity/ruby_sheep/ruby_sheep_fur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/entity/ruby_sheep/ruby_sheep_fur.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/entity/villager/profession/jeweler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/entity/villager/profession/jeweler.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/entity/zombie_villager/profession/jeweler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/entity/zombie_villager/profession/jeweler.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/gui/ruby_barrel/ruby_barrel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/gui/ruby_barrel/ruby_barrel.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ghost_water_bucket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ghost_water_bucket.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/logic_gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/logic_gate.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/poisoned_apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/poisoned_apple.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby_axe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby_axe.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby_boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby_boots.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby_chestplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby_chestplate.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby_helmet.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby_hoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby_hoe.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby_leggings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby_leggings.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby_pickaxe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby_pickaxe.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby_shovel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby_shovel.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/items/ruby_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/items/ruby_sword.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/models/armor/ruby_layer_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/models/armor/ruby_layer_1.png -------------------------------------------------------------------------------- /src/main/resources/assets/rubymod/textures/models/armor/ruby_layer_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/assets/rubymod/textures/models/armor/ruby_layer_2.png -------------------------------------------------------------------------------- /src/main/resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOnlyTails/RubyMod/d3a66cbb02bb4fb63ec00b08613754a3cf2cf406/src/main/resources/logo.png -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "rubymod resources", 4 | "pack_format": 5 5 | } 6 | } 7 | --------------------------------------------------------------------------------