diff --git a/build-BACKUP.gradle b/build-BACKUP.gradle index c458d34..982d485 100644 --- a/build-BACKUP.gradle +++ b/build-BACKUP.gradle @@ -1,16 +1,13 @@ buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } - maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true - classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle' -apply plugin: 'org.spongepowered.mixin' apply plugin: 'eclipse' version = '0.2r' @@ -30,19 +27,26 @@ minecraft { property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' - args '--username', 'McAlec1' - jvmArgs = [ - "--add-exports=java.base/sun.security.util=ALL-UNNAMED", - "--add-opens=java.base/java.util.jar=ALL-UNNAMED" - ] - - } - } -} -mixin { - env { - remapRefMap = true + mods { + examplemod { + source sourceSets.main + } + } + } + + server { + workingDirectory project.file('run') + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + + mods { + examplemod { + source sourceSets.main + } + } + } } } @@ -85,9 +89,9 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.18.2-40.2.14' // Forge + minecraft 'net.minecraftforge:forge:1.18.2-40.2.10' // Forge implementation fg.deobf("net.ltxprogrammer.changed:Changed-m1.18.2-f40.2.0:v0.12.1") // Changed Mod - implementation fg.deobf("curse.maven:changed-addon-plus-711303:4903584") // Changed Addon Plus Mod + implementation fg.deobf("curse.maven:changed-addon-plus-711303:4952620") // Changed Addon Plus Mod implementation fg.deobf("curse.maven:jei-238222:4593548") // Just Enough Items (JEI) Mod } @@ -112,7 +116,7 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.18.2-40.2.14' + minecraft 'net.minecraftforge:forge:1.18.2-40.2.10' } tasks.withType(JavaCompile).configureEach { diff --git a/build.gradle b/build.gradle index c458d34..b939a1a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,26 +1,34 @@ buildscript { - repositories { - maven { url = 'https://maven.minecraftforge.net' } + repositories { + maven { url = 'https://maven.minecraftforge.net' } maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' - } + } +} + +plugins { + id 'net.minecraftforge.gradle' version '5.1.+' + id 'org.spongepowered.mixin' version '0.7.+' + id 'eclipse' + id 'idea' + id 'maven-publish' } -apply plugin: 'net.minecraftforge.gradle' -apply plugin: 'org.spongepowered.mixin' -apply plugin: 'eclipse' -version = '0.2r' -group = 'net.mcalec.mcalecs_changed_addon' -archivesBaseName = 'mcalecs_changed_addon' +version = modVersion +group = 'net.mcalec.mcs_changed_addon' +archivesBaseName = 'mcs_changed_addon' java.toolchain.languageVersion = JavaLanguageVersion.of(17) +println "build.gradle is starting!" +println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" + minecraft { - mappings channel: 'official', version: '1.18.2' + mappings channel: 'official', version: minecraftVersion accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') @@ -30,19 +38,56 @@ minecraft { property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' - args '--username', 'McAlec1' - jvmArgs = [ - "--add-exports=java.base/sun.security.util=ALL-UNNAMED", - "--add-opens=java.base/java.util.jar=ALL-UNNAMED" - ] - - } - } -} + property 'forge.enabledGameTestNamespaces', 'mcs_changed_addon' -mixin { - env { - remapRefMap = true + mods { + "${modId}" { + source sourceSets.main + } + } + } + + server { + workingDirectory project.file('run-server') + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + property 'forge.enabledGameTestNamespaces', 'mcs_changed_addon' + + mods { + "${modId}" { + source sourceSets.main + } + } + } + + gameTestServer { + workingDirectory project.file('run-server') + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + property 'forge.enabledGameTestNamespaces', 'mcs_changed_addon' + + mods { + "${modId}" { + source sourceSets.main + } + } + } + + data { + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + property 'forge.enabledGameTestNamespaces', 'mcs_changed_addon' + + args '--mod', 'mcalecs', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + + mods { + "${modId}" { + source sourceSets.main + } + } + } } } @@ -51,72 +96,101 @@ repositories { flatDir { dirs 'libs' } + + maven { + // Curse Maven + name = "Curse Maven" + url "https://cursemaven.com" + } maven { - // CurseForge maven - name = "CurseForge Maven" - url = "https://cursemaven.com" + // Modrinth Maven + name = "Modrinth Maven" + url = "https://api.modrinth.com/maven" } maven { - // Changed Mod repo - name = "Changed" - url = "https://raw.githubusercontent.com/LtxProgrammer/Changed-Minecraft-Mod/master/mcmodsrepo/" + // Mod Maven + name = "Mod Maven" + url = "https://modmaven.dev" } - maven { - // Modrinth maven - name = "Modrinth Maven" - url = "https://api.modrinth.com/maven" + maven { + // location of the maven that hosts JEI files before January 2023 + name = "Progwml6's maven" + url = "https://dvs1.progwml6.com/files/maven/" } maven { - // location of the maven that hosts JEI files - name = "Progwml6 maven" - url = "https://dvs1.progwml6.com/files/maven/" + // location of the maven that hosts JEI files since January 2023 + name = "Jared's maven" + url = "https://maven.blamejared.com/" } maven { - // location of a maven mirror for JEI files, as a fallback - name = "ModMaven" - url = "https://modmaven.dev" + // Fuzs Maven + name = "Fuzs Mod Resources" + url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" + } + maven { url "https://maven.shedaniel.me" } + + + maven { + // Changed Mod repo + name = "Changed" + url = "https://raw.githubusercontent.com/LtxProgrammer/Changed-Minecraft-Mod/master/mcmodsrepo/" } } +mixin { + //config "mixins.mcs_changed_addon.json" + //add sourceSets.main, "mixins.mcs_changed_addon.refmap.json" + + showMessageTypes = true +} + dependencies { - minecraft 'net.minecraftforge:forge:1.18.2-40.2.14' // Forge - implementation fg.deobf("net.ltxprogrammer.changed:Changed-m1.18.2-f40.2.0:v0.12.1") // Changed Mod - implementation fg.deobf("curse.maven:changed-addon-plus-711303:4903584") // Changed Addon Plus Mod - implementation fg.deobf("curse.maven:jei-238222:4593548") // Just Enough Items (JEI) Mod + // Minecraft and Forge Versions + minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}" // Forge 1.18.2 20.2.21 + + implementation fg.deobf("net.ltxprogrammer.changed:Changed-m1.18.2-f40.2.0:v0.13.1") // Changed Mod + implementation fg.deobf("curse.maven:changed-addon-plus-711303:5319556") // Changed Addon Plus Mod } tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation } -repositories { - // Other repositories can go above or below Modrinth's. We don't need priority :) - exclusiveContent { - forRepository { - maven { - name = "Modrinth" - url = "https://api.modrinth.com/maven" - } - } - forRepositories(fg.repository) // Only add this if you're using ForgeGradle, otherwise remove this line - filter { - includeGroup "maven.modrinth" - } +jar { + manifest { + attributes([ + "Specification-Title" : "mcs_changed_addon", + "Specification-Vendor" : "McAlec", + "Specification-Version" : "1", // We are version 1 of ourselves + "Implementation-Title" : project.name, + "Implementation-Version" : project.jar.archiveVersion, + "Implementation-Vendor" : "McAlec", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) } } -dependencies { - minecraft 'net.minecraftforge:forge:1.18.2-40.2.14' -} +jar.finalizedBy('reobfJar') -tasks.withType(JavaCompile).configureEach { - options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation +publishing { + publications { + register('mavenJava', MavenPublication) { + artifact jar + } + } + repositories { + maven { + url "file://${project.projectDir}/mcmodsrepo" + } + } } +println "build.gradle is done!" + apply from: 'mcreator.gradle' diff --git a/elements/AddonBook.mod.json b/elements/AddonBook.mod.json deleted file mode 100644 index a642902..0000000 --- a/elements/AddonBook.mod.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "_fv": 47, - "_type": "item", - "definition": { - "renderType": 0, - "texture": "addonbookitem", - "customModelName": "Normal", - "customProperties": {}, - "states": [], - "name": "McAlec's Changed Addon Book", - "rarity": "RARE", - "creativeTab": { - "value": "CUSTOM:McalecsChangedTab" - }, - "stackSize": 1, - "enchantability": 0, - "useDuration": 0, - "toolType": 1.0, - "damageCount": 0, - "recipeRemainder": { - "value": "" - }, - "destroyAnyBlock": false, - "immuneToFire": false, - "stayInGridWhenCrafting": false, - "damageOnCrafting": false, - "enableMeleeDamage": false, - "damageVsEntity": 0.0, - "specialInfo": [], - "hasGlow": false, - "guiBoundTo": "", - "inventorySize": 9, - "inventoryStackSize": 64, - "onRightClickedInAir": { - "name": "AddonBookRightClicked" - }, - "onStoppedUsing": { - "name": "AddonBookGUIButtonClose" - }, - "isFood": false, - "nutritionalValue": 4, - "saturation": 0.3, - "eatResultItem": { - "value": "" - }, - "isMeat": false, - "isAlwaysEdible": false, - "animation": "none" - } -} \ No newline at end of file diff --git a/elements/AddonBookGUI.mod.json b/elements/AddonBookGUI.mod.json deleted file mode 100644 index 98fb7cc..0000000 --- a/elements/AddonBookGUI.mod.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "_fv": 47, - "_type": "gui", - "definition": { - "type": 0, - "width": 208, - "height": 166, - "inventoryOffsetX": 0, - "inventoryOffsetY": 0, - "renderBgLayer": true, - "doesPauseGame": false, - "components": [ - { - "type": "label", - "data": { - "name": "label_mcalecs_changed_addon", - "text": { - "fixedValue": "McAlec's Changed Addon" - }, - "color": { - "value": -14145496, - "falpha": 0.0 - }, - "x": 155, - "y": 65 - } - }, - { - "type": "label", - "data": { - "name": "label_thank_you_for_downloading", - "text": { - "fixedValue": "Thank you for downloading." - }, - "color": { - "value": -10066330, - "falpha": 0.0 - }, - "x": 145, - "y": 135 - } - }, - { - "type": "button", - "data": { - "name": "button_close", - "text": "Close", - "onClick": { - "name": "AddonBookGUIButtonClose" - }, - "width": 51, - "height": 20, - "x": 125, - "y": 175 - } - }, - { - "type": "button", - "data": { - "name": "button_next", - "text": "Next", - "width": 46, - "height": 20, - "x": 255, - "y": 175 - } - }, - { - "type": "label", - "data": { - "name": "label_i", - "text": { - "fixedValue": "i" - }, - "color": { - "value": -12829636, - "falpha": 0.0 - }, - "x": 215, - "y": 175 - } - } - ], - "gridSettings": { - "sx": 20, - "sy": 20, - "ox": 8, - "oy": 8, - "snapOnGrid": true - } - } -} \ No newline at end of file diff --git a/elements/AddonBookGUIButtonClose.mod.json b/elements/AddonBookGUIButtonClose.mod.json deleted file mode 100644 index 5867a53..0000000 --- a/elements/AddonBookGUIButtonClose.mod.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "_fv": 47, - "_type": "procedure", - "definition": { - "procedurexml": "no_ext_trigger" - } -} \ No newline at end of file diff --git a/elements/AddonBookGUIDevTest.mod.json b/elements/AddonBookGUIDevTest.mod.json deleted file mode 100644 index 1870bbd..0000000 --- a/elements/AddonBookGUIDevTest.mod.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_fv": 47, - "_type": "gui", - "definition": { - "type": 0, - "width": 176, - "height": 166, - "inventoryOffsetX": 0, - "inventoryOffsetY": 0, - "renderBgLayer": true, - "doesPauseGame": false, - "components": [ - { - "type": "button", - "data": { - "name": "button_untransfer", - "text": "untransfer", - "onClick": { - "name": "GUIDevTestUntransfur" - }, - "width": 77, - "height": 20, - "x": 131, - "y": 175 - } - }, - { - "type": "button", - "data": { - "name": "button_exit", - "text": "exit", - "onClick": { - "name": "AddonBookGUIButtonClose" - }, - "width": 46, - "height": 20, - "x": 130, - "y": 206 - } - }, - { - "type": "label", - "data": { - "name": "label_mcalecs_dev_test_screen", - "text": { - "fixedValue": "McAlec's Dev Test Screen" - }, - "color": { - "value": -16777216, - "falpha": 0.0 - }, - "x": 152, - "y": 51 - } - }, - { - "type": "button", - "data": { - "name": "button_time_set_day", - "text": "time set day", - "onClick": { - "name": "GUIDevTestTimeSet" - }, - "width": 87, - "height": 20, - "x": 208, - "y": 175 - } - } - ], - "gridSettings": { - "sx": 18, - "sy": 18, - "ox": 11, - "oy": 15, - "snapOnGrid": false - } - } -} \ No newline at end of file diff --git a/elements/AddonBookGUIMain.mod.json b/elements/AddonBookGUIMain.mod.json deleted file mode 100644 index 03da7d2..0000000 --- a/elements/AddonBookGUIMain.mod.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "_fv": 47, - "_type": "procedure", - "definition": { - "procedurexml": "no_ext_triggerAddonBookGUI" - } -} \ No newline at end of file diff --git a/elements/AddonBookGUIPage1.mod.json b/elements/AddonBookGUIPage1.mod.json deleted file mode 100644 index 0cb5209..0000000 --- a/elements/AddonBookGUIPage1.mod.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "_fv": 47, - "_type": "gui", - "definition": { - "type": 0, - "width": 176, - "height": 166, - "inventoryOffsetX": 0, - "inventoryOffsetY": 0, - "renderBgLayer": true, - "doesPauseGame": false, - "components": [ - { - "type": "button", - "data": { - "name": "button_back", - "text": "Back", - "onClick": { - "name": "AddonBookGUIMain" - }, - "width": 46, - "height": 20, - "x": 135, - "y": 175 - } - }, - { - "type": "label", - "data": { - "name": "label_howd_you_get_here", - "text": { - "fixedValue": "How'd you get here?" - }, - "color": { - "value": -12829636, - "falpha": 0.0 - }, - "x": 165, - "y": 105 - } - } - ], - "gridSettings": { - "sx": 20, - "sy": 20, - "ox": 8, - "oy": 8, - "snapOnGrid": true - } - } -} \ No newline at end of file diff --git a/elements/AddonBookRightClicked.mod.json b/elements/AddonBookRightClicked.mod.json deleted file mode 100644 index 03da7d2..0000000 --- a/elements/AddonBookRightClicked.mod.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "_fv": 47, - "_type": "procedure", - "definition": { - "procedurexml": "no_ext_triggerAddonBookGUI" - } -} \ No newline at end of file diff --git a/elements/BaseballBatRecipe.mod.json b/elements/BaseballBatRecipe.mod.json deleted file mode 100644 index 3043244..0000000 --- a/elements/BaseballBatRecipe.mod.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_fv": 47, - "_type": "recipe", - "definition": { - "recipeType": "Crafting", - "recipeRetstackSize": 1, - "group": "", - "cookingBookCategory": "MISC", - "xpReward": 0.0, - "cookingTime": 200, - "craftingBookCategory": "MISC", - "recipeShapeless": false, - "recipeSlots": [ - { - "value": "" - }, - { - "value": "Items.STICK" - }, - { - "value": "" - }, - { - "value": "" - }, - { - "value": "Items.STICK" - }, - { - "value": "" - }, - { - "value": "" - }, - { - "value": "Items.STICK" - }, - { - "value": "" - } - ], - "recipeReturnStack": { - "value": "CUSTOM:BaseballBatTool" - }, - "name": "baseball_bat_recipe", - "namespace": "mod" - } -} \ No newline at end of file diff --git a/elements/BaseballBatTool.mod.json b/elements/BaseballBatTool.mod.json deleted file mode 100644 index f185a3b..0000000 --- a/elements/BaseballBatTool.mod.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "_fv": 47, - "_type": "tool", - "definition": { - "toolType": "Sword", - "renderType": 0, - "texture": "screenshot_2023-08-23_144851", - "customModelName": "Normal", - "name": "Baseball Bat", - "specialInfo": [], - "creativeTab": { - "value": "CUSTOM:McalecsChangedTab" - }, - "harvestLevel": 0, - "efficiency": 2.0, - "attackSpeed": 1.6, - "enchantability": 2, - "damageVsEntity": 2.0, - "usageCount": 100, - "blocksAffected": [], - "hasGlow": false, - "repairItems": [], - "immuneToFire": false, - "stayInGridWhenCrafting": false, - "damageOnCrafting": false - } -} \ No newline at end of file diff --git a/elements/DevItem.mod.json b/elements/DevItem.mod.json deleted file mode 100644 index 6707115..0000000 --- a/elements/DevItem.mod.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "_fv": 47, - "_type": "item", - "definition": { - "renderType": 0, - "texture": "dev_item", - "customModelName": "Normal", - "customProperties": {}, - "states": [], - "name": "Dev Item", - "rarity": "EPIC", - "creativeTab": { - "value": "No creative tab entry" - }, - "stackSize": 1, - "enchantability": 0, - "useDuration": 0, - "toolType": 1.0, - "damageCount": 0, - "recipeRemainder": { - "value": "" - }, - "destroyAnyBlock": false, - "immuneToFire": false, - "stayInGridWhenCrafting": false, - "damageOnCrafting": false, - "enableMeleeDamage": false, - "damageVsEntity": 0.0, - "specialInfo": [], - "hasGlow": true, - "guiBoundTo": "", - "inventorySize": 9, - "inventoryStackSize": 64, - "isFood": false, - "nutritionalValue": 4, - "saturation": 0.3, - "eatResultItem": { - "value": "" - }, - "isMeat": false, - "isAlwaysEdible": false, - "animation": "none" - } -} \ No newline at end of file diff --git a/elements/DownloadedMod.mod.json b/elements/DownloadedMod.mod.json deleted file mode 100644 index 0a3ce1f..0000000 --- a/elements/DownloadedMod.mod.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "_fv": 47, - "_type": "achievement", - "definition": { - "achievementName": "McAlec's Changed Addon", - "achievementDescription": "You downloaded McAlec's Changed Addon (MCA) by McAlec!", - "achievementIcon": { - "value": "CUSTOM:DevItem" - }, - "background": "Default", - "disableDisplay": false, - "showPopup": true, - "announceToChat": false, - "hideIfNotCompleted": false, - "rewardLoot": [], - "rewardRecipes": [], - "rewardFunction": "No function", - "rewardXP": 0, - "achievementType": "task", - "parent": { - "value": "No parent: root" - }, - "triggerxml": "" - } -} \ No newline at end of file diff --git a/elements/GUIDevTestTimeSet.mod.json b/elements/GUIDevTestTimeSet.mod.json deleted file mode 100644 index e53f0d3..0000000 --- a/elements/GUIDevTestTimeSet.mod.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "_fv": 47, - "_type": "procedure", - "definition": { - "procedurexml": "no_ext_triggertime set day" - } -} \ No newline at end of file diff --git a/elements/GUIDevTestUntransfur.mod.json b/elements/GUIDevTestUntransfur.mod.json deleted file mode 100644 index bed05ff..0000000 --- a/elements/GUIDevTestUntransfur.mod.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "_fv": 47, - "_type": "procedure", - "definition": { - "procedurexml": "no_ext_triggeruntransfur @s" - } -} \ No newline at end of file diff --git a/elements/GiveInfoBook.mod.json b/elements/GiveInfoBook.mod.json deleted file mode 100644 index 52aa212..0000000 --- a/elements/GiveInfoBook.mod.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "_fv": 47, - "_type": "gamerule", - "definition": { - "type": "Logic", - "displayName": "MCA Info Book on Start", - "description": "Gives McAlec's Changed Addon Book on the start of a new world or new player join", - "category": "PLAYER", - "defaultValueLogic": false, - "defaultValueNumber": 0 - } -} \ No newline at end of file diff --git a/elements/MadeBaseballBat.mod.json b/elements/MadeBaseballBat.mod.json deleted file mode 100644 index 6ceb241..0000000 --- a/elements/MadeBaseballBat.mod.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "_fv": 47, - "_type": "achievement", - "definition": { - "achievementName": "Swing at your desire.", - "achievementDescription": "You made a baseball bat for those creatures...?", - "achievementIcon": { - "value": "CUSTOM:BaseballBatTool" - }, - "background": "Default", - "disableDisplay": false, - "showPopup": true, - "announceToChat": true, - "hideIfNotCompleted": true, - "rewardLoot": [], - "rewardRecipes": [], - "rewardFunction": "No function", - "rewardXP": 0, - "achievementType": "task", - "parent": { - "value": "CUSTOM:DownloadedMod" - }, - "triggerxml": "19CUSTOM:BaseballBatTool" - } -} \ No newline at end of file diff --git a/elements/McalecsChangedTab.mod.json b/elements/McalecsChangedTab.mod.json deleted file mode 100644 index 703c788..0000000 --- a/elements/McalecsChangedTab.mod.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "_fv": 47, - "_type": "tab", - "definition": { - "name": "McAlec's Changed Addon", - "icon": { - "value": "CUSTOM:DevItem" - }, - "showSearch": false - } -} \ No newline at end of file diff --git a/elements/TerminatedLab.mod.json b/elements/TerminatedLab.mod.json deleted file mode 100644 index 3b5551f..0000000 --- a/elements/TerminatedLab.mod.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "_fv": 47, - "_type": "structure", - "definition": { - "structure": "terminated_lab", - "randomlyRotateStructure": false, - "surfaceDetectionType": "First motion blocking block", - "spawnProbability": 500, - "minCountPerChunk": 1, - "maxCountPerChunk": 1, - "spawnLocation": "Ground", - "spawnHeightOffset": 0, - "spawnXOffset": 0, - "spawnZOffset": 0, - "spawnWorldTypes": [ - "Surface" - ], - "restrictionBlocks": [ - { - "value": "Blocks.GRASS" - } - ], - "restrictionBiomes": [ - { - "value": "plains" - }, - { - "value": "snowy_tundra" - }, - { - "value": "mutated_plains" - }, - { - "value": "savanna" - } - ], - "ignoreBlocks": "STRUCTURE_BLOCK" - } -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 29b2ac4..f8e701d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,9 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false + +modVersion = 1.0.0 +modId = mcs_changed_addon +modName = mcalecs_changed_addon +minecraftVersion = 1.18.2 +forgeVersion = 40.2.0 +changedVersion = v0.13.1 diff --git a/mcalecs_changed_addon.mcreator b/mcalecs_changed_addon.mcreator deleted file mode 100644 index 0612eb9..0000000 --- a/mcalecs_changed_addon.mcreator +++ /dev/null @@ -1,497 +0,0 @@ -{ - "mod_elements": [ - { - "name": "McalecsChangedTab", - "type": "tab", - "sortid": 2, - "compiles": true, - "locked_code": false, - "registry_name": "mcalecs_changed_tab", - "metadata": { - "files": [] - } - }, - { - "name": "BaseballBatTool", - "type": "tool", - "sortid": 1, - "compiles": true, - "locked_code": false, - "registry_name": "baseball_bat", - "metadata": { - "files": [ - "src/main/resources/assets/mcalecs_changed_addon/models/item/baseball_bat.json", - "src/main/java/net/mcalecs/mcalecs_changed_addon/item/BaseballBatToolItem.java" - ] - }, - "path": "~/Tools" - }, - { - "name": "BaseballBatRecipe", - "type": "recipe", - "compiles": true, - "locked_code": false, - "registry_name": "baseball_bat_recipe", - "metadata": { - "files": [ - "src/main/resources/data/mcalecs_changed_addon/recipes/baseball_bat_recipe.json" - ] - }, - "path": "~/Tools" - }, - { - "name": "AddonBook", - "type": "item", - "sortid": 3, - "compiles": true, - "locked_code": false, - "registry_name": "addon_book", - "metadata": { - "files": [ - "src/main/resources/assets/mcalecs_changed_addon/models/item/addon_book.json", - "src/main/java/net/mcalecs/mcalecs_changed_addon/item/AddonBookItem.java" - ] - }, - "path": "~/Book GUI" - }, - { - "name": "AddonBookGUI", - "type": "gui", - "sortid": 7, - "compiles": true, - "locked_code": false, - "registry_name": "addon_book_gui", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIMenu.java", - "src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIButtonMessage.java", - "src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIScreen.java" - ] - }, - "path": "~/Book GUI/GUIs" - }, - { - "name": "AddonBookGUIButtonClose", - "type": "procedure", - "sortid": 5, - "compiles": true, - "locked_code": false, - "registry_name": "addon_book_gui_button_close", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookGUIButtonCloseProcedure.java" - ], - "dependencies": [ - { - "name": "entity", - "type": "entity" - } - ] - }, - "path": "~/Book GUI/Procedures" - }, - { - "name": "AddonBookRightClicked", - "type": "procedure", - "sortid": 4, - "compiles": true, - "locked_code": false, - "registry_name": "addon_book_right_clicked", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookRightClickedProcedure.java" - ], - "dependencies": [ - { - "name": "entity", - "type": "entity" - }, - { - "name": "x", - "type": "number" - }, - { - "name": "y", - "type": "number" - }, - { - "name": "z", - "type": "number" - }, - { - "name": "world", - "type": "world" - } - ] - }, - "path": "~/Book GUI/Procedures" - }, - { - "name": "DownloadedMod", - "type": "achievement", - "sortid": 21, - "compiles": true, - "locked_code": false, - "registry_name": "downloaded_mod", - "metadata": { - "files": [ - "src/main/resources/data/mcalecs_changed_addon/advancements/downloaded_mod.json" - ] - }, - "path": "~/Advancements" - }, - { - "name": "GiveInfoBook", - "type": "gamerule", - "compiles": true, - "locked_code": false, - "registry_name": "give_info_book", - "metadata": { - "files": [], - "type": "logic" - }, - "path": "~/Book GUI" - }, - { - "name": "AddonBookGUIPage1", - "type": "gui", - "sortid": 6, - "compiles": true, - "locked_code": false, - "registry_name": "addon_book_gui_page_1", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIPage1Screen.java", - "src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIPage1Menu.java", - "src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIPage1ButtonMessage.java" - ] - }, - "path": "~/Book GUI/GUIs" - }, - { - "name": "AddonBookGUIMain", - "type": "procedure", - "sortid": 10, - "compiles": true, - "locked_code": false, - "registry_name": "addon_book_gui_main", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookGUIMainProcedure.java" - ], - "dependencies": [ - { - "name": "entity", - "type": "entity" - }, - { - "name": "x", - "type": "number" - }, - { - "name": "y", - "type": "number" - }, - { - "name": "z", - "type": "number" - }, - { - "name": "world", - "type": "world" - } - ] - }, - "path": "~/Book GUI/Procedures" - }, - { - "name": "AddonBookGUIDevTest", - "type": "gui", - "sortid": 11, - "compiles": true, - "locked_code": false, - "registry_name": "addon_book_gui_dev_test", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIDevTestScreen.java", - "src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIDevTestMenu.java", - "src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIDevTestButtonMessage.java" - ] - }, - "path": "~/Book GUI/GUIs/GUIDevTest" - }, - { - "name": "GUIDevTestUntransfur", - "type": "procedure", - "sortid": 12, - "compiles": true, - "locked_code": false, - "registry_name": "gui_dev_test_untransfur", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/GUIDevTestUntransfurProcedure.java" - ], - "dependencies": [ - { - "name": "x", - "type": "number" - }, - { - "name": "y", - "type": "number" - }, - { - "name": "z", - "type": "number" - }, - { - "name": "world", - "type": "world" - } - ] - }, - "path": "~/Book GUI/Procedures/GUIDevTest" - }, - { - "name": "GUIDevTestTimeSet", - "type": "procedure", - "sortid": 13, - "compiles": true, - "locked_code": false, - "registry_name": "gui_dev_test_time_set", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/GUIDevTestTimeSetProcedure.java" - ], - "dependencies": [ - { - "name": "x", - "type": "number" - }, - { - "name": "y", - "type": "number" - }, - { - "name": "z", - "type": "number" - }, - { - "name": "world", - "type": "world" - } - ] - }, - "path": "~/Book GUI/Procedures/GUIDevTest" - }, - { - "name": "DevItem", - "type": "item", - "sortid": 14, - "compiles": true, - "locked_code": false, - "registry_name": "dev_item", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/item/DevItemItem.java", - "src/main/resources/assets/mcalecs_changed_addon/models/item/dev_item.json" - ] - }, - "path": "~/Items/DEV" - }, - { - "name": "TerminatedLab", - "type": "structure", - "compiles": true, - "locked_code": false, - "registry_name": "terminated_lab", - "metadata": { - "files": [ - "src/main/java/net/mcalecs/mcalecs_changed_addon/world/features/TerminatedLabFeature.java" - ] - }, - "path": "~/Structures" - }, - { - "name": "MadeBaseballBat", - "type": "achievement", - "sortid": 20, - "compiles": true, - "locked_code": false, - "registry_name": "made_baseball_bat", - "metadata": { - "files": [ - "src/main/resources/data/mcalecs_changed_addon/advancements/made_baseball_bat.json" - ] - }, - "path": "~/Advancements" - } - ], - "variable_elements": [], - "sound_elements": [], - "language_map": { - "en_us": { - "gui.mcalecs_changed_addon.addon_book_gui.button_search": "Go!", - "gui.mcalecs_changed_addon.addon_book_gui.tooltip_more_pages_will_be_added_on_late": "More pages will be added on later!", - "gui.mcalecs_changed_addon.addon_book_gui_page_1.button_back": "Back", - "item.mcalecs_changed.baseball_bat": "Baseball Bat", - "gamerule.giveInfoBook.description": "Gives McAlec\u0027s Changed Addon Book on the start of a new world or new player join", - "gui.mcalecs_changed_addon.addon_book_gui.button_close": "Close", - "gui.mcalecs_changed.addon_book_gui_dev_test.button_exit": "exit", - "gui.mcalecs_changed_addon.addon_book_gui_dev_test.button_untransfer": "untransfer", - "entity.mcalecs_changed_addon.dev_entity_test": "Dev Entity Test", - "gui.mcalecs_changed_addon.addon_book_gui.label_i": "i", - "item.mcalecs_changed.pride_balloon": "Pride Balloon", - "item.mcalecs_changed.addon_book": "McAlec\u0027s Changed Addon Book", - "gui.mcalecs_changed.addon_book_gui_dev_test.button_untransfer": "untransfer", - "gui.mcalecs_changed.addon_book_gui.button_close": "Close", - "gamerule.giveInfoBook": "MCA Info Book on Start", - "gui.mcalecs_changed_addon.addon_book_gui_page_1.button_next": "Next", - "gui.mcalecs_changed_addon.addon_book_gui_page_1.label_howd_you_get_here": "How\u0027d you get here?", - "gui.mcalecs_changed_addon.addon_book_gui.label_more_info_will_be_added_later": "More info will be added later.", - "advancements.made_baseball_bat.descr": "You made a baseball bat for those creatures...?", - "gui.mcalecs_changed_addon.addon_book_gui.secretpage": "", - "gui.mcalecs_changed.addon_book_gui_dev_test.label_mcalecs_dev_test_screen": "McAlec\u0027s Dev Test Screen", - "gui.mcalecs_changed.addon_book_gui.label_thank_you_for_downloading": "Thank you for downloading.", - "gui.mcalecs_changed_addon.addon_book_gui.tooltip_whats_this": "Whats this?", - "entity.mcalecs_changed.testing_mob": "Testing Mob", - "advancements.made_baseball_bat.title": "Swing at your desire.", - "item.mcalecs_changed_addon.dev_item": "Dev Item", - "gui.mcalecs_changed.addon_book_gui.label_hint_type_test_for_a_secret_s": "Hint: Type \"Test\" for a secret screen", - "gui.mcalecs_changed_addon.addon_book_gui_dev_test.button_time_set_day": "time set day", - "gui.mcalecs_changed.addon_book_gui.button_search": "Go!", - "gui.mcalecs_changed.addon_book_gui_page_1.button_back": "Back", - "advancements.downloaded_mod.title": "McAlec\u0027s Changed Addon", - "item.mcalecs_changed.dev_item": "Dev Item", - "item.mcalecs_changed.testing_mob_spawn_egg": "Testing Mob Spawn Egg", - "itemGroup.tabmcalecs_changed_tab": "McAlec\u0027s Changed Addon", - "gui.mcalecs_changed.addon_book_gui_dev_test.button_time_set_day": "time set day", - "gui.mcalecs_changed_addon.addon_book_gui.searchEngineTest": "Search", - "gui.mcalecs_changed_addon.addon_book_gui.label_mcalecs_changed_addon": "McAlec\u0027s Changed Addon", - "item.mcalecs_changed_addon.baseball_bat": "Baseball Bat", - "gui.mcalecs_changed_addon.addon_book_gui.label_thank_you_for_downloading": "Thank you for downloading.", - "gui.mcalecs_changed.addon_book_gui.label_mcalecs_changed_addon": "McAlec\u0027s Changed Addon", - "gui.mcalecs_changed_addon.addon_book_gui.secretPage": "", - "gui.mcalecs_changed_addon.addon_book_gui.label_hint_type_test_for_a_secret_s": "Hint: Type \"Test\" for a secret screen", - "gui.mcalecs_changed_addon.addon_book_gui_dev_test.label_mcalecs_dev_test_screen": "McAlec\u0027s Dev Test Screen", - "gui.mcalecs_changed_addon.addon_book_gui.button_next": "Next", - "gui.mcalecs_changed_addon.addon_book_gui_page_1.label_text_here": "text here", - "gui.mcalecs_changed.addon_book_gui.label_i": "i", - "advancements.downloaded_mod.descr": "You downloaded McAlec\u0027s Changed Addon (MCA) by McAlec!", - "gui.mcalecs_changed.addon_book_gui.button_next": "Next", - "item.mcalecs_changed_addon.addon_book": "McAlec\u0027s Changed Addon Book", - "gui.mcalecs_changed.addon_book_gui.searchEngineTest": "Search", - "gui.mcalecs_changed.addon_book_gui.tooltip_more_pages_will_be_added_on_late": "More pages will be added on later!", - "gui.mcalecs_changed_addon.addon_book_gui_dev_test.button_exit": "exit", - "gui.mcalecs_changed.addon_book_gui_page_1.label_howd_you_get_here": "How\u0027d you get here?", - "item.mcalecs_changed_addon.dev_entity_test_spawn_egg": "Dev Entity Test Spawn Egg" - } - }, - "foldersRoot": { - "name": "~", - "children": [ - { - "name": "Items", - "children": [ - { - "name": "DEV", - "children": [] - } - ] - }, - { - "name": "Tools", - "children": [ - { - "name": "LatexTools", - "children": [ - { - "name": "Wooden", - "children": [] - }, - { - "name": "Stone", - "children": [] - }, - { - "name": "Iron", - "children": [] - }, - { - "name": "Gold", - "children": [] - }, - { - "name": "Diamond", - "children": [] - }, - { - "name": "Netherrite", - "children": [] - } - ] - } - ] - }, - { - "name": "Book GUI", - "children": [ - { - "name": "Procedures", - "children": [ - { - "name": "GUIDevTest", - "children": [] - } - ] - }, - { - "name": "GUIs", - "children": [ - { - "name": "GUIDevTest", - "children": [] - } - ] - } - ] - }, - { - "name": "Entities", - "children": [] - }, - { - "name": "Advancements", - "children": [] - }, - { - "name": "Structures", - "children": [] - } - ] - }, - "workspaceSettings": { - "modid": "mcalecs_changed_addon", - "modName": "McAlec\u0027s Changed Addon", - "version": "0.2r", - "description": "Addon Mod to LtxProgrammer\u0027s Changed: MC Mod", - "author": "McAlec", - "websiteURL": "https://curseforge.com/minecraft/mc-mods/mcalecs-changed-addon", - "license": "MIT License", - "disableForgeVersionCheck": true, - "serverSideOnly": false, - "updateURL": "https://raw.githubusercontent.com/McAlec1/McAlecs-Changed-Addon/master/update.json", - "modPicture": "mca-logo", - "requiredMods": [ - "changed" - ], - "dependencies": [], - "dependants": [], - "mcreatorDependencies": [], - "currentGenerator": "forge-1.18.2", - "credits": "McAlec", - "modElementsPackage": "net.mcalecs.mcalecs_changed_addon", - "lockBaseModFiles": false - }, - "mcreatorVersion": 202300336712 -} \ No newline at end of file diff --git a/mcreator.gradle b/mcreator.gradle deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/McalecsChangedAddonMod.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/McalecsChangedAddonMod.java deleted file mode 100644 index 9b15f98..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/McalecsChangedAddonMod.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * MCreator note: - * - * If you lock base mod element files, you can edit this file and it won't get overwritten. - * If you change your modid or package, you need to apply these changes to this file MANUALLY. - * - * Settings in @Mod annotation WON'T be changed in case of the base mod element - * files lock too, so you need to set them manually here in such case. - * - * If you do not lock base mod element files in Workspace settings, this file - * will be REGENERATED on each build. - * - */ -package net.mcalecs.mcalecs_changed_addon; - -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.LogManager; - -import net.minecraftforge.network.simple.SimpleChannel; -import net.minecraftforge.network.NetworkRegistry; -import net.minecraftforge.network.NetworkEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.eventbus.api.IEventBus; - -import net.minecraft.resources.ResourceLocation; -import net.minecraft.network.FriendlyByteBuf; - -import net.mcalecs.mcalecs_changed_addon.init.McalecsChangedAddonModTabs; -import net.mcalecs.mcalecs_changed_addon.init.McalecsChangedAddonModItems; -import net.mcalecs.mcalecs_changed_addon.init.McalecsChangedAddonModFeatures; - -import java.util.function.Supplier; -import java.util.function.Function; -import java.util.function.BiConsumer; - -@Mod("mcalecs_changed_addon") -public class McalecsChangedAddonMod { - public static final Logger LOGGER = LogManager.getLogger(McalecsChangedAddonMod.class); - public static final String MODID = "mcalecs_changed_addon"; - private static final String PROTOCOL_VERSION = "1"; - public static final SimpleChannel PACKET_HANDLER = NetworkRegistry.newSimpleChannel(new ResourceLocation(MODID, MODID), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals); - private static int messageID = 0; - - public McalecsChangedAddonMod() { - McalecsChangedAddonModTabs.load(); - IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); - - McalecsChangedAddonModItems.REGISTRY.register(bus); - - McalecsChangedAddonModFeatures.REGISTRY.register(bus); - - } - - public static void addNetworkMessage(Class messageType, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { - PACKET_HANDLER.registerMessage(messageID, messageType, encoder, decoder, messageConsumer); - messageID++; - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIDevTestScreen.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIDevTestScreen.java deleted file mode 100644 index e2310b1..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIDevTestScreen.java +++ /dev/null @@ -1,116 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.client.gui; - -import net.minecraft.world.level.Level; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.network.chat.TranslatableComponent; -import net.minecraft.network.chat.Component; -import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; -import net.minecraft.client.gui.components.Button; -import net.minecraft.client.Minecraft; - -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIDevTestMenu; -import net.mcalecs.mcalecs_changed_addon.network.AddonBookGUIDevTestButtonMessage; -import net.mcalecs.mcalecs_changed_addon.McalecsChangedAddonMod; - -import java.util.HashMap; - -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.systems.RenderSystem; - -public class AddonBookGUIDevTestScreen extends AbstractContainerScreen { - private final static HashMap guistate = AddonBookGUIDevTestMenu.guistate; - private final Level world; - private final int x, y, z; - private final Player entity; - Button button_untransfer; - Button button_exit; - Button button_time_set_day; - - public AddonBookGUIDevTestScreen(AddonBookGUIDevTestMenu container, Inventory inventory, Component text) { - super(container, inventory, text); - this.world = container.world; - this.x = container.x; - this.y = container.y; - this.z = container.z; - this.entity = container.entity; - this.imageWidth = 176; - this.imageHeight = 166; - } - - private static final ResourceLocation texture = new ResourceLocation("mcalecs_changed_addon:textures/screens/addon_book_gui_dev_test.png"); - - @Override - public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) { - this.renderBackground(ms); - super.render(ms, mouseX, mouseY, partialTicks); - this.renderTooltip(ms, mouseX, mouseY); - } - - @Override - protected void renderBg(PoseStack ms, float partialTicks, int gx, int gy) { - RenderSystem.setShaderColor(1, 1, 1, 1); - RenderSystem.enableBlend(); - RenderSystem.defaultBlendFunc(); - RenderSystem.setShaderTexture(0, texture); - this.blit(ms, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight, this.imageWidth, this.imageHeight); - RenderSystem.disableBlend(); - } - - @Override - public boolean keyPressed(int key, int b, int c) { - if (key == 256) { - this.minecraft.player.closeContainer(); - return true; - } - return super.keyPressed(key, b, c); - } - - @Override - public void containerTick() { - super.containerTick(); - } - - @Override - protected void renderLabels(PoseStack poseStack, int mouseX, int mouseY) { - this.font.draw(poseStack, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui_dev_test.label_mcalecs_dev_test_screen"), 26, 14, -16777216); - } - - @Override - public void onClose() { - super.onClose(); - Minecraft.getInstance().keyboardHandler.setSendRepeatsToGui(false); - } - - @Override - public void init() { - super.init(); - this.minecraft.keyboardHandler.setSendRepeatsToGui(true); - button_untransfer = new Button(this.leftPos + 5, this.topPos + 138, 77, 20, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui_dev_test.button_untransfer"), e -> { - if (true) { - McalecsChangedAddonMod.PACKET_HANDLER.sendToServer(new AddonBookGUIDevTestButtonMessage(0, x, y, z)); - AddonBookGUIDevTestButtonMessage.handleButtonAction(entity, 0, x, y, z); - } - }); - guistate.put("button:button_untransfer", button_untransfer); - this.addRenderableWidget(button_untransfer); - button_exit = new Button(this.leftPos + 4, this.topPos + 169, 46, 20, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui_dev_test.button_exit"), e -> { - if (true) { - McalecsChangedAddonMod.PACKET_HANDLER.sendToServer(new AddonBookGUIDevTestButtonMessage(1, x, y, z)); - AddonBookGUIDevTestButtonMessage.handleButtonAction(entity, 1, x, y, z); - } - }); - guistate.put("button:button_exit", button_exit); - this.addRenderableWidget(button_exit); - button_time_set_day = new Button(this.leftPos + 82, this.topPos + 138, 87, 20, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui_dev_test.button_time_set_day"), e -> { - if (true) { - McalecsChangedAddonMod.PACKET_HANDLER.sendToServer(new AddonBookGUIDevTestButtonMessage(2, x, y, z)); - AddonBookGUIDevTestButtonMessage.handleButtonAction(entity, 2, x, y, z); - } - }); - guistate.put("button:button_time_set_day", button_time_set_day); - this.addRenderableWidget(button_time_set_day); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIPage1Screen.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIPage1Screen.java deleted file mode 100644 index 4de6918..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIPage1Screen.java +++ /dev/null @@ -1,98 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.client.gui; - -import net.minecraft.world.level.Level; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.network.chat.TranslatableComponent; -import net.minecraft.network.chat.Component; -import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; -import net.minecraft.client.gui.components.Button; -import net.minecraft.client.Minecraft; - -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIPage1Menu; -import net.mcalecs.mcalecs_changed_addon.network.AddonBookGUIPage1ButtonMessage; -import net.mcalecs.mcalecs_changed_addon.McalecsChangedAddonMod; - -import java.util.HashMap; - -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.systems.RenderSystem; - -public class AddonBookGUIPage1Screen extends AbstractContainerScreen { - private final static HashMap guistate = AddonBookGUIPage1Menu.guistate; - private final Level world; - private final int x, y, z; - private final Player entity; - Button button_back; - - public AddonBookGUIPage1Screen(AddonBookGUIPage1Menu container, Inventory inventory, Component text) { - super(container, inventory, text); - this.world = container.world; - this.x = container.x; - this.y = container.y; - this.z = container.z; - this.entity = container.entity; - this.imageWidth = 176; - this.imageHeight = 166; - } - - private static final ResourceLocation texture = new ResourceLocation("mcalecs_changed_addon:textures/screens/addon_book_gui_page_1.png"); - - @Override - public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) { - this.renderBackground(ms); - super.render(ms, mouseX, mouseY, partialTicks); - this.renderTooltip(ms, mouseX, mouseY); - } - - @Override - protected void renderBg(PoseStack ms, float partialTicks, int gx, int gy) { - RenderSystem.setShaderColor(1, 1, 1, 1); - RenderSystem.enableBlend(); - RenderSystem.defaultBlendFunc(); - RenderSystem.setShaderTexture(0, texture); - this.blit(ms, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight, this.imageWidth, this.imageHeight); - RenderSystem.disableBlend(); - } - - @Override - public boolean keyPressed(int key, int b, int c) { - if (key == 256) { - this.minecraft.player.closeContainer(); - return true; - } - return super.keyPressed(key, b, c); - } - - @Override - public void containerTick() { - super.containerTick(); - } - - @Override - protected void renderLabels(PoseStack poseStack, int mouseX, int mouseY) { - this.font.draw(poseStack, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui_page_1.label_howd_you_get_here"), 39, 68, -12829636); - } - - @Override - public void onClose() { - super.onClose(); - Minecraft.getInstance().keyboardHandler.setSendRepeatsToGui(false); - } - - @Override - public void init() { - super.init(); - this.minecraft.keyboardHandler.setSendRepeatsToGui(true); - button_back = new Button(this.leftPos + 9, this.topPos + 138, 46, 20, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui_page_1.button_back"), e -> { - if (true) { - McalecsChangedAddonMod.PACKET_HANDLER.sendToServer(new AddonBookGUIPage1ButtonMessage(0, x, y, z)); - AddonBookGUIPage1ButtonMessage.handleButtonAction(entity, 0, x, y, z); - } - }); - guistate.put("button:button_back", button_back); - this.addRenderableWidget(button_back); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIScreen.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIScreen.java deleted file mode 100644 index 5b0bf54..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/client/gui/AddonBookGUIScreen.java +++ /dev/null @@ -1,105 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.client.gui; - -import net.minecraft.world.level.Level; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.network.chat.TranslatableComponent; -import net.minecraft.network.chat.Component; -import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; -import net.minecraft.client.gui.components.Button; -import net.minecraft.client.Minecraft; - -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIMenu; -import net.mcalecs.mcalecs_changed_addon.network.AddonBookGUIButtonMessage; -import net.mcalecs.mcalecs_changed_addon.McalecsChangedAddonMod; - -import java.util.HashMap; - -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.systems.RenderSystem; - -public class AddonBookGUIScreen extends AbstractContainerScreen { - private final static HashMap guistate = AddonBookGUIMenu.guistate; - private final Level world; - private final int x, y, z; - private final Player entity; - Button button_close; - Button button_next; - - public AddonBookGUIScreen(AddonBookGUIMenu container, Inventory inventory, Component text) { - super(container, inventory, text); - this.world = container.world; - this.x = container.x; - this.y = container.y; - this.z = container.z; - this.entity = container.entity; - this.imageWidth = 208; - this.imageHeight = 166; - } - - private static final ResourceLocation texture = new ResourceLocation("mcalecs_changed_addon:textures/screens/addon_book_gui.png"); - - @Override - public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) { - this.renderBackground(ms); - super.render(ms, mouseX, mouseY, partialTicks); - this.renderTooltip(ms, mouseX, mouseY); - } - - @Override - protected void renderBg(PoseStack ms, float partialTicks, int gx, int gy) { - RenderSystem.setShaderColor(1, 1, 1, 1); - RenderSystem.enableBlend(); - RenderSystem.defaultBlendFunc(); - RenderSystem.setShaderTexture(0, texture); - this.blit(ms, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight, this.imageWidth, this.imageHeight); - RenderSystem.disableBlend(); - } - - @Override - public boolean keyPressed(int key, int b, int c) { - if (key == 256) { - this.minecraft.player.closeContainer(); - return true; - } - return super.keyPressed(key, b, c); - } - - @Override - public void containerTick() { - super.containerTick(); - } - - @Override - protected void renderLabels(PoseStack poseStack, int mouseX, int mouseY) { - this.font.draw(poseStack, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui.label_mcalecs_changed_addon"), 45, 28, -14145496); - this.font.draw(poseStack, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui.label_thank_you_for_downloading"), 35, 98, -10066330); - this.font.draw(poseStack, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui.label_i"), 105, 138, -12829636); - } - - @Override - public void onClose() { - super.onClose(); - Minecraft.getInstance().keyboardHandler.setSendRepeatsToGui(false); - } - - @Override - public void init() { - super.init(); - this.minecraft.keyboardHandler.setSendRepeatsToGui(true); - button_close = new Button(this.leftPos + 15, this.topPos + 138, 51, 20, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui.button_close"), e -> { - if (true) { - McalecsChangedAddonMod.PACKET_HANDLER.sendToServer(new AddonBookGUIButtonMessage(0, x, y, z)); - AddonBookGUIButtonMessage.handleButtonAction(entity, 0, x, y, z); - } - }); - guistate.put("button:button_close", button_close); - this.addRenderableWidget(button_close); - button_next = new Button(this.leftPos + 145, this.topPos + 138, 46, 20, new TranslatableComponent("gui.mcalecs_changed_addon.addon_book_gui.button_next"), e -> { - }); - guistate.put("button:button_next", button_next); - this.addRenderableWidget(button_next); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModFeatures.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModFeatures.java deleted file mode 100644 index a91c340..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModFeatures.java +++ /dev/null @@ -1,50 +0,0 @@ - -/* - * MCreator note: This file will be REGENERATED on each build. - */ -package net.mcalecs.mcalecs_changed_addon.init; - -import net.minecraftforge.registries.RegistryObject; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.event.world.BiomeLoadingEvent; - -import net.minecraft.world.level.levelgen.placement.PlacedFeature; -import net.minecraft.world.level.levelgen.feature.Feature; -import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.core.Holder; - -import net.mcalecs.mcalecs_changed_addon.world.features.TerminatedLabFeature; -import net.mcalecs.mcalecs_changed_addon.McalecsChangedAddonMod; - -import java.util.function.Supplier; -import java.util.Set; -import java.util.List; -import java.util.ArrayList; - -@Mod.EventBusSubscriber -public class McalecsChangedAddonModFeatures { - public static final DeferredRegister> REGISTRY = DeferredRegister.create(ForgeRegistries.FEATURES, McalecsChangedAddonMod.MODID); - private static final List FEATURE_REGISTRATIONS = new ArrayList<>(); - public static final RegistryObject> TERMINATED_LAB = register("terminated_lab", TerminatedLabFeature::feature, - new FeatureRegistration(GenerationStep.Decoration.SURFACE_STRUCTURES, TerminatedLabFeature.GENERATE_BIOMES, TerminatedLabFeature::placedFeature)); - - private static RegistryObject> register(String registryname, Supplier> feature, FeatureRegistration featureRegistration) { - FEATURE_REGISTRATIONS.add(featureRegistration); - return REGISTRY.register(registryname, feature); - } - - @SubscribeEvent - public static void addFeaturesToBiomes(BiomeLoadingEvent event) { - for (FeatureRegistration registration : FEATURE_REGISTRATIONS) { - if (registration.biomes() == null || registration.biomes().contains(event.getName())) - event.getGeneration().getFeatures(registration.stage()).add(registration.placedFeature().get()); - } - } - - private static record FeatureRegistration(GenerationStep.Decoration stage, Set biomes, Supplier> placedFeature) { - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModGameRules.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModGameRules.java deleted file mode 100644 index 48c1281..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModGameRules.java +++ /dev/null @@ -1,14 +0,0 @@ - -/* - * MCreator note: This file will be REGENERATED on each build. - */ -package net.mcalecs.mcalecs_changed_addon.init; - -import net.minecraftforge.fml.common.Mod; - -import net.minecraft.world.level.GameRules; - -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) -public class McalecsChangedAddonModGameRules { - public static final GameRules.Key GIVE_INFO_BOOK = GameRules.register("giveInfoBook", GameRules.Category.PLAYER, GameRules.BooleanValue.create(false)); -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModItems.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModItems.java deleted file mode 100644 index 947efcc..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModItems.java +++ /dev/null @@ -1,23 +0,0 @@ - -/* - * MCreator note: This file will be REGENERATED on each build. - */ -package net.mcalecs.mcalecs_changed_addon.init; - -import net.minecraftforge.registries.RegistryObject; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.DeferredRegister; - -import net.minecraft.world.item.Item; - -import net.mcalecs.mcalecs_changed_addon.item.DevItemItem; -import net.mcalecs.mcalecs_changed_addon.item.BaseballBatToolItem; -import net.mcalecs.mcalecs_changed_addon.item.AddonBookItem; -import net.mcalecs.mcalecs_changed_addon.McalecsChangedAddonMod; - -public class McalecsChangedAddonModItems { - public static final DeferredRegister REGISTRY = DeferredRegister.create(ForgeRegistries.ITEMS, McalecsChangedAddonMod.MODID); - public static final RegistryObject BASEBALL_BAT = REGISTRY.register("baseball_bat", () -> new BaseballBatToolItem()); - public static final RegistryObject ADDON_BOOK = REGISTRY.register("addon_book", () -> new AddonBookItem()); - public static final RegistryObject DEV_ITEM = REGISTRY.register("dev_item", () -> new DevItemItem()); -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModMenus.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModMenus.java deleted file mode 100644 index 3439356..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModMenus.java +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * MCreator note: This file will be REGENERATED on each build. - */ -package net.mcalecs.mcalecs_changed_addon.init; - -import net.minecraftforge.network.IContainerFactory; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.event.RegistryEvent; - -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.inventory.AbstractContainerMenu; - -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIPage1Menu; -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIMenu; -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIDevTestMenu; - -import java.util.List; -import java.util.ArrayList; - -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) -public class McalecsChangedAddonModMenus { - private static final List> REGISTRY = new ArrayList<>(); - public static final MenuType ADDON_BOOK_GUI_PAGE_1 = register("addon_book_gui_page_1", (id, inv, extraData) -> new AddonBookGUIPage1Menu(id, inv, extraData)); - public static final MenuType ADDON_BOOK_GUI = register("addon_book_gui", (id, inv, extraData) -> new AddonBookGUIMenu(id, inv, extraData)); - public static final MenuType ADDON_BOOK_GUI_DEV_TEST = register("addon_book_gui_dev_test", (id, inv, extraData) -> new AddonBookGUIDevTestMenu(id, inv, extraData)); - - private static MenuType register(String registryname, IContainerFactory containerFactory) { - MenuType menuType = new MenuType(containerFactory); - menuType.setRegistryName(registryname); - REGISTRY.add(menuType); - return menuType; - } - - @SubscribeEvent - public static void registerContainers(RegistryEvent.Register> event) { - event.getRegistry().registerAll(REGISTRY.toArray(new MenuType[0])); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModScreens.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModScreens.java deleted file mode 100644 index c25ea7a..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModScreens.java +++ /dev/null @@ -1,28 +0,0 @@ - -/* - * MCreator note: This file will be REGENERATED on each build. - */ -package net.mcalecs.mcalecs_changed_addon.init; - -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.api.distmarker.Dist; - -import net.minecraft.client.gui.screens.MenuScreens; - -import net.mcalecs.mcalecs_changed_addon.client.gui.AddonBookGUIScreen; -import net.mcalecs.mcalecs_changed_addon.client.gui.AddonBookGUIPage1Screen; -import net.mcalecs.mcalecs_changed_addon.client.gui.AddonBookGUIDevTestScreen; - -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) -public class McalecsChangedAddonModScreens { - @SubscribeEvent - public static void clientLoad(FMLClientSetupEvent event) { - event.enqueueWork(() -> { - MenuScreens.register(McalecsChangedAddonModMenus.ADDON_BOOK_GUI_PAGE_1, AddonBookGUIPage1Screen::new); - MenuScreens.register(McalecsChangedAddonModMenus.ADDON_BOOK_GUI, AddonBookGUIScreen::new); - MenuScreens.register(McalecsChangedAddonModMenus.ADDON_BOOK_GUI_DEV_TEST, AddonBookGUIDevTestScreen::new); - }); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModTabs.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModTabs.java deleted file mode 100644 index 392b6b9..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/init/McalecsChangedAddonModTabs.java +++ /dev/null @@ -1,29 +0,0 @@ - -/* - * MCreator note: This file will be REGENERATED on each build. - */ -package net.mcalecs.mcalecs_changed_addon.init; - -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.api.distmarker.Dist; - -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.CreativeModeTab; - -public class McalecsChangedAddonModTabs { - public static CreativeModeTab TAB_MCALECS_CHANGED_TAB; - - public static void load() { - TAB_MCALECS_CHANGED_TAB = new CreativeModeTab("tabmcalecs_changed_tab") { - @Override - public ItemStack makeIcon() { - return new ItemStack(McalecsChangedAddonModItems.DEV_ITEM.get()); - } - - @OnlyIn(Dist.CLIENT) - public boolean hasSearchBar() { - return false; - } - }; - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/item/AddonBookItem.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/item/AddonBookItem.java deleted file mode 100644 index e51052e..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/item/AddonBookItem.java +++ /dev/null @@ -1,31 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.item; - -import net.minecraft.world.level.Level; -import net.minecraft.world.item.Rarity; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Item; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.InteractionResultHolder; -import net.minecraft.world.InteractionHand; - -import net.mcalecs.mcalecs_changed_addon.procedures.AddonBookRightClickedProcedure; -import net.mcalecs.mcalecs_changed_addon.init.McalecsChangedAddonModTabs; - -public class AddonBookItem extends Item { - public AddonBookItem() { - super(new Item.Properties().tab(McalecsChangedAddonModTabs.TAB_MCALECS_CHANGED_TAB).stacksTo(1).rarity(Rarity.RARE)); - } - - @Override - public InteractionResultHolder use(Level world, Player entity, InteractionHand hand) { - InteractionResultHolder ar = super.use(world, entity, hand); - ItemStack itemstack = ar.getObject(); - double x = entity.getX(); - double y = entity.getY(); - double z = entity.getZ(); - - AddonBookRightClickedProcedure.execute(world, x, y, z, entity); - return ar; - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/item/BaseballBatToolItem.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/item/BaseballBatToolItem.java deleted file mode 100644 index f06a8e7..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/item/BaseballBatToolItem.java +++ /dev/null @@ -1,39 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.item; - -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.Tier; -import net.minecraft.world.item.SwordItem; -import net.minecraft.world.item.Item; - -import net.mcalecs.mcalecs_changed_addon.init.McalecsChangedAddonModTabs; - -public class BaseballBatToolItem extends SwordItem { - public BaseballBatToolItem() { - super(new Tier() { - public int getUses() { - return 100; - } - - public float getSpeed() { - return 2f; - } - - public float getAttackDamageBonus() { - return 0f; - } - - public int getLevel() { - return 0; - } - - public int getEnchantmentValue() { - return 2; - } - - public Ingredient getRepairIngredient() { - return Ingredient.of(); - } - }, 3, -2.4f, new Item.Properties().tab(McalecsChangedAddonModTabs.TAB_MCALECS_CHANGED_TAB)); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/item/DevItemItem.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/item/DevItemItem.java deleted file mode 100644 index bb4021d..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/item/DevItemItem.java +++ /dev/null @@ -1,21 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.item; - -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.api.distmarker.Dist; - -import net.minecraft.world.item.Rarity; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Item; - -public class DevItemItem extends Item { - public DevItemItem() { - super(new Item.Properties().tab(null).stacksTo(1).rarity(Rarity.EPIC)); - } - - @Override - @OnlyIn(Dist.CLIENT) - public boolean isFoil(ItemStack itemstack) { - return true; - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIButtonMessage.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIButtonMessage.java deleted file mode 100644 index 2358832..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIButtonMessage.java +++ /dev/null @@ -1,75 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.network; - -import net.minecraftforge.network.NetworkEvent; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.eventbus.api.SubscribeEvent; - -import net.minecraft.world.level.Level; -import net.minecraft.world.entity.player.Player; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.core.BlockPos; - -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIMenu; -import net.mcalecs.mcalecs_changed_addon.procedures.AddonBookGUIButtonCloseProcedure; -import net.mcalecs.mcalecs_changed_addon.McalecsChangedAddonMod; - -import java.util.function.Supplier; -import java.util.HashMap; - -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) -public class AddonBookGUIButtonMessage { - private final int buttonID, x, y, z; - - public AddonBookGUIButtonMessage(FriendlyByteBuf buffer) { - this.buttonID = buffer.readInt(); - this.x = buffer.readInt(); - this.y = buffer.readInt(); - this.z = buffer.readInt(); - } - - public AddonBookGUIButtonMessage(int buttonID, int x, int y, int z) { - this.buttonID = buttonID; - this.x = x; - this.y = y; - this.z = z; - } - - public static void buffer(AddonBookGUIButtonMessage message, FriendlyByteBuf buffer) { - buffer.writeInt(message.buttonID); - buffer.writeInt(message.x); - buffer.writeInt(message.y); - buffer.writeInt(message.z); - } - - public static void handler(AddonBookGUIButtonMessage message, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(() -> { - Player entity = context.getSender(); - int buttonID = message.buttonID; - int x = message.x; - int y = message.y; - int z = message.z; - handleButtonAction(entity, buttonID, x, y, z); - }); - context.setPacketHandled(true); - } - - public static void handleButtonAction(Player entity, int buttonID, int x, int y, int z) { - Level world = entity.level; - HashMap guistate = AddonBookGUIMenu.guistate; - // security measure to prevent arbitrary chunk generation - if (!world.hasChunkAt(new BlockPos(x, y, z))) - return; - if (buttonID == 0) { - - AddonBookGUIButtonCloseProcedure.execute(entity); - } - } - - @SubscribeEvent - public static void registerMessage(FMLCommonSetupEvent event) { - McalecsChangedAddonMod.addNetworkMessage(AddonBookGUIButtonMessage.class, AddonBookGUIButtonMessage::buffer, AddonBookGUIButtonMessage::new, AddonBookGUIButtonMessage::handler); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIDevTestButtonMessage.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIDevTestButtonMessage.java deleted file mode 100644 index 3c3f584..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIDevTestButtonMessage.java +++ /dev/null @@ -1,85 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.network; - -import net.minecraftforge.network.NetworkEvent; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.eventbus.api.SubscribeEvent; - -import net.minecraft.world.level.Level; -import net.minecraft.world.entity.player.Player; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.core.BlockPos; - -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIDevTestMenu; -import net.mcalecs.mcalecs_changed_addon.procedures.GUIDevTestUntransfurProcedure; -import net.mcalecs.mcalecs_changed_addon.procedures.GUIDevTestTimeSetProcedure; -import net.mcalecs.mcalecs_changed_addon.procedures.AddonBookGUIButtonCloseProcedure; -import net.mcalecs.mcalecs_changed_addon.McalecsChangedAddonMod; - -import java.util.function.Supplier; -import java.util.HashMap; - -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) -public class AddonBookGUIDevTestButtonMessage { - private final int buttonID, x, y, z; - - public AddonBookGUIDevTestButtonMessage(FriendlyByteBuf buffer) { - this.buttonID = buffer.readInt(); - this.x = buffer.readInt(); - this.y = buffer.readInt(); - this.z = buffer.readInt(); - } - - public AddonBookGUIDevTestButtonMessage(int buttonID, int x, int y, int z) { - this.buttonID = buttonID; - this.x = x; - this.y = y; - this.z = z; - } - - public static void buffer(AddonBookGUIDevTestButtonMessage message, FriendlyByteBuf buffer) { - buffer.writeInt(message.buttonID); - buffer.writeInt(message.x); - buffer.writeInt(message.y); - buffer.writeInt(message.z); - } - - public static void handler(AddonBookGUIDevTestButtonMessage message, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(() -> { - Player entity = context.getSender(); - int buttonID = message.buttonID; - int x = message.x; - int y = message.y; - int z = message.z; - handleButtonAction(entity, buttonID, x, y, z); - }); - context.setPacketHandled(true); - } - - public static void handleButtonAction(Player entity, int buttonID, int x, int y, int z) { - Level world = entity.level; - HashMap guistate = AddonBookGUIDevTestMenu.guistate; - // security measure to prevent arbitrary chunk generation - if (!world.hasChunkAt(new BlockPos(x, y, z))) - return; - if (buttonID == 0) { - - GUIDevTestUntransfurProcedure.execute(world, x, y, z); - } - if (buttonID == 1) { - - AddonBookGUIButtonCloseProcedure.execute(entity); - } - if (buttonID == 2) { - - GUIDevTestTimeSetProcedure.execute(world, x, y, z); - } - } - - @SubscribeEvent - public static void registerMessage(FMLCommonSetupEvent event) { - McalecsChangedAddonMod.addNetworkMessage(AddonBookGUIDevTestButtonMessage.class, AddonBookGUIDevTestButtonMessage::buffer, AddonBookGUIDevTestButtonMessage::new, AddonBookGUIDevTestButtonMessage::handler); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIPage1ButtonMessage.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIPage1ButtonMessage.java deleted file mode 100644 index 4e0424b..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/network/AddonBookGUIPage1ButtonMessage.java +++ /dev/null @@ -1,75 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.network; - -import net.minecraftforge.network.NetworkEvent; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.eventbus.api.SubscribeEvent; - -import net.minecraft.world.level.Level; -import net.minecraft.world.entity.player.Player; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.core.BlockPos; - -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIPage1Menu; -import net.mcalecs.mcalecs_changed_addon.procedures.AddonBookGUIMainProcedure; -import net.mcalecs.mcalecs_changed_addon.McalecsChangedAddonMod; - -import java.util.function.Supplier; -import java.util.HashMap; - -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) -public class AddonBookGUIPage1ButtonMessage { - private final int buttonID, x, y, z; - - public AddonBookGUIPage1ButtonMessage(FriendlyByteBuf buffer) { - this.buttonID = buffer.readInt(); - this.x = buffer.readInt(); - this.y = buffer.readInt(); - this.z = buffer.readInt(); - } - - public AddonBookGUIPage1ButtonMessage(int buttonID, int x, int y, int z) { - this.buttonID = buttonID; - this.x = x; - this.y = y; - this.z = z; - } - - public static void buffer(AddonBookGUIPage1ButtonMessage message, FriendlyByteBuf buffer) { - buffer.writeInt(message.buttonID); - buffer.writeInt(message.x); - buffer.writeInt(message.y); - buffer.writeInt(message.z); - } - - public static void handler(AddonBookGUIPage1ButtonMessage message, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(() -> { - Player entity = context.getSender(); - int buttonID = message.buttonID; - int x = message.x; - int y = message.y; - int z = message.z; - handleButtonAction(entity, buttonID, x, y, z); - }); - context.setPacketHandled(true); - } - - public static void handleButtonAction(Player entity, int buttonID, int x, int y, int z) { - Level world = entity.level; - HashMap guistate = AddonBookGUIPage1Menu.guistate; - // security measure to prevent arbitrary chunk generation - if (!world.hasChunkAt(new BlockPos(x, y, z))) - return; - if (buttonID == 0) { - - AddonBookGUIMainProcedure.execute(world, x, y, z, entity); - } - } - - @SubscribeEvent - public static void registerMessage(FMLCommonSetupEvent event) { - McalecsChangedAddonMod.addNetworkMessage(AddonBookGUIPage1ButtonMessage.class, AddonBookGUIPage1ButtonMessage::buffer, AddonBookGUIPage1ButtonMessage::new, AddonBookGUIPage1ButtonMessage::handler); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookGUIButtonCloseProcedure.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookGUIButtonCloseProcedure.java deleted file mode 100644 index a2295cc..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookGUIButtonCloseProcedure.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.mcalecs.mcalecs_changed_addon.procedures; - -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.Entity; - -public class AddonBookGUIButtonCloseProcedure { - public static void execute(Entity entity) { - if (entity == null) - return; - if (entity instanceof Player _player) - _player.closeContainer(); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookGUIMainProcedure.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookGUIMainProcedure.java deleted file mode 100644 index 3156416..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookGUIMainProcedure.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.mcalecs.mcalecs_changed_addon.procedures; - -import net.minecraftforge.network.NetworkHooks; - -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.MenuProvider; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.network.chat.TextComponent; -import net.minecraft.network.chat.Component; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.core.BlockPos; - -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIMenu; - -import io.netty.buffer.Unpooled; - -public class AddonBookGUIMainProcedure { - public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) { - if (entity == null) - return; - { - if (entity instanceof ServerPlayer _ent) { - BlockPos _bpos = new BlockPos(x, y, z); - NetworkHooks.openGui((ServerPlayer) _ent, new MenuProvider() { - @Override - public Component getDisplayName() { - return new TextComponent("AddonBookGUI"); - } - - @Override - public AbstractContainerMenu createMenu(int id, Inventory inventory, Player player) { - return new AddonBookGUIMenu(id, inventory, new FriendlyByteBuf(Unpooled.buffer()).writeBlockPos(_bpos)); - } - }, _bpos); - } - } - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookRightClickedProcedure.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookRightClickedProcedure.java deleted file mode 100644 index a09a89a..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/AddonBookRightClickedProcedure.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.mcalecs.mcalecs_changed_addon.procedures; - -import net.minecraftforge.network.NetworkHooks; - -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.MenuProvider; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.network.chat.TextComponent; -import net.minecraft.network.chat.Component; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.core.BlockPos; - -import net.mcalecs.mcalecs_changed_addon.world.inventory.AddonBookGUIMenu; - -import io.netty.buffer.Unpooled; - -public class AddonBookRightClickedProcedure { - public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) { - if (entity == null) - return; - { - if (entity instanceof ServerPlayer _ent) { - BlockPos _bpos = new BlockPos(x, y, z); - NetworkHooks.openGui((ServerPlayer) _ent, new MenuProvider() { - @Override - public Component getDisplayName() { - return new TextComponent("AddonBookGUI"); - } - - @Override - public AbstractContainerMenu createMenu(int id, Inventory inventory, Player player) { - return new AddonBookGUIMenu(id, inventory, new FriendlyByteBuf(Unpooled.buffer()).writeBlockPos(_bpos)); - } - }, _bpos); - } - } - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/GUIDevTestTimeSetProcedure.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/GUIDevTestTimeSetProcedure.java deleted file mode 100644 index 289a184..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/GUIDevTestTimeSetProcedure.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.mcalecs.mcalecs_changed_addon.procedures; - -import net.minecraft.world.phys.Vec3; -import net.minecraft.world.phys.Vec2; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.network.chat.TextComponent; -import net.minecraft.commands.CommandSourceStack; -import net.minecraft.commands.CommandSource; - -public class GUIDevTestTimeSetProcedure { - public static void execute(LevelAccessor world, double x, double y, double z) { - if (world instanceof ServerLevel _level) - _level.getServer().getCommands().performCommand(new CommandSourceStack(CommandSource.NULL, new Vec3(x, y, z), Vec2.ZERO, _level, 4, "", new TextComponent(""), _level.getServer(), null).withSuppressedOutput(), "time set day"); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/GUIDevTestUntransfurProcedure.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/GUIDevTestUntransfurProcedure.java deleted file mode 100644 index c3b25b6..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/procedures/GUIDevTestUntransfurProcedure.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.mcalecs.mcalecs_changed_addon.procedures; - -import net.minecraft.world.phys.Vec3; -import net.minecraft.world.phys.Vec2; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.network.chat.TextComponent; -import net.minecraft.commands.CommandSourceStack; -import net.minecraft.commands.CommandSource; - -public class GUIDevTestUntransfurProcedure { - public static void execute(LevelAccessor world, double x, double y, double z) { - if (world instanceof ServerLevel _level) - _level.getServer().getCommands().performCommand(new CommandSourceStack(CommandSource.NULL, new Vec3(x, y, z), Vec2.ZERO, _level, 4, "", new TextComponent(""), _level.getServer(), null).withSuppressedOutput(), "untransfur @s"); - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/world/features/TerminatedLabFeature.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/world/features/TerminatedLabFeature.java deleted file mode 100644 index c1080be..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/world/features/TerminatedLabFeature.java +++ /dev/null @@ -1,81 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.world.features; - -import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; -import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings; -import net.minecraft.world.level.levelgen.structure.templatesystem.BlockIgnoreProcessor; -import net.minecraft.world.level.levelgen.placement.PlacedFeature; -import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; -import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; -import net.minecraft.world.level.levelgen.feature.Feature; -import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; -import net.minecraft.world.level.levelgen.Heightmap; -import net.minecraft.world.level.block.Rotation; -import net.minecraft.world.level.block.Mirror; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.Level; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.resources.ResourceKey; -import net.minecraft.data.worldgen.placement.PlacementUtils; -import net.minecraft.data.worldgen.features.FeatureUtils; -import net.minecraft.core.Holder; -import net.minecraft.core.BlockPos; - -import java.util.Set; -import java.util.List; - -public class TerminatedLabFeature extends Feature { - public static TerminatedLabFeature FEATURE = null; - public static Holder> CONFIGURED_FEATURE = null; - public static Holder PLACED_FEATURE = null; - - public static Feature feature() { - FEATURE = new TerminatedLabFeature(); - CONFIGURED_FEATURE = FeatureUtils.register("mcalecs_changed_addon:terminated_lab", FEATURE, FeatureConfiguration.NONE); - PLACED_FEATURE = PlacementUtils.register("mcalecs_changed_addon:terminated_lab", CONFIGURED_FEATURE, List.of()); - return FEATURE; - } - - public static Holder placedFeature() { - return PLACED_FEATURE; - } - - public static final Set GENERATE_BIOMES = Set.of(new ResourceLocation("sunflower_plains"), new ResourceLocation("snowy_plains"), new ResourceLocation("plains"), new ResourceLocation("savanna")); - private final Set> generate_dimensions = Set.of(Level.OVERWORLD); - private final List base_blocks; - private StructureTemplate template = null; - - public TerminatedLabFeature() { - super(NoneFeatureConfiguration.CODEC); - base_blocks = List.of(Blocks.GRASS_BLOCK); - } - - @Override - public boolean place(FeaturePlaceContext context) { - if (!generate_dimensions.contains(context.level().getLevel().dimension())) - return false; - if (template == null) - template = context.level().getLevel().getStructureManager().getOrCreate(new ResourceLocation("mcalecs_changed_addon", "terminated_lab")); - if (template == null) - return false; - boolean anyPlaced = false; - if ((context.random().nextInt(1000000) + 1) <= 500) { - int count = context.random().nextInt(1) + 1; - for (int a = 0; a < count; a++) { - int i = context.origin().getX() + context.random().nextInt(16); - int k = context.origin().getZ() + context.random().nextInt(16); - int j = context.level().getHeight(Heightmap.Types.OCEAN_FLOOR_WG, i, k) - 1; - if (!base_blocks.contains(context.level().getBlockState(new BlockPos(i, j, k)).getBlock())) - continue; - BlockPos spawnTo = new BlockPos(i + 0, j + 0, k + 0); - if (template.placeInWorld(context.level(), spawnTo, spawnTo, - new StructurePlaceSettings().setMirror(Mirror.NONE).setRotation(Rotation.NONE).setRandom(context.random()).addProcessor(BlockIgnoreProcessor.STRUCTURE_BLOCK).setIgnoreEntities(false), context.random(), 2)) { - anyPlaced = true; - } - } - } - return anyPlaced; - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIDevTestMenu.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIDevTestMenu.java deleted file mode 100644 index 26685bc..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIDevTestMenu.java +++ /dev/null @@ -1,68 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.world.inventory; - -import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.items.IItemHandler; - -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.Level; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.inventory.ContainerLevelAccess; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.Entity; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.core.BlockPos; - -import net.mcalecs.mcalecs_changed_addon.init.McalecsChangedAddonModMenus; - -import java.util.function.Supplier; -import java.util.Map; -import java.util.HashMap; - -public class AddonBookGUIDevTestMenu extends AbstractContainerMenu implements Supplier> { - public final static HashMap guistate = new HashMap<>(); - public final Level world; - public final Player entity; - public int x, y, z; - private ContainerLevelAccess access = ContainerLevelAccess.NULL; - private IItemHandler internal; - private final Map customSlots = new HashMap<>(); - private boolean bound = false; - private Supplier boundItemMatcher = null; - private Entity boundEntity = null; - private BlockEntity boundBlockEntity = null; - - public AddonBookGUIDevTestMenu(int id, Inventory inv, FriendlyByteBuf extraData) { - super(McalecsChangedAddonModMenus.ADDON_BOOK_GUI_DEV_TEST, id); - this.entity = inv.player; - this.world = inv.player.level; - this.internal = new ItemStackHandler(0); - BlockPos pos = null; - if (extraData != null) { - pos = extraData.readBlockPos(); - this.x = pos.getX(); - this.y = pos.getY(); - this.z = pos.getZ(); - access = ContainerLevelAccess.create(world, pos); - } - } - - @Override - public boolean stillValid(Player player) { - if (this.bound) { - if (this.boundItemMatcher != null) - return this.boundItemMatcher.get(); - else if (this.boundBlockEntity != null) - return AbstractContainerMenu.stillValid(this.access, player, this.boundBlockEntity.getBlockState().getBlock()); - else if (this.boundEntity != null) - return this.boundEntity.isAlive(); - } - return true; - } - - public Map get() { - return customSlots; - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIMenu.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIMenu.java deleted file mode 100644 index c91b893..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIMenu.java +++ /dev/null @@ -1,68 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.world.inventory; - -import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.items.IItemHandler; - -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.Level; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.inventory.ContainerLevelAccess; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.Entity; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.core.BlockPos; - -import net.mcalecs.mcalecs_changed_addon.init.McalecsChangedAddonModMenus; - -import java.util.function.Supplier; -import java.util.Map; -import java.util.HashMap; - -public class AddonBookGUIMenu extends AbstractContainerMenu implements Supplier> { - public final static HashMap guistate = new HashMap<>(); - public final Level world; - public final Player entity; - public int x, y, z; - private ContainerLevelAccess access = ContainerLevelAccess.NULL; - private IItemHandler internal; - private final Map customSlots = new HashMap<>(); - private boolean bound = false; - private Supplier boundItemMatcher = null; - private Entity boundEntity = null; - private BlockEntity boundBlockEntity = null; - - public AddonBookGUIMenu(int id, Inventory inv, FriendlyByteBuf extraData) { - super(McalecsChangedAddonModMenus.ADDON_BOOK_GUI, id); - this.entity = inv.player; - this.world = inv.player.level; - this.internal = new ItemStackHandler(0); - BlockPos pos = null; - if (extraData != null) { - pos = extraData.readBlockPos(); - this.x = pos.getX(); - this.y = pos.getY(); - this.z = pos.getZ(); - access = ContainerLevelAccess.create(world, pos); - } - } - - @Override - public boolean stillValid(Player player) { - if (this.bound) { - if (this.boundItemMatcher != null) - return this.boundItemMatcher.get(); - else if (this.boundBlockEntity != null) - return AbstractContainerMenu.stillValid(this.access, player, this.boundBlockEntity.getBlockState().getBlock()); - else if (this.boundEntity != null) - return this.boundEntity.isAlive(); - } - return true; - } - - public Map get() { - return customSlots; - } -} diff --git a/src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIPage1Menu.java b/src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIPage1Menu.java deleted file mode 100644 index 8697d35..0000000 --- a/src/main/java/net/mcalecs/mcalecs_changed_addon/world/inventory/AddonBookGUIPage1Menu.java +++ /dev/null @@ -1,68 +0,0 @@ - -package net.mcalecs.mcalecs_changed_addon.world.inventory; - -import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.items.IItemHandler; - -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.Level; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.inventory.ContainerLevelAccess; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.Entity; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.core.BlockPos; - -import net.mcalecs.mcalecs_changed_addon.init.McalecsChangedAddonModMenus; - -import java.util.function.Supplier; -import java.util.Map; -import java.util.HashMap; - -public class AddonBookGUIPage1Menu extends AbstractContainerMenu implements Supplier> { - public final static HashMap guistate = new HashMap<>(); - public final Level world; - public final Player entity; - public int x, y, z; - private ContainerLevelAccess access = ContainerLevelAccess.NULL; - private IItemHandler internal; - private final Map customSlots = new HashMap<>(); - private boolean bound = false; - private Supplier boundItemMatcher = null; - private Entity boundEntity = null; - private BlockEntity boundBlockEntity = null; - - public AddonBookGUIPage1Menu(int id, Inventory inv, FriendlyByteBuf extraData) { - super(McalecsChangedAddonModMenus.ADDON_BOOK_GUI_PAGE_1, id); - this.entity = inv.player; - this.world = inv.player.level; - this.internal = new ItemStackHandler(0); - BlockPos pos = null; - if (extraData != null) { - pos = extraData.readBlockPos(); - this.x = pos.getX(); - this.y = pos.getY(); - this.z = pos.getZ(); - access = ContainerLevelAccess.create(world, pos); - } - } - - @Override - public boolean stillValid(Player player) { - if (this.bound) { - if (this.boundItemMatcher != null) - return this.boundItemMatcher.get(); - else if (this.boundBlockEntity != null) - return AbstractContainerMenu.stillValid(this.access, player, this.boundBlockEntity.getBlockState().getBlock()); - else if (this.boundEntity != null) - return this.boundEntity.isAlive(); - } - return true; - } - - public Map get() { - return customSlots; - } -} diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg deleted file mode 100644 index 5df5c24..0000000 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - -public net.minecraft.world.level.GameRules$BooleanValue m_46250_(Z)Lnet/minecraft/world/level/GameRules$Type; #create diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index f9d5594..a8549f4 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -3,8 +3,8 @@ loaderVersion="[40,)" license="MIT License" [[mods]] -modId="mcalecs_changed_addon" -version="0.2" +modId="mcs_changed_addon" +version="1.0.0" displayName="McAlec's Changed Addon" credits="McAlec" displayURL="https://curseforge.com/minecraft/mc-mods/mcalecs-changed-addon" @@ -13,7 +13,7 @@ logoFile="logo.png" authors="McAlec" description="Addon Mod to LtxProgrammer's Changed: MC Mod" -[[dependencies.mcalecs_changed_addon]] +[[dependencies.mcs_changed_addon]] modId="minecraft" mandatory=true versionRange="[1.18.2]" @@ -21,7 +21,7 @@ description="Addon Mod to LtxProgrammer's Changed: MC Mod" side="BOTH" -[[dependencies.mcalecs_changed_addon]] +[[dependencies.mcs_changed_addon]] modId="changed" mandatory=true versionRange="[0,)" diff --git a/src/main/resources/assets/mcalecs_changed_addon/models/item/addon_book.json b/src/main/resources/assets/mcalecs_changed_addon/models/item/addon_book.json deleted file mode 100644 index 9f7eaa3..0000000 --- a/src/main/resources/assets/mcalecs_changed_addon/models/item/addon_book.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "mcalecs_changed_addon:items/addonbookitem" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/mcalecs_changed_addon/models/item/baseball_bat.json b/src/main/resources/assets/mcalecs_changed_addon/models/item/baseball_bat.json deleted file mode 100644 index a55aa41..0000000 --- a/src/main/resources/assets/mcalecs_changed_addon/models/item/baseball_bat.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/handheld", - "textures": { - "layer0": "mcalecs_changed_addon:items/screenshot_2023-08-23_144851" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/mcalecs_changed_addon/models/item/dev_item.json b/src/main/resources/assets/mcalecs_changed_addon/models/item/dev_item.json deleted file mode 100644 index efab6e8..0000000 --- a/src/main/resources/assets/mcalecs_changed_addon/models/item/dev_item.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "mcalecs_changed_addon:items/dev_item" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/mcalecs_changed_addon/lang/en_us.json b/src/main/resources/assets/mcs_changed_addon/lang/en_us.json similarity index 98% rename from src/main/resources/assets/mcalecs_changed_addon/lang/en_us.json rename to src/main/resources/assets/mcs_changed_addon/lang/en_us.json index d65abc1..d8641e7 100644 --- a/src/main/resources/assets/mcalecs_changed_addon/lang/en_us.json +++ b/src/main/resources/assets/mcs_changed_addon/lang/en_us.json @@ -32,7 +32,6 @@ "advancements.downloaded_mod.title": "McAlec\u0027s Changed Addon", "item.mcalecs_changed.dev_item": "Dev Item", "item.mcalecs_changed.testing_mob_spawn_egg": "Testing Mob Spawn Egg", - "itemGroup.tabmcalecs_changed_tab": "McAlec\u0027s Changed Addon", "gui.mcalecs_changed.addon_book_gui_dev_test.button_time_set_day": "time set day", "gui.mcalecs_changed_addon.addon_book_gui.searchEngineTest": "Search", "gui.mcalecs_changed_addon.addon_book_gui.label_mcalecs_changed_addon": "McAlec\u0027s Changed Addon", diff --git a/src/main/resources/assets/mcalecs_changed_addon/models/custom/balloon_-_converted.json b/src/main/resources/assets/mcs_changed_addon/models/custom/balloon_-_converted.json similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/models/custom/balloon_-_converted.json rename to src/main/resources/assets/mcs_changed_addon/models/custom/balloon_-_converted.json diff --git a/src/main/resources/assets/mcalecs_changed_addon/models/item/balloon.mtl b/src/main/resources/assets/mcs_changed_addon/models/item/balloon.mtl similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/models/item/balloon.mtl rename to src/main/resources/assets/mcs_changed_addon/models/item/balloon.mtl diff --git a/src/main/resources/assets/mcalecs_changed_addon/models/item/balloon.obj b/src/main/resources/assets/mcs_changed_addon/models/item/balloon.obj similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/models/item/balloon.obj rename to src/main/resources/assets/mcs_changed_addon/models/item/balloon.obj diff --git a/src/main/resources/assets/mcalecs_changed_addon/texts/splashes.txt b/src/main/resources/assets/mcs_changed_addon/texts/splashes.txt similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/texts/splashes.txt rename to src/main/resources/assets/mcs_changed_addon/texts/splashes.txt diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/entities/skin.png b/src/main/resources/assets/mcs_changed_addon/textures/entities/skin.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/entities/skin.png rename to src/main/resources/assets/mcs_changed_addon/textures/entities/skin.png diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/items/addonbookitem.png b/src/main/resources/assets/mcs_changed_addon/textures/items/addonbookitem.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/items/addonbookitem.png rename to src/main/resources/assets/mcs_changed_addon/textures/items/addonbookitem.png diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/items/dev_item.png b/src/main/resources/assets/mcs_changed_addon/textures/items/dev_item.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/items/dev_item.png rename to src/main/resources/assets/mcs_changed_addon/textures/items/dev_item.png diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/items/screenshot_2023-08-23_144851.png b/src/main/resources/assets/mcs_changed_addon/textures/items/screenshot_2023-08-23_144851.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/items/screenshot_2023-08-23_144851.png rename to src/main/resources/assets/mcs_changed_addon/textures/items/screenshot_2023-08-23_144851.png diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/mca-logo.png b/src/main/resources/assets/mcs_changed_addon/textures/mca-logo.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/mca-logo.png rename to src/main/resources/assets/mcs_changed_addon/textures/mca-logo.png diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/screens/addon_book_gui.png b/src/main/resources/assets/mcs_changed_addon/textures/screens/addon_book_gui.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/screens/addon_book_gui.png rename to src/main/resources/assets/mcs_changed_addon/textures/screens/addon_book_gui.png diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/screens/addon_book_gui_dev_test.png b/src/main/resources/assets/mcs_changed_addon/textures/screens/addon_book_gui_dev_test.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/screens/addon_book_gui_dev_test.png rename to src/main/resources/assets/mcs_changed_addon/textures/screens/addon_book_gui_dev_test.png diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/screens/addon_book_gui_page_1.png b/src/main/resources/assets/mcs_changed_addon/textures/screens/addon_book_gui_page_1.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/screens/addon_book_gui_page_1.png rename to src/main/resources/assets/mcs_changed_addon/textures/screens/addon_book_gui_page_1.png diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/screens/custom_furance_gui_1.png b/src/main/resources/assets/mcs_changed_addon/textures/screens/custom_furance_gui_1.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/screens/custom_furance_gui_1.png rename to src/main/resources/assets/mcs_changed_addon/textures/screens/custom_furance_gui_1.png diff --git a/src/main/resources/assets/mcalecs_changed_addon/textures/screens/trading_gui_1.png b/src/main/resources/assets/mcs_changed_addon/textures/screens/trading_gui_1.png similarity index 100% rename from src/main/resources/assets/mcalecs_changed_addon/textures/screens/trading_gui_1.png rename to src/main/resources/assets/mcs_changed_addon/textures/screens/trading_gui_1.png diff --git a/src/main/resources/data/mcalecs_changed_addon/recipes/baseball_bat_recipe.json b/src/main/resources/data/mcalecs_changed_addon/recipes/baseball_bat_recipe.json deleted file mode 100644 index 968b32f..0000000 --- a/src/main/resources/data/mcalecs_changed_addon/recipes/baseball_bat_recipe.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "0", - "1", - "2" - ], - "key": { - "0": { - "item": "minecraft:stick" - }, - "1": { - "item": "minecraft:stick" - }, - "2": { - "item": "minecraft:stick" - } - }, - "result": { - "item": "mcalecs_changed_addon:baseball_bat", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/mcalecs_changed_addon/advancements/downloaded_mod.json b/src/main/resources/data/mcs_changed_addon/advancements/downloaded_mod.json similarity index 90% rename from src/main/resources/data/mcalecs_changed_addon/advancements/downloaded_mod.json rename to src/main/resources/data/mcs_changed_addon/advancements/downloaded_mod.json index 19c46df..e137c7d 100644 --- a/src/main/resources/data/mcalecs_changed_addon/advancements/downloaded_mod.json +++ b/src/main/resources/data/mcs_changed_addon/advancements/downloaded_mod.json @@ -2,7 +2,7 @@ "display": { "background": "minecraft:textures/block/stone.png", "icon": { - "item": "mcalecs_changed_addon:dev_item" + "item": "mcs_changed_addon:dev_item" }, "title": { "translate": "advancements.downloaded_mod.title" diff --git a/src/main/resources/data/mcalecs_changed_addon/advancements/made_baseball_bat.json b/src/main/resources/data/mcs_changed_addon/advancements/made_baseball_bat.json similarity index 79% rename from src/main/resources/data/mcalecs_changed_addon/advancements/made_baseball_bat.json rename to src/main/resources/data/mcs_changed_addon/advancements/made_baseball_bat.json index d281ee7..ab55c99 100644 --- a/src/main/resources/data/mcalecs_changed_addon/advancements/made_baseball_bat.json +++ b/src/main/resources/data/mcs_changed_addon/advancements/made_baseball_bat.json @@ -1,7 +1,7 @@ { "display": { "icon": { - "item": "mcalecs_changed_addon:baseball_bat" + "item": "mcs_changed_addon:baseball_bat" }, "title": { "translate": "advancements.made_baseball_bat.title" @@ -21,7 +21,7 @@ "items": [ { "items": [ - "mcalecs_changed_addon:baseball_bat" + "mcs_changed_addon:baseball_bat" ], "count": { "min": 1, @@ -32,5 +32,5 @@ } } }, - "parent": "mcalecs_changed_addon:downloaded_mod" + "parent": "mcs_changed_addon:downloaded_mod" } \ No newline at end of file diff --git a/src/main/resources/data/mcalecs_changed_addon/structures/terminated_lab.nbt b/src/main/resources/data/mcs_changed_addon/structures/terminated_lab.nbt similarity index 100% rename from src/main/resources/data/mcalecs_changed_addon/structures/terminated_lab.nbt rename to src/main/resources/data/mcs_changed_addon/structures/terminated_lab.nbt diff --git a/src/main/resources/data/mcalecs_changed_addon/tags/entity_types/changed_creature.json b/src/main/resources/data/mcs_changed_addon/tags/entity_types/changed_creature.json similarity index 100% rename from src/main/resources/data/mcalecs_changed_addon/tags/entity_types/changed_creature.json rename to src/main/resources/data/mcs_changed_addon/tags/entity_types/changed_creature.json diff --git a/src/main/resources/data/mcalecs_changed_addon/tags/items/bloodtype_syringe.json b/src/main/resources/data/mcs_changed_addon/tags/items/bloodtype_syringe.json similarity index 100% rename from src/main/resources/data/mcalecs_changed_addon/tags/items/bloodtype_syringe.json rename to src/main/resources/data/mcs_changed_addon/tags/items/bloodtype_syringe.json diff --git a/src/main/resources/data/mcalecs_changed_addon/tags/items/meat.json b/src/main/resources/data/mcs_changed_addon/tags/items/meat.json similarity index 100% rename from src/main/resources/data/mcalecs_changed_addon/tags/items/meat.json rename to src/main/resources/data/mcs_changed_addon/tags/items/meat.json diff --git a/src/main/resources/data/mcalecs_changed_addon/tags/items/syringes.json b/src/main/resources/data/mcs_changed_addon/tags/items/syringes.json similarity index 100% rename from src/main/resources/data/mcalecs_changed_addon/tags/items/syringes.json rename to src/main/resources/data/mcs_changed_addon/tags/items/syringes.json diff --git a/src/main/resources/data/mcalecs_changed_addon/tags/items/untransfur_items.json b/src/main/resources/data/mcs_changed_addon/tags/items/untransfur_items.json similarity index 100% rename from src/main/resources/data/mcalecs_changed_addon/tags/items/untransfur_items.json rename to src/main/resources/data/mcs_changed_addon/tags/items/untransfur_items.json diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 8b8597f..d63beb2 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { - "description": "mcalecs_changed_addon mod resources", + "description": "mcs_changed_addon mod resources", "pack_format": 9 } } \ No newline at end of file