diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..f71ca66 --- /dev/null +++ b/.classpath @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b536c54 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +# Gradle build system ignores +.gradle/ +build/ + +# Other IDE related folders +.idea/ +.settings/ + +# MCreator workspace +.mcreator/ + +# Minecraft client/server files +run/ + +# MacOS system files +.DS_STORE \ No newline at end of file diff --git a/.project b/.project new file mode 100644 index 0000000..aa7bdf8 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + markscoins + + + + org.eclipse.jdt.core.javanature + + + + org.eclipse.jdt.core.javabuilder + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..d169582 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# coinmod +Simple Coin mod + +Textures based off of Varied Commodities Mod diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..d4c7e55 --- /dev/null +++ b/build.gradle @@ -0,0 +1,56 @@ +buildscript { + repositories { + maven { url = 'https://maven.minecraftforge.net' } + mavenCentral() + } + dependencies { + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true + } +} +apply plugin: 'net.minecraftforge.gradle' +apply plugin: 'eclipse' + +version = '1.0' +group = 'com.yourname.modid' +archivesBaseName = 'modid' + +java.toolchain.languageVersion = JavaLanguageVersion.of(8) + +minecraft { + mappings channel: 'snapshot', version: '20201028-1.16.3' + + runs { + client { + workingDirectory project.file('run') + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + + 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 + } + } + } + } +} + +dependencies { + minecraft 'net.minecraftforge:forge:1.16.5-36.1.0' +} + +apply from: 'mcreator.gradle' + diff --git a/elements/Amethystplatinum.mod.json b/elements/Amethystplatinum.mod.json new file mode 100644 index 0000000..e9fb999 --- /dev/null +++ b/elements/Amethystplatinum.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinamethyst" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinplatinum" + }, + "name": "amethystplatinum", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Amethystsapphire.mod.json b/elements/Amethystsapphire.mod.json new file mode 100644 index 0000000..feb024b --- /dev/null +++ b/elements/Amethystsapphire.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coinamethyst" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinamethyst" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinamethyst" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinamethyst" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinsapphire" + }, + "name": "amethystsapphire", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/BankGUI.mod.json b/elements/BankGUI.mod.json new file mode 100644 index 0000000..e6eb977 --- /dev/null +++ b/elements/BankGUI.mod.json @@ -0,0 +1,125 @@ +{ + "_fv": 18, + "_type": "gui", + "definition": { + "type": 1, + "width": 176, + "height": 166, + "inventoryOffsetX": 0, + "inventoryOffsetY": 0, + "renderBgLayer": true, + "doesPauseGame": false, + "components": [ + { + "type": "label", + "data": { + "text": "Balance", + "color": { + "value": -16777216, + "falpha": 0.0 + }, + "name": "Balance", + "x": 131, + "y": 42 + } + }, + { + "type": "inputslot", + "data": { + "inputLimit": { + "value": "" + }, + "id": 0, + "disableStackInteraction": false, + "dropItemsWhenNotBound": false, + "onSlotChanged": { + "name": "BankInputCalc" + }, + "name": "Slot #0", + "x": 149, + "y": 89 + } + }, + { + "type": "outputslot", + "data": { + "id": 1, + "disableStackInteraction": true, + "dropItemsWhenNotBound": false, + "onTakenFromSlot": { + "name": "BankOutputCalc" + }, + "name": "Slot #1", + "x": 257, + "y": 89 + } + }, + { + "type": "label", + "data": { + "text": "", + "color": { + "value": -16777215, + "falpha": 0.0 + }, + "name": "", + "x": 130, + "y": 53 + } + }, + { + "type": "image", + "data": { + "image": "cashout.png", + "use1Xscale": true, + "name": "cashout.png", + "x": 196, + "y": 77 + } + }, + { + "type": "button", + "data": { + "text": "Take", + "onClick": { + "name": "BankTransfer" + }, + "width": 30, + "height": 20, + "name": "Take", + "x": 251, + "y": 53 + } + }, + { + "type": "label", + "data": { + "text": "Deposit", + "color": { + "value": -12829636, + "falpha": 0.0 + }, + "name": "Deposit", + "x": 140, + "y": 78 + } + }, + { + "type": "label", + "data": { + "text": "Withdraw", + "color": { + "value": -12829636, + "falpha": 0.0 + }, + "name": "Withdraw", + "x": 245, + "y": 78 + } + } + ], + "onTick": { + "name": "BankOutputCalc" + } + } +} \ No newline at end of file diff --git a/elements/BankInputCalc.mod.json b/elements/BankInputCalc.mod.json new file mode 100644 index 0000000..55cd1e7 --- /dev/null +++ b/elements/BankInputCalc.mod.json @@ -0,0 +1,7 @@ +{ + "_fv": 18, + "_type": "procedure", + "definition": { + "procedurexml": "no_ext_trigger1CUSTOM:Coinwood0global:moneyADDglobal:money00CUSTOM:Coinstone0global:moneyADDglobal:moneyMULTIPLY040CUSTOM:Coincopper0global:moneyADDglobal:moneyMULTIPLY0160CUSTOM:Coiniron0global:moneyADDglobal:moneyMULTIPLY0640CUSTOM:Coingold0global:moneyADDglobal:moneyMULTIPLY02560CUSTOM:Coinplatinum0global:moneyADDglobal:moneyMULTIPLY010240CUSTOM:Coinamethyst0global:moneyADDglobal:moneyMULTIPLY040960CUSTOM:Coinsapphire0global:moneyADDglobal:moneyMULTIPLY0163840CUSTOM:Coinemerald0global:moneyADDglobal:moneyMULTIPLY0655360CUSTOM:Coinruby0global:moneyADDglobal:moneyMULTIPLY02621440CUSTOM:Coindiamond0global:moneyADDglobal:moneyMULTIPLY010485760CUSTOM:Coinnetherite0global:moneyADDglobal:moneyMULTIPLY041943040Invalid Input" + } +} \ No newline at end of file diff --git a/elements/BankOpenGUI.mod.json b/elements/BankOpenGUI.mod.json new file mode 100644 index 0000000..f4f6e55 --- /dev/null +++ b/elements/BankOpenGUI.mod.json @@ -0,0 +1,7 @@ +{ + "_fv": 18, + "_type": "procedure", + "definition": { + "procedurexml": "no_ext_triggerBankGUIADD1" + } +} \ No newline at end of file diff --git a/elements/BankOutputCalc.mod.json b/elements/BankOutputCalc.mod.json new file mode 100644 index 0000000..5c81a8d --- /dev/null +++ b/elements/BankOutputCalc.mod.json @@ -0,0 +1,7 @@ +{ + "_fv": 18, + "_type": "procedure", + "definition": { + "procedurexml": "no_ext_triggerLT0global:moneyLTglobal:money4global:displayROUNDDOWNglobal:moneyglobal:transferROUNDDOWNglobal:displayglobal:display#CUSTOM:Coinwood1LTglobal:money16global:displayROUNDDOWNDIVIDEglobal:money4global:transferROUNDDOWNMULTIPLYglobal:display4global:display#CUSTOM:Coinstone1LTglobal:money64global:displayROUNDDOWNDIVIDEglobal:money16global:transferROUNDDOWNMULTIPLYglobal:display16global:display#CUSTOM:Coincopper1LTglobal:money256global:displayROUNDDOWNDIVIDEglobal:money64global:transferROUNDDOWNMULTIPLYglobal:display64global:display#CUSTOM:Coiniron1LTglobal:money1024global:displayROUNDDOWNDIVIDEglobal:money256global:transferROUNDDOWNMULTIPLYglobal:display256global:display#CUSTOM:Coingold1LTglobal:money4096global:displayROUNDDOWNDIVIDEglobal:money1024global:transferROUNDDOWNMULTIPLYglobal:display1024global:display#CUSTOM:Coinplatinum1LTglobal:money16384global:displayROUNDDOWNDIVIDEglobal:money4096global:transferROUNDDOWNMULTIPLYglobal:display4096global:display#CUSTOM:Coinamethyst1LTglobal:money65536global:displayROUNDDOWNDIVIDEglobal:money16384global:transferROUNDDOWNMULTIPLYglobal:display16384global:display#CUSTOM:Coinsapphire1LTglobal:money262144global:displayROUNDDOWNDIVIDEglobal:money65536global:transferROUNDDOWNMULTIPLYglobal:display65536global:display#CUSTOM:Coinemerald1LTglobal:money1048576global:displayROUNDDOWNDIVIDEglobal:money262144global:transferROUNDDOWNMULTIPLYglobal:display262144global:display#CUSTOM:Coinruby1LTglobal:money4194304global:displayROUNDDOWNDIVIDEglobal:money1048576global:transferROUNDDOWNMULTIPLYglobal:display1048576global:display#CUSTOM:Coindiamond1GTEglobal:money4194304global:displayROUNDDOWNDIVIDEglobal:money4194304global:transferROUNDDOWNMULTIPLYglobal:display4194304global:display#CUSTOM:Coinnetherite1Display: global:displayglobal:money_dispglobal:money#,###,###.### PC" + } +} \ No newline at end of file diff --git a/elements/BankTransfer.mod.json b/elements/BankTransfer.mod.json new file mode 100644 index 0000000..f13fd69 --- /dev/null +++ b/elements/BankTransfer.mod.json @@ -0,0 +1,7 @@ +{ + "_fv": 18, + "_type": "procedure", + "definition": { + "procedurexml": "no_ext_triggerGTEglobal:money0GT10global:moneyMINUSglobal:moneyglobal:transferglobal:transfer0global:display11" + } +} \ No newline at end of file diff --git a/elements/Coinamethyst.mod.json b/elements/Coinamethyst.mod.json new file mode 100644 index 0000000..aa60321 --- /dev/null +++ b/elements/Coinamethyst.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_amethyst", + "customModelName": "Normal", + "name": "Amethyst Coin", + "rarity": "RARE", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "enchantability": 0, + "useDuration": 0, + "toolType": 1.0, + "damageCount": 0, + "recipeRemainder": { + "value": "" + }, + "destroyAnyBlock": false, + "immuneToFire": true, + "stayInGridWhenCrafting": false, + "damageOnCrafting": false, + "enableMeleeDamage": false, + "damageVsEntity": 0.0, + "specialInfo": [ + "4,096PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coincopper.mod.json b/elements/Coincopper.mod.json new file mode 100644 index 0000000..650988b --- /dev/null +++ b/elements/Coincopper.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_bronze", + "customModelName": "Normal", + "name": "Copper Coin", + "rarity": "COMMON", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "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": [ + "16PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coindiamond.mod.json b/elements/Coindiamond.mod.json new file mode 100644 index 0000000..c05a247 --- /dev/null +++ b/elements/Coindiamond.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_diamond", + "customModelName": "Normal", + "name": "Diamond Coin", + "rarity": "EPIC", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "enchantability": 0, + "useDuration": 0, + "toolType": 1.0, + "damageCount": 0, + "recipeRemainder": { + "value": "" + }, + "destroyAnyBlock": false, + "immuneToFire": true, + "stayInGridWhenCrafting": false, + "damageOnCrafting": false, + "enableMeleeDamage": false, + "damageVsEntity": 0.0, + "specialInfo": [ + "1,048,576PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coinemerald.mod.json b/elements/Coinemerald.mod.json new file mode 100644 index 0000000..8027cde --- /dev/null +++ b/elements/Coinemerald.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_emerald", + "customModelName": "Normal", + "name": "Emerald Coin", + "rarity": "EPIC", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "enchantability": 0, + "useDuration": 0, + "toolType": 1.0, + "damageCount": 0, + "recipeRemainder": { + "value": "" + }, + "destroyAnyBlock": false, + "immuneToFire": true, + "stayInGridWhenCrafting": false, + "damageOnCrafting": false, + "enableMeleeDamage": false, + "damageVsEntity": 0.0, + "specialInfo": [ + "65,536PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coingold.mod.json b/elements/Coingold.mod.json new file mode 100644 index 0000000..f2e8714 --- /dev/null +++ b/elements/Coingold.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_gold", + "customModelName": "Normal", + "name": "Gold Coin", + "rarity": "UNCOMMON", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "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": [ + "256PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coiniron.mod.json b/elements/Coiniron.mod.json new file mode 100644 index 0000000..4d433fb --- /dev/null +++ b/elements/Coiniron.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_iron", + "customModelName": "Normal", + "name": "Iron Coin", + "rarity": "UNCOMMON", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "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": [ + "64PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coinloot.mod.json b/elements/Coinloot.mod.json new file mode 100644 index 0000000..29e664f --- /dev/null +++ b/elements/Coinloot.mod.json @@ -0,0 +1,178 @@ +{ + "_fv": 18, + "_type": "loottable", + "definition": { + "type": "Chest", + "pools": [ + { + "minrolls": 1, + "maxrolls": 8, + "minbonusrolls": 1, + "maxbonusrolls": 4, + "hasbonusrolls": true, + "entries": [ + { + "type": "item", + "item": { + "value": "CUSTOM:Coinwood" + }, + "weight": 32, + "minCount": 1, + "maxCount": 8, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": true, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coinstone" + }, + "weight": 16, + "minCount": 1, + "maxCount": 6, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": true, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coincopper" + }, + "weight": 8, + "minCount": 1, + "maxCount": 4, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": true, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coiniron" + }, + "weight": 4, + "minCount": 1, + "maxCount": 2, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coingold" + }, + "weight": 1, + "minCount": 1, + "maxCount": 1, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + } + ] + }, + { + "minrolls": 1, + "maxrolls": 16, + "minbonusrolls": 1, + "maxbonusrolls": 8, + "hasbonusrolls": true, + "entries": [ + { + "type": "item", + "item": { + "value": "CUSTOM:Coinstone" + }, + "weight": 8, + "minCount": 1, + "maxCount": 16, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coinwood" + }, + "weight": 8, + "minCount": 1, + "maxCount": 24, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coincopper" + }, + "weight": 4, + "minCount": 1, + "maxCount": 8, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + } + ] + }, + { + "minrolls": 1, + "maxrolls": 32, + "minbonusrolls": 1, + "maxbonusrolls": 16, + "hasbonusrolls": true, + "entries": [ + { + "type": "item", + "item": { + "value": "CUSTOM:Coinwood" + }, + "weight": 8, + "minCount": 1, + "maxCount": 8, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": true, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coinstone" + }, + "weight": 4, + "minCount": 1, + "maxCount": 4, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + } + ] + } + ], + "name": "coinloot", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Coinnetherite.mod.json b/elements/Coinnetherite.mod.json new file mode 100644 index 0000000..9a0fb12 --- /dev/null +++ b/elements/Coinnetherite.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_netherite", + "customModelName": "Normal", + "name": "Netherite Coin", + "rarity": "EPIC", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "enchantability": 0, + "useDuration": 0, + "toolType": 1.0, + "damageCount": 0, + "recipeRemainder": { + "value": "" + }, + "destroyAnyBlock": false, + "immuneToFire": true, + "stayInGridWhenCrafting": false, + "damageOnCrafting": false, + "enableMeleeDamage": false, + "damageVsEntity": 0.0, + "specialInfo": [ + "4,194,304PC" + ], + "hasGlow": true, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coinplatinum.mod.json b/elements/Coinplatinum.mod.json new file mode 100644 index 0000000..937db2f --- /dev/null +++ b/elements/Coinplatinum.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_platinum", + "customModelName": "Normal", + "name": "Platinum Coin", + "rarity": "UNCOMMON", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "enchantability": 0, + "useDuration": 0, + "toolType": 1.0, + "damageCount": 0, + "recipeRemainder": { + "value": "" + }, + "destroyAnyBlock": false, + "immuneToFire": true, + "stayInGridWhenCrafting": false, + "damageOnCrafting": false, + "enableMeleeDamage": false, + "damageVsEntity": 0.0, + "specialInfo": [ + "1,024PC" + ], + "hasGlow": true, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coinruby.mod.json b/elements/Coinruby.mod.json new file mode 100644 index 0000000..8d9d336 --- /dev/null +++ b/elements/Coinruby.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_ruby", + "customModelName": "Normal", + "name": "Ruby Coin", + "rarity": "EPIC", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "enchantability": 0, + "useDuration": 0, + "toolType": 1.0, + "damageCount": 0, + "recipeRemainder": { + "value": "" + }, + "destroyAnyBlock": false, + "immuneToFire": true, + "stayInGridWhenCrafting": false, + "damageOnCrafting": false, + "enableMeleeDamage": false, + "damageVsEntity": 0.0, + "specialInfo": [ + "262,144PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coins.mod.json b/elements/Coins.mod.json new file mode 100644 index 0000000..567b146 --- /dev/null +++ b/elements/Coins.mod.json @@ -0,0 +1,50 @@ +{ + "_fv": 18, + "_type": "tag", + "definition": { + "type": "Items", + "items": [ + { + "value": "CUSTOM:Coinwood" + }, + { + "value": "CUSTOM:Coinstone" + }, + { + "value": "CUSTOM:Coincopper" + }, + { + "value": "CUSTOM:Coiniron" + }, + { + "value": "CUSTOM:Coingold" + }, + { + "value": "CUSTOM:Coinamethyst" + }, + { + "value": "CUSTOM:Coinsapphire" + }, + { + "value": "CUSTOM:Coinruby" + }, + { + "value": "CUSTOM:Coindiamond" + }, + { + "value": "CUSTOM:Coinemerald" + }, + { + "value": "CUSTOM:Coinnetherite" + }, + { + "value": "CUSTOM:Coinplatinum" + } + ], + "blocks": [], + "functions": [], + "entities": [], + "name": "coins", + "namespace": "forge" + } +} \ No newline at end of file diff --git a/elements/Coinsapphire.mod.json b/elements/Coinsapphire.mod.json new file mode 100644 index 0000000..2bbdf72 --- /dev/null +++ b/elements/Coinsapphire.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_sapphire", + "customModelName": "Normal", + "name": "Sapphire Coin", + "rarity": "RARE", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "enchantability": 0, + "useDuration": 0, + "toolType": 1.0, + "damageCount": 0, + "recipeRemainder": { + "value": "" + }, + "destroyAnyBlock": false, + "immuneToFire": true, + "stayInGridWhenCrafting": false, + "damageOnCrafting": false, + "enableMeleeDamage": false, + "damageVsEntity": 0.0, + "specialInfo": [ + "16,384PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coinstone.mod.json b/elements/Coinstone.mod.json new file mode 100644 index 0000000..48ce864 --- /dev/null +++ b/elements/Coinstone.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_stone", + "customModelName": "Normal", + "name": "Stone Coin", + "rarity": "COMMON", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "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": [ + "4PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Coinwood.mod.json b/elements/Coinwood.mod.json new file mode 100644 index 0000000..e2f7a26 --- /dev/null +++ b/elements/Coinwood.mod.json @@ -0,0 +1,35 @@ +{ + "_fv": 18, + "_type": "item", + "definition": { + "renderType": 0, + "texture": "coin_wood", + "customModelName": "Normal", + "name": "Wood Coin", + "rarity": "COMMON", + "creativeTab": { + "value": "No creative tab entry" + }, + "stackSize": 64, + "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": [ + "1PC" + ], + "hasGlow": false, + "guiBoundTo": "", + "inventorySize": 9, + "inventoryStackSize": 64 + } +} \ No newline at end of file diff --git a/elements/Copperiron.mod.json b/elements/Copperiron.mod.json new file mode 100644 index 0000000..5166921 --- /dev/null +++ b/elements/Copperiron.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coincopper" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coincopper" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coincopper" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coincopper" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coiniron" + }, + "name": "copperiron", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Copperstone.mod.json b/elements/Copperstone.mod.json new file mode 100644 index 0000000..459bfa4 --- /dev/null +++ b/elements/Copperstone.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coincopper" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinstone" + }, + "name": "copperstone", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Diamondnetherite.mod.json b/elements/Diamondnetherite.mod.json new file mode 100644 index 0000000..95c5cc6 --- /dev/null +++ b/elements/Diamondnetherite.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coindiamond" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coindiamond" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coindiamond" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coindiamond" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinnetherite" + }, + "name": "diamondnetherite", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Diamondruby.mod.json b/elements/Diamondruby.mod.json new file mode 100644 index 0000000..291c319 --- /dev/null +++ b/elements/Diamondruby.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coindiamond" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinruby" + }, + "name": "diamondruby", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Emeraldruby.mod.json b/elements/Emeraldruby.mod.json new file mode 100644 index 0000000..0fd7e41 --- /dev/null +++ b/elements/Emeraldruby.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coinemerald" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinemerald" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinemerald" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinemerald" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinruby" + }, + "name": "emeraldruby", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Emeraldsapphire.mod.json b/elements/Emeraldsapphire.mod.json new file mode 100644 index 0000000..c1ad54b --- /dev/null +++ b/elements/Emeraldsapphire.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinemerald" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinsapphire" + }, + "name": "emeraldsapphire", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Endcity.mod.json b/elements/Endcity.mod.json new file mode 100644 index 0000000..f76a934 --- /dev/null +++ b/elements/Endcity.mod.json @@ -0,0 +1,62 @@ +{ + "_fv": 18, + "_type": "loottable", + "definition": { + "type": "Chest", + "pools": [ + { + "minrolls": 1, + "maxrolls": 4, + "minbonusrolls": 1, + "maxbonusrolls": 2, + "hasbonusrolls": true, + "entries": [ + { + "type": "item", + "item": { + "value": "CUSTOM:Coinamethyst" + }, + "weight": 1, + "minCount": 1, + "maxCount": 3, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coinsapphire" + }, + "weight": 1, + "minCount": 1, + "maxCount": 2, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coinruby" + }, + "weight": 1, + "minCount": 1, + "maxCount": 1, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + } + ] + } + ], + "name": "chests/end_city_treasure", + "namespace": "minecraft" + } +} \ No newline at end of file diff --git a/elements/Goldiron.mod.json b/elements/Goldiron.mod.json new file mode 100644 index 0000000..0223b0d --- /dev/null +++ b/elements/Goldiron.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coingold" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coiniron" + }, + "name": "goldiron", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Goldplatinum.mod.json b/elements/Goldplatinum.mod.json new file mode 100644 index 0000000..bf00e6d --- /dev/null +++ b/elements/Goldplatinum.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coingold" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coingold" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coingold" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coingold" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinplatinum" + }, + "name": "goldplatinum", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Ironcopper.mod.json b/elements/Ironcopper.mod.json new file mode 100644 index 0000000..ffda478 --- /dev/null +++ b/elements/Ironcopper.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coiniron" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coincopper" + }, + "name": "ironcopper", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Irongold.mod.json b/elements/Irongold.mod.json new file mode 100644 index 0000000..0a988e5 --- /dev/null +++ b/elements/Irongold.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coiniron" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coiniron" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coiniron" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coiniron" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coingold" + }, + "name": "irongold", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Makebronze.mod.json b/elements/Makebronze.mod.json new file mode 100644 index 0000000..f5356b8 --- /dev/null +++ b/elements/Makebronze.mod.json @@ -0,0 +1,23 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Smithing", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": false, + "smithingInputStack": { + "value": "Blocks.BELL" + }, + "smithingInputAdditionStack": { + "value": "Items.FLOWER_POT" + }, + "smithingReturnStack": { + "value": "CUSTOM:Coincopper" + }, + "name": "makebronze", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Makeiron.mod.json b/elements/Makeiron.mod.json new file mode 100644 index 0000000..7f3f159 --- /dev/null +++ b/elements/Makeiron.mod.json @@ -0,0 +1,23 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Smithing", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": false, + "smithingInputStack": { + "value": "Blocks.IRON_BLOCK" + }, + "smithingInputAdditionStack": { + "value": "Items.FLOWER_POT" + }, + "smithingReturnStack": { + "value": "CUSTOM:Coiniron" + }, + "name": "makeiron", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Makestone.mod.json b/elements/Makestone.mod.json new file mode 100644 index 0000000..cc60c33 --- /dev/null +++ b/elements/Makestone.mod.json @@ -0,0 +1,20 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Stone cutting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": false, + "stoneCuttingInputStack": { + "value": "Blocks.STONE_SLAB" + }, + "stoneCuttingReturnStack": { + "value": "CUSTOM:Coinstone" + }, + "name": "makestone", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Makestone2.mod.json b/elements/Makestone2.mod.json new file mode 100644 index 0000000..e385ef2 --- /dev/null +++ b/elements/Makestone2.mod.json @@ -0,0 +1,23 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Smithing", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": false, + "smithingInputStack": { + "value": "Blocks.STONE" + }, + "smithingInputAdditionStack": { + "value": "Items.FLOWER_POT" + }, + "smithingReturnStack": { + "value": "CUSTOM:Coinstone" + }, + "name": "makestone_2", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Makewood.mod.json b/elements/Makewood.mod.json new file mode 100644 index 0000000..ab497d0 --- /dev/null +++ b/elements/Makewood.mod.json @@ -0,0 +1,23 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Smithing", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": false, + "smithingInputStack": { + "value": "Blocks.LOG" + }, + "smithingInputAdditionStack": { + "value": "Items.FLOWER_POT" + }, + "smithingReturnStack": { + "value": "CUSTOM:Coinwood" + }, + "name": "makewood", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Makewood1.mod.json b/elements/Makewood1.mod.json new file mode 100644 index 0000000..bbe877e --- /dev/null +++ b/elements/Makewood1.mod.json @@ -0,0 +1,23 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Smithing", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": false, + "smithingInputStack": { + "value": "Items.LEATHER" + }, + "smithingInputAdditionStack": { + "value": "Items.FLOWER_POT" + }, + "smithingReturnStack": { + "value": "CUSTOM:Coinwood" + }, + "name": "makewood_1", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Makewood2.mod.json b/elements/Makewood2.mod.json new file mode 100644 index 0000000..6d920db --- /dev/null +++ b/elements/Makewood2.mod.json @@ -0,0 +1,23 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Smithing", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": false, + "smithingInputStack": { + "value": "Items.DYE#15" + }, + "smithingInputAdditionStack": { + "value": "Items.FLOWER_POT" + }, + "smithingReturnStack": { + "value": "CUSTOM:Coinwood" + }, + "name": "makewood_2", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Mineshaft.mod.json b/elements/Mineshaft.mod.json new file mode 100644 index 0000000..5f8d84e --- /dev/null +++ b/elements/Mineshaft.mod.json @@ -0,0 +1,76 @@ +{ + "_fv": 18, + "_type": "loottable", + "definition": { + "type": "Chest", + "pools": [ + { + "minrolls": 0, + "maxrolls": 17, + "minbonusrolls": 1, + "maxbonusrolls": 3, + "hasbonusrolls": true, + "entries": [ + { + "type": "item", + "item": { + "value": "CUSTOM:Coinwood" + }, + "weight": 15, + "minCount": 1, + "maxCount": 8, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coinstone" + }, + "weight": 10, + "minCount": 1, + "maxCount": 4, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coincopper" + }, + "weight": 5, + "minCount": 1, + "maxCount": 2, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": false, + "explosionDecay": false, + "silkTouchMode": 0 + }, + { + "type": "item", + "item": { + "value": "CUSTOM:Coiniron" + }, + "weight": 1, + "minCount": 1, + "maxCount": 1, + "minEnchantmentLevel": 0, + "maxEnchantmentLevel": 0, + "affectedByFortune": true, + "explosionDecay": false, + "silkTouchMode": 0 + } + ] + } + ], + "name": "chests/abandoned_mineshaft", + "namespace": "minecraft" + } +} \ No newline at end of file diff --git a/elements/Netheritediamond.mod.json b/elements/Netheritediamond.mod.json new file mode 100644 index 0000000..8b388ac --- /dev/null +++ b/elements/Netheritediamond.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinnetherite" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coindiamond" + }, + "name": "netheritediamond", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/OpenBank.mod.json b/elements/OpenBank.mod.json new file mode 100644 index 0000000..3593a6a --- /dev/null +++ b/elements/OpenBank.mod.json @@ -0,0 +1,12 @@ +{ + "_fv": 18, + "_type": "keybind", + "definition": { + "triggerKey": "RCONTROL", + "keyBindingName": "Open Bank", + "keyBindingCategoryKey": "misc", + "onKeyPressed": { + "name": "BankOpenGUI" + } + } +} \ No newline at end of file diff --git a/elements/Piggybank.mod.json b/elements/Piggybank.mod.json new file mode 100644 index 0000000..f93125e --- /dev/null +++ b/elements/Piggybank.mod.json @@ -0,0 +1,27 @@ +{ + "_fv": 18, + "_type": "achievement", + "definition": { + "achievementName": "Piggy Bank", + "achievementDescription": "Save up till you get a netherite coin", + "achievementIcon": { + "value": "CUSTOM:Coinnetherite" + }, + "background": "Default", + "disableDisplay": false, + "showPopup": true, + "announceToChat": true, + "hideIfNotCompleted": true, + "rewardLoot": [], + "rewardRecipes": [ + "Makebedrock" + ], + "rewardFunction": "No function", + "rewardXP": 8, + "achievementType": "challenge", + "parent": { + "value": "story/root" + }, + "triggerxml": "164CUSTOM:Coinnetherite" + } +} \ No newline at end of file diff --git a/elements/Platinumamethyst.mod.json b/elements/Platinumamethyst.mod.json new file mode 100644 index 0000000..6a9baf9 --- /dev/null +++ b/elements/Platinumamethyst.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coinplatinum" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinplatinum" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinplatinum" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinplatinum" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinamethyst" + }, + "name": "platinumamethyst", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Platinumgold.mod.json b/elements/Platinumgold.mod.json new file mode 100644 index 0000000..67bffb5 --- /dev/null +++ b/elements/Platinumgold.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinplatinum" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coingold" + }, + "name": "platinumgold", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Rottenflesh2Leather.mod.json b/elements/Rottenflesh2Leather.mod.json new file mode 100644 index 0000000..74fd2f1 --- /dev/null +++ b/elements/Rottenflesh2Leather.mod.json @@ -0,0 +1,20 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Campfire cooking", + "xpReward": 1.0, + "cookingTime": 400, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": false, + "campfireCookingInputStack": { + "value": "Items.ROTTEN_FLESH" + }, + "campfireCookingReturnStack": { + "value": "Items.LEATHER" + }, + "name": "rottenflesh_2_leather", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Rubydiamond.mod.json b/elements/Rubydiamond.mod.json new file mode 100644 index 0000000..f5d3c42 --- /dev/null +++ b/elements/Rubydiamond.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coinruby" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinruby" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinruby" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinruby" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coindiamond" + }, + "name": "rubydiamond", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Rubyemerald.mod.json b/elements/Rubyemerald.mod.json new file mode 100644 index 0000000..8c632d0 --- /dev/null +++ b/elements/Rubyemerald.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinruby" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinemerald" + }, + "name": "rubyemerald", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Sapphireamethyst.mod.json b/elements/Sapphireamethyst.mod.json new file mode 100644 index 0000000..b345a8a --- /dev/null +++ b/elements/Sapphireamethyst.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinsapphire" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinamethyst" + }, + "name": "sapphireamethyst", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Sapphireemerald.mod.json b/elements/Sapphireemerald.mod.json new file mode 100644 index 0000000..b0673e9 --- /dev/null +++ b/elements/Sapphireemerald.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coinsapphire" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinsapphire" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinsapphire" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinsapphire" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinemerald" + }, + "name": "sapphireemerald", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Starter.mod.json b/elements/Starter.mod.json new file mode 100644 index 0000000..1e39172 --- /dev/null +++ b/elements/Starter.mod.json @@ -0,0 +1,30 @@ +{ + "_fv": 18, + "_type": "achievement", + "definition": { + "achievementName": "Starting the Economy", + "achievementDescription": "Get your first coins", + "achievementIcon": { + "value": "CUSTOM:Coingold" + }, + "background": "Default", + "disableDisplay": false, + "showPopup": true, + "announceToChat": true, + "hideIfNotCompleted": true, + "rewardLoot": [ + "Coinloot" + ], + "rewardRecipes": [ + "Woodstone", + "Stonecopper" + ], + "rewardFunction": "No function", + "rewardXP": 0, + "achievementType": "task", + "parent": { + "value": "story/root" + }, + "triggerxml": "" + } +} \ No newline at end of file diff --git a/elements/Stonecopper.mod.json b/elements/Stonecopper.mod.json new file mode 100644 index 0000000..2ddf02c --- /dev/null +++ b/elements/Stonecopper.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coinstone" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinstone" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinstone" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinstone" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coincopper" + }, + "name": "stonecopper", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Stonewood.mod.json b/elements/Stonewood.mod.json new file mode 100644 index 0000000..38ffe2f --- /dev/null +++ b/elements/Stonewood.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 4, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinstone" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinwood" + }, + "name": "stonewood", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/elements/Woodstone.mod.json b/elements/Woodstone.mod.json new file mode 100644 index 0000000..5557df6 --- /dev/null +++ b/elements/Woodstone.mod.json @@ -0,0 +1,46 @@ +{ + "_fv": 18, + "_type": "recipe", + "definition": { + "recipeType": "Crafting", + "xpReward": 0.0, + "cookingTime": 200, + "recipeRetstackSize": 1, + "group": "", + "recipeShapeless": true, + "recipeSlots": [ + { + "value": "CUSTOM:Coinwood" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinwood" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinwood" + }, + { + "value": "" + }, + { + "value": "CUSTOM:Coinwood" + } + ], + "recipeReturnStack": { + "value": "CUSTOM:Coinstone" + }, + "name": "woodstone", + "namespace": "mod" + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..0d4a951 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..1c4bcc2 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/markscoins.mcreator b/markscoins.mcreator new file mode 100644 index 0000000..88ebcb5 --- /dev/null +++ b/markscoins.mcreator @@ -0,0 +1,716 @@ +{ + "id_map": {}, + "mod_elements": [ + { + "name": "Coinwood", + "type": "item", + "sortid": 1, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coinwood", + "path": "~/items" + }, + { + "name": "Coinstone", + "type": "item", + "sortid": 2, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coinstone", + "path": "~/items" + }, + { + "name": "Woodstone", + "type": "recipe", + "sortid": 3, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "woodstone", + "path": "~/recipes/up" + }, + { + "name": "Coincopper", + "type": "item", + "sortid": 4, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coincopper", + "path": "~/items" + }, + { + "name": "Coiniron", + "type": "item", + "sortid": 5, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coiniron", + "path": "~/items" + }, + { + "name": "Coingold", + "type": "item", + "sortid": 6, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coingold", + "path": "~/items" + }, + { + "name": "Coinamethyst", + "type": "item", + "sortid": 7, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coinamethyst", + "path": "~/items" + }, + { + "name": "Coinsapphire", + "type": "item", + "sortid": 8, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coinsapphire", + "path": "~/items" + }, + { + "name": "Coinruby", + "type": "item", + "sortid": 9, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coinruby", + "path": "~/items" + }, + { + "name": "Coindiamond", + "type": "item", + "sortid": 10, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coindiamond", + "path": "~/items" + }, + { + "name": "Coinemerald", + "type": "item", + "sortid": 11, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coinemerald", + "path": "~/items" + }, + { + "name": "Stonecopper", + "type": "recipe", + "sortid": 12, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "stonecopper", + "path": "~/recipes/up" + }, + { + "name": "Copperiron", + "type": "recipe", + "sortid": 13, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "copperiron", + "path": "~/recipes/up" + }, + { + "name": "Irongold", + "type": "recipe", + "sortid": 14, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "irongold", + "path": "~/recipes/up" + }, + { + "name": "Diamondruby", + "type": "recipe", + "sortid": 16, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "diamondruby", + "path": "~/recipes/down" + }, + { + "name": "Sapphireamethyst", + "type": "recipe", + "sortid": 18, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "sapphireamethyst", + "path": "~/recipes/down" + }, + { + "name": "Goldiron", + "type": "recipe", + "sortid": 20, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "goldiron", + "path": "~/recipes/down" + }, + { + "name": "Ironcopper", + "type": "recipe", + "sortid": 21, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "ironcopper", + "path": "~/recipes/down" + }, + { + "name": "Copperstone", + "type": "recipe", + "sortid": 22, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "copperstone", + "path": "~/recipes/down" + }, + { + "name": "Stonewood", + "type": "recipe", + "sortid": 23, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "stonewood", + "path": "~/recipes/down" + }, + { + "name": "Amethystsapphire", + "type": "recipe", + "sortid": 25, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "amethystsapphire", + "path": "~/recipes/up" + }, + { + "name": "Rubydiamond", + "type": "recipe", + "sortid": 27, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "rubydiamond", + "path": "~/recipes/up" + }, + { + "name": "Coinnetherite", + "type": "item", + "sortid": 30, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coinnetherite", + "path": "~/items" + }, + { + "name": "Makestone", + "type": "recipe", + "sortid": 33, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "makestone", + "path": "~/recipes/center" + }, + { + "name": "Makestone2", + "type": "recipe", + "sortid": 35, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "makestone_2", + "path": "~/recipes/center" + }, + { + "name": "Makeiron", + "type": "recipe", + "sortid": 36, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "makeiron", + "path": "~/recipes/center" + }, + { + "name": "Makebronze", + "type": "recipe", + "sortid": 37, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "makebronze", + "path": "~/recipes/center" + }, + { + "name": "Makewood1", + "type": "recipe", + "sortid": 38, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "makewood_1", + "path": "~/recipes/center" + }, + { + "name": "Makewood2", + "type": "recipe", + "sortid": 39, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "makewood_2", + "path": "~/recipes/center" + }, + { + "name": "Rottenflesh2Leather", + "type": "recipe", + "sortid": 40, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "rottenflesh_2_leather", + "path": "~/recipes/center" + }, + { + "name": "Coinloot", + "type": "loottable", + "sortid": 42, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coinloot", + "path": "~/lootTable" + }, + { + "name": "Piggybank", + "type": "achievement", + "sortid": 43, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "piggybank", + "path": "~/advancments" + }, + { + "name": "Makewood", + "type": "recipe", + "sortid": 47, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "makewood", + "path": "~/recipes/center" + }, + { + "name": "Starter", + "type": "achievement", + "sortid": 48, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "starter", + "path": "~/advancments" + }, + { + "name": "Coinplatinum", + "type": "item", + "sortid": 49, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coinplatinum", + "path": "~/items" + }, + { + "name": "Endcity", + "type": "loottable", + "sortid": 50, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "endcity", + "path": "~/lootTable" + }, + { + "name": "BankGUI", + "type": "gui", + "sortid": 51, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "bank_gui", + "path": "~/procedures" + }, + { + "name": "OpenBank", + "type": "keybind", + "sortid": 54, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "open_bank", + "path": "~/procedures" + }, + { + "name": "Coins", + "type": "tag", + "sortid": 57, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "coins", + "path": "~/items" + }, + { + "name": "BankInputCalc", + "type": "procedure", + "sortid": 59, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "bank_input_calc", + "metadata": { + "dependencies": [ + { + "name": "entity", + "type": "entity" + }, + { + "name": "world", + "type": "world" + } + ] + }, + "path": "~/procedures" + }, + { + "name": "BankOutputCalc", + "type": "procedure", + "sortid": 60, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "bank_output_calc", + "metadata": { + "dependencies": [ + { + "name": "entity", + "type": "entity" + } + ] + }, + "path": "~/procedures" + }, + { + "name": "BankTransfer", + "type": "procedure", + "sortid": 61, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "bank_transfer", + "metadata": { + "dependencies": [ + { + "name": "entity", + "type": "entity" + } + ] + }, + "path": "~/procedures" + }, + { + "name": "BankOpenGUI", + "type": "procedure", + "sortid": 62, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "bank_open_gui", + "metadata": { + "dependencies": [ + { + "name": "entity", + "type": "entity" + }, + { + "name": "x", + "type": "number" + }, + { + "name": "y", + "type": "number" + }, + { + "name": "z", + "type": "number" + }, + { + "name": "world", + "type": "world" + } + ] + }, + "path": "~/procedures" + }, + { + "name": "Goldplatinum", + "type": "recipe", + "sortid": 63, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "goldplatinum", + "path": "~/recipes/up" + }, + { + "name": "Platinumamethyst", + "type": "recipe", + "sortid": 64, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "platinumamethyst", + "path": "~/recipes/up" + }, + { + "name": "Sapphireemerald", + "type": "recipe", + "sortid": 65, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "sapphireemerald", + "path": "~/recipes/up" + }, + { + "name": "Emeraldruby", + "type": "recipe", + "sortid": 66, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "emeraldruby", + "path": "~/recipes/up" + }, + { + "name": "Diamondnetherite", + "type": "recipe", + "sortid": 67, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "diamondnetherite", + "path": "~/recipes/up" + }, + { + "name": "Netheritediamond", + "type": "recipe", + "sortid": 68, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "netheritediamond", + "path": "~/recipes/down" + }, + { + "name": "Rubyemerald", + "type": "recipe", + "sortid": 69, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "rubyemerald", + "path": "~/recipes/down" + }, + { + "name": "Emeraldsapphire", + "type": "recipe", + "sortid": 70, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "emeraldsapphire", + "path": "~/recipes/down" + }, + { + "name": "Amethystplatinum", + "type": "recipe", + "sortid": 71, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "amethystplatinum", + "path": "~/recipes/down" + }, + { + "name": "Platinumgold", + "type": "recipe", + "sortid": 72, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "platinumgold", + "path": "~/recipes/down" + }, + { + "name": "Mineshaft", + "type": "loottable", + "sortid": 73, + "compiles": true, + "locked_code": false, + "ids": {}, + "registry_name": "mineshaft", + "path": "~/lootTable" + } + ], + "variable_elements": [ + { + "name": "money", + "type": "number", + "scope": "player_persistent", + "value": "0" + }, + { + "name": "transfer", + "type": "number", + "scope": "player_persistent", + "value": "0" + }, + { + "name": "display", + "type": "number", + "scope": "player_persistent", + "value": "0" + }, + { + "name": "money_disp", + "type": "string", + "scope": "player_persistent", + "value": "0 PC" + } + ], + "sound_elements": [], + "language_map": { + "en_us": { + "item.markscustom.coinnetherite": "Netherite Coin", + "item.markscustom.coinsapphire": "Sapphire Coin", + "key.markscustom.open_bank": "Open Bank", + "item.markscustom.coinplatinum": "Platinum Coin", + "key.markscoins.open_bank": "Open Bank", + "item.markscoins.coinnetherite": "Netherite Coin", + "item.markscustom.coinwood": "Wood Coin", + "advancements.piggybank.descr": "Save up till you get a netherite coin", + "item.markscoins.coinamethyst": "Amethyst Coin", + "item.markscustom.coindiamond": "Diamond Coin", + "item.markscustom.coingold": "Gold Coin", + "item.markscoins.coinsapphire": "Sapphire Coin", + "advancements.piggybank.title": "Piggy Bank", + "advancements.starter.descr": "Get your first coins", + "item.markscustom.coinstone": "Stone Coin", + "item.markscustom.coincopper": "Copper Coin", + "item.markscustom.coinemerald": "Emerald Coin", + "item.markscoins.coiniron": "Iron Coin", + "item.markscustom.coinamethyst": "Amethyst Coin", + "item.markscoins.coingold": "Gold Coin", + "item.markscustom.coinruby": "Ruby Coin", + "advancements.starter.title": "Starting the Economy", + "item.markscoins.coinruby": "Ruby Coin", + "item.markscoins.coincopper": "Copper Coin", + "item.markscoins.coinplatinum": "Platinum Coin", + "item.markscoins.coinemerald": "Emerald Coin", + "item.markscoins.coinstone": "Stone Coin", + "item.markscoins.coinwood": "Wood Coin", + "item.markscoins.coindiamond": "Diamond Coin", + "item.markscustom.coiniron": "Iron Coin" + } + }, + "foldersRoot": { + "name": "~", + "children": [ + { + "name": "advancments", + "children": [] + }, + { + "name": "items", + "children": [] + }, + { + "name": "lootTable", + "children": [] + }, + { + "name": "procedures", + "children": [] + }, + { + "name": "recipes", + "children": [ + { + "name": "up", + "children": [] + }, + { + "name": "down", + "children": [] + }, + { + "name": "center", + "children": [] + } + ] + } + ] + }, + "workspaceSettings": { + "modid": "markscoins", + "modName": "Mark\u0027s Coins", + "version": "1.0.0", + "author": "marewey, MCreator", + "websiteURL": "https://mcreator.net", + "license": "Academic Free License v3.0", + "disableForgeVersionCheck": true, + "serverSideOnly": false, + "modPicture": "coin_diamond", + "requiredMods": [], + "dependencies": [], + "dependants": [], + "mcreatorDependencies": [], + "currentGenerator": "forge-1.16.5", + "credits": "Created using mod maker MCreator - https://mcreator.net/about", + "modElementsPackage": "net.rewey.markscoins", + "lockBaseModFiles": false + }, + "mcreatorVersion": 202100118117 +} \ No newline at end of file diff --git a/mcreator.gradle b/mcreator.gradle new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/net/rewey/markscoins/MarkscoinsMod.java b/src/main/java/net/rewey/markscoins/MarkscoinsMod.java new file mode 100644 index 0000000..0a83d01 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/MarkscoinsMod.java @@ -0,0 +1,100 @@ +/* + * MCreator note: + * + * If you lock base mod element files, you can edit this file and the proxy files + * and they won't get overwritten. If you change your mod package or modid, 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. + * + * Keep the MarkscoinsModElements object in this class and all calls to this object + * INTACT in order to preserve functionality of mod elements generated by MCreator. + * + * If you do not lock base mod element files in Workspace settings, this file + * will be REGENERATED on each build. + * + */ +package net.rewey.markscoins; + +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; + +import net.minecraftforge.fml.network.simple.SimpleChannel; +import net.minecraftforge.fml.network.NetworkRegistry; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.server.FMLServerStartingEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.item.Item; +import net.minecraft.entity.EntityType; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.block.Block; + +import java.util.function.Supplier; + +@Mod("markscoins") +public class MarkscoinsMod { + public static final Logger LOGGER = LogManager.getLogger(MarkscoinsMod.class); + private static final String PROTOCOL_VERSION = "1"; + public static final SimpleChannel PACKET_HANDLER = NetworkRegistry.newSimpleChannel(new ResourceLocation("markscoins", "markscoins"), + () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals); + public MarkscoinsModElements elements; + public MarkscoinsMod() { + elements = new MarkscoinsModElements(); + FMLJavaModLoadingContext.get().getModEventBus().register(this); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientLoad); + MinecraftForge.EVENT_BUS.register(new MarkscoinsModFMLBusEvents(this)); + } + + private void init(FMLCommonSetupEvent event) { + elements.getElements().forEach(element -> element.init(event)); + } + + public void clientLoad(FMLClientSetupEvent event) { + elements.getElements().forEach(element -> element.clientLoad(event)); + } + + @SubscribeEvent + public void registerBlocks(RegistryEvent.Register event) { + event.getRegistry().registerAll(elements.getBlocks().stream().map(Supplier::get).toArray(Block[]::new)); + } + + @SubscribeEvent + public void registerItems(RegistryEvent.Register event) { + event.getRegistry().registerAll(elements.getItems().stream().map(Supplier::get).toArray(Item[]::new)); + } + + @SubscribeEvent + public void registerEntities(RegistryEvent.Register> event) { + event.getRegistry().registerAll(elements.getEntities().stream().map(Supplier::get).toArray(EntityType[]::new)); + } + + @SubscribeEvent + public void registerEnchantments(RegistryEvent.Register event) { + event.getRegistry().registerAll(elements.getEnchantments().stream().map(Supplier::get).toArray(Enchantment[]::new)); + } + + @SubscribeEvent + public void registerSounds(RegistryEvent.Register event) { + elements.registerSounds(event); + } + private static class MarkscoinsModFMLBusEvents { + private final MarkscoinsMod parent; + MarkscoinsModFMLBusEvents(MarkscoinsMod parent) { + this.parent = parent; + } + + @SubscribeEvent + public void serverLoad(FMLServerStartingEvent event) { + this.parent.elements.getElements().forEach(element -> element.serverLoad(event)); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/MarkscoinsModElements.java b/src/main/java/net/rewey/markscoins/MarkscoinsModElements.java new file mode 100644 index 0000000..5ce074c --- /dev/null +++ b/src/main/java/net/rewey/markscoins/MarkscoinsModElements.java @@ -0,0 +1,126 @@ +/* + * MCreator note: + * + * This file is autogenerated to connect all MCreator mod elements together. + * + */ +package net.rewey.markscoins; + +import net.minecraftforge.forgespi.language.ModFileScanData; +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.event.server.FMLServerStartingEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.Tag; +import net.minecraft.network.PacketBuffer; +import net.minecraft.item.Item; +import net.minecraft.entity.EntityType; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.block.Block; + +import java.util.function.Supplier; +import java.util.function.Function; +import java.util.function.BiConsumer; +import java.util.Set; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.ArrayList; + +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Retention; + +public class MarkscoinsModElements { + public final List elements = new ArrayList<>(); + public final List> blocks = new ArrayList<>(); + public final List> items = new ArrayList<>(); + public final List>> entities = new ArrayList<>(); + public final List> enchantments = new ArrayList<>(); + public static Map sounds = new HashMap<>(); + public MarkscoinsModElements() { + try { + ModFileScanData modFileInfo = ModList.get().getModFileById("markscoins").getFile().getScanResult(); + Set annotations = modFileInfo.getAnnotations(); + for (ModFileScanData.AnnotationData annotationData : annotations) { + if (annotationData.getAnnotationType().getClassName().equals(ModElement.Tag.class.getName())) { + Class clazz = Class.forName(annotationData.getClassType().getClassName()); + if (clazz.getSuperclass() == MarkscoinsModElements.ModElement.class) + elements.add((MarkscoinsModElements.ModElement) clazz.getConstructor(this.getClass()).newInstance(this)); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + Collections.sort(elements); + elements.forEach(MarkscoinsModElements.ModElement::initElements); + MinecraftForge.EVENT_BUS.register(new MarkscoinsModVariables(this)); + } + + public void registerSounds(RegistryEvent.Register event) { + for (Map.Entry sound : sounds.entrySet()) + event.getRegistry().register(sound.getValue().setRegistryName(sound.getKey())); + } + private int messageID = 0; + public void addNetworkMessage(Class messageType, BiConsumer encoder, Function decoder, + BiConsumer> messageConsumer) { + MarkscoinsMod.PACKET_HANDLER.registerMessage(messageID, messageType, encoder, decoder, messageConsumer); + messageID++; + } + + public List getElements() { + return elements; + } + + public List> getBlocks() { + return blocks; + } + + public List> getItems() { + return items; + } + + public List>> getEntities() { + return entities; + } + + public List> getEnchantments() { + return enchantments; + } + public static class ModElement implements Comparable { + @Retention(RetentionPolicy.RUNTIME) + public @interface Tag { + } + protected final MarkscoinsModElements elements; + protected final int sortid; + public ModElement(MarkscoinsModElements elements, int sortid) { + this.elements = elements; + this.sortid = sortid; + } + + public void initElements() { + } + + public void init(FMLCommonSetupEvent event) { + } + + public void serverLoad(FMLServerStartingEvent event) { + } + + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + } + + @Override + public int compareTo(ModElement other) { + return this.sortid - other.sortid; + } + } +} diff --git a/src/main/java/net/rewey/markscoins/MarkscoinsModVariables.java b/src/main/java/net/rewey/markscoins/MarkscoinsModVariables.java new file mode 100644 index 0000000..bfb42ba --- /dev/null +++ b/src/main/java/net/rewey/markscoins/MarkscoinsModVariables.java @@ -0,0 +1,161 @@ +package net.rewey.markscoins; + +import net.minecraftforge.fml.network.PacketDistributor; +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.event.AttachCapabilitiesEvent; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.common.capabilities.ICapabilitySerializable; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.common.capabilities.CapabilityInject; +import net.minecraftforge.common.capabilities.Capability; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Direction; +import net.minecraft.network.PacketBuffer; +import net.minecraft.nbt.INBT; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.Minecraft; + +import java.util.function.Supplier; + +public class MarkscoinsModVariables { + public MarkscoinsModVariables(MarkscoinsModElements elements) { + elements.addNetworkMessage(PlayerVariablesSyncMessage.class, PlayerVariablesSyncMessage::buffer, PlayerVariablesSyncMessage::new, + PlayerVariablesSyncMessage::handler); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init); + } + + private void init(FMLCommonSetupEvent event) { + CapabilityManager.INSTANCE.register(PlayerVariables.class, new PlayerVariablesStorage(), PlayerVariables::new); + } + @CapabilityInject(PlayerVariables.class) + public static Capability PLAYER_VARIABLES_CAPABILITY = null; + @SubscribeEvent + public void onAttachCapabilities(AttachCapabilitiesEvent event) { + if (event.getObject() instanceof PlayerEntity && !(event.getObject() instanceof FakePlayer)) + event.addCapability(new ResourceLocation("markscoins", "player_variables"), new PlayerVariablesProvider()); + } + private static class PlayerVariablesProvider implements ICapabilitySerializable { + private final LazyOptional instance = LazyOptional.of(PLAYER_VARIABLES_CAPABILITY::getDefaultInstance); + @Override + public LazyOptional getCapability(Capability cap, Direction side) { + return cap == PLAYER_VARIABLES_CAPABILITY ? instance.cast() : LazyOptional.empty(); + } + + @Override + public INBT serializeNBT() { + return PLAYER_VARIABLES_CAPABILITY.getStorage().writeNBT(PLAYER_VARIABLES_CAPABILITY, this.instance.orElseThrow(RuntimeException::new), + null); + } + + @Override + public void deserializeNBT(INBT nbt) { + PLAYER_VARIABLES_CAPABILITY.getStorage().readNBT(PLAYER_VARIABLES_CAPABILITY, this.instance.orElseThrow(RuntimeException::new), null, + nbt); + } + } + + private static class PlayerVariablesStorage implements Capability.IStorage { + @Override + public INBT writeNBT(Capability capability, PlayerVariables instance, Direction side) { + CompoundNBT nbt = new CompoundNBT(); + nbt.putDouble("money", instance.money); + nbt.putDouble("transfer", instance.transfer); + nbt.putDouble("display", instance.display); + nbt.putString("money_disp", instance.money_disp); + return nbt; + } + + @Override + public void readNBT(Capability capability, PlayerVariables instance, Direction side, INBT inbt) { + CompoundNBT nbt = (CompoundNBT) inbt; + instance.money = nbt.getDouble("money"); + instance.transfer = nbt.getDouble("transfer"); + instance.display = nbt.getDouble("display"); + instance.money_disp = nbt.getString("money_disp"); + } + } + + public static class PlayerVariables { + public double money = 0; + public double transfer = 0; + public double display = 0; + public String money_disp = "0 PC"; + public void syncPlayerVariables(Entity entity) { + if (entity instanceof ServerPlayerEntity) + MarkscoinsMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) entity), + new PlayerVariablesSyncMessage(this)); + } + } + @SubscribeEvent + public void onPlayerLoggedInSyncPlayerVariables(PlayerEvent.PlayerLoggedInEvent event) { + if (!event.getPlayer().world.isRemote()) + ((PlayerVariables) event.getPlayer().getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables())) + .syncPlayerVariables(event.getPlayer()); + } + + @SubscribeEvent + public void onPlayerRespawnedSyncPlayerVariables(PlayerEvent.PlayerRespawnEvent event) { + if (!event.getPlayer().world.isRemote()) + ((PlayerVariables) event.getPlayer().getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables())) + .syncPlayerVariables(event.getPlayer()); + } + + @SubscribeEvent + public void onPlayerChangedDimensionSyncPlayerVariables(PlayerEvent.PlayerChangedDimensionEvent event) { + if (!event.getPlayer().world.isRemote()) + ((PlayerVariables) event.getPlayer().getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables())) + .syncPlayerVariables(event.getPlayer()); + } + + @SubscribeEvent + public void clonePlayer(PlayerEvent.Clone event) { + PlayerVariables original = ((PlayerVariables) event.getOriginal().getCapability(PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new PlayerVariables())); + PlayerVariables clone = ((PlayerVariables) event.getEntity().getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables())); + clone.money = original.money; + clone.transfer = original.transfer; + clone.display = original.display; + clone.money_disp = original.money_disp; + if (!event.isWasDeath()) { + } + } + public static class PlayerVariablesSyncMessage { + public PlayerVariables data; + public PlayerVariablesSyncMessage(PacketBuffer buffer) { + this.data = new PlayerVariables(); + new PlayerVariablesStorage().readNBT(null, this.data, null, buffer.readCompoundTag()); + } + + public PlayerVariablesSyncMessage(PlayerVariables data) { + this.data = data; + } + + public static void buffer(PlayerVariablesSyncMessage message, PacketBuffer buffer) { + buffer.writeCompoundTag((CompoundNBT) new PlayerVariablesStorage().writeNBT(null, message.data, null)); + } + + public static void handler(PlayerVariablesSyncMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + if (!context.getDirection().getReceptionSide().isServer()) { + PlayerVariables variables = ((PlayerVariables) Minecraft.getInstance().player.getCapability(PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new PlayerVariables())); + variables.money = message.data.money; + variables.transfer = message.data.transfer; + variables.display = message.data.display; + variables.money_disp = message.data.money_disp; + } + }); + context.setPacketHandled(true); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/gui/BankGUIGui.java b/src/main/java/net/rewey/markscoins/gui/BankGUIGui.java new file mode 100644 index 0000000..d219ea8 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/gui/BankGUIGui.java @@ -0,0 +1,448 @@ + +package net.rewey.markscoins.gui; + +import net.rewey.markscoins.procedures.BankTransferProcedure; +import net.rewey.markscoins.procedures.BankOutputCalcProcedure; +import net.rewey.markscoins.procedures.BankInputCalcProcedure; +import net.rewey.markscoins.MarkscoinsModElements; +import net.rewey.markscoins.MarkscoinsMod; + +import net.minecraftforge.items.SlotItemHandler; +import net.minecraftforge.items.ItemStackHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.network.IContainerFactory; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.DeferredWorkQueue; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.network.PacketBuffer; +import net.minecraft.item.ItemStack; +import net.minecraft.inventory.container.Slot; +import net.minecraft.inventory.container.ContainerType; +import net.minecraft.inventory.container.Container; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.gui.ScreenManager; + +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; + +@MarkscoinsModElements.ModElement.Tag +public class BankGUIGui extends MarkscoinsModElements.ModElement { + public static HashMap guistate = new HashMap(); + private static ContainerType containerType = null; + public BankGUIGui(MarkscoinsModElements instance) { + super(instance, 51); + elements.addNetworkMessage(ButtonPressedMessage.class, ButtonPressedMessage::buffer, ButtonPressedMessage::new, + ButtonPressedMessage::handler); + elements.addNetworkMessage(GUISlotChangedMessage.class, GUISlotChangedMessage::buffer, GUISlotChangedMessage::new, + GUISlotChangedMessage::handler); + containerType = new ContainerType<>(new GuiContainerModFactory()); + FMLJavaModLoadingContext.get().getModEventBus().register(new ContainerRegisterHandler()); + MinecraftForge.EVENT_BUS.register(this); + } + private static class ContainerRegisterHandler { + @SubscribeEvent + public void registerContainer(RegistryEvent.Register> event) { + event.getRegistry().register(containerType.setRegistryName("bank_gui")); + } + } + @OnlyIn(Dist.CLIENT) + public void initElements() { + DeferredWorkQueue.runLater(() -> ScreenManager.registerFactory(containerType, BankGUIGuiWindow::new)); + } + + @SubscribeEvent + public void onPlayerTick(TickEvent.PlayerTickEvent event) { + PlayerEntity entity = event.player; + if (event.phase == TickEvent.Phase.END && entity.openContainer instanceof GuiContainerMod) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + { + Map $_dependencies = new HashMap<>(); + $_dependencies.put("entity", entity); + BankOutputCalcProcedure.executeProcedure($_dependencies); + } + } + } + public static class GuiContainerModFactory implements IContainerFactory { + public GuiContainerMod create(int id, PlayerInventory inv, PacketBuffer extraData) { + return new GuiContainerMod(id, inv, extraData); + } + } + + public static class GuiContainerMod extends Container implements Supplier> { + World world; + PlayerEntity entity; + int x, y, z; + private IItemHandler internal; + private Map customSlots = new HashMap<>(); + private boolean bound = false; + public GuiContainerMod(int id, PlayerInventory inv, PacketBuffer extraData) { + super(containerType, id); + this.entity = inv.player; + this.world = inv.player.world; + this.internal = new ItemStackHandler(2); + BlockPos pos = null; + if (extraData != null) { + pos = extraData.readBlockPos(); + this.x = pos.getX(); + this.y = pos.getY(); + this.z = pos.getZ(); + } + if (pos != null) { + if (extraData.readableBytes() == 1) { // bound to item + byte hand = extraData.readByte(); + ItemStack itemstack; + if (hand == 0) + itemstack = this.entity.getHeldItemMainhand(); + else + itemstack = this.entity.getHeldItemOffhand(); + itemstack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> { + this.internal = capability; + this.bound = true; + }); + } else if (extraData.readableBytes() > 1) { + extraData.readByte(); // drop padding + Entity entity = world.getEntityByID(extraData.readVarInt()); + if (entity != null) + entity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> { + this.internal = capability; + this.bound = true; + }); + } else { // might be bound to block + TileEntity ent = inv.player != null ? inv.player.world.getTileEntity(pos) : null; + if (ent != null) { + ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> { + this.internal = capability; + this.bound = true; + }); + } + } + } + this.customSlots.put(0, this.addSlot(new SlotItemHandler(internal, 0, 24, 53) { + @Override + public void onSlotChanged() { + super.onSlotChanged(); + GuiContainerMod.this.slotChanged(0, 0, 0); + } + })); + this.customSlots.put(1, this.addSlot(new SlotItemHandler(internal, 1, 132, 53) { + @Override + public boolean canTakeStack(PlayerEntity player) { + return false; + } + + @Override + public ItemStack onTake(PlayerEntity entity, ItemStack stack) { + ItemStack retval = super.onTake(entity, stack); + GuiContainerMod.this.slotChanged(1, 1, 0); + return retval; + } + + @Override + public boolean isItemValid(ItemStack stack) { + return false; + } + })); + int si; + int sj; + for (si = 0; si < 3; ++si) + for (sj = 0; sj < 9; ++sj) + this.addSlot(new Slot(inv, sj + (si + 1) * 9, 0 + 8 + sj * 18, 0 + 84 + si * 18)); + for (si = 0; si < 9; ++si) + this.addSlot(new Slot(inv, si, 0 + 8 + si * 18, 0 + 142)); + } + + public Map get() { + return customSlots; + } + + @Override + public boolean canInteractWith(PlayerEntity player) { + return true; + } + + @Override + public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) { + ItemStack itemstack = ItemStack.EMPTY; + Slot slot = (Slot) this.inventorySlots.get(index); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (index < 2) { + if (!this.mergeItemStack(itemstack1, 2, this.inventorySlots.size(), true)) { + return ItemStack.EMPTY; + } + slot.onSlotChange(itemstack1, itemstack); + } else if (!this.mergeItemStack(itemstack1, 0, 2, false)) { + if (index < 2 + 27) { + if (!this.mergeItemStack(itemstack1, 2 + 27, this.inventorySlots.size(), true)) { + return ItemStack.EMPTY; + } + } else { + if (!this.mergeItemStack(itemstack1, 2, 2 + 27, false)) { + return ItemStack.EMPTY; + } + } + return ItemStack.EMPTY; + } + if (itemstack1.getCount() == 0) { + slot.putStack(ItemStack.EMPTY); + } else { + slot.onSlotChanged(); + } + if (itemstack1.getCount() == itemstack.getCount()) { + return ItemStack.EMPTY; + } + slot.onTake(playerIn, itemstack1); + } + return itemstack; + } + + @Override /** + * Merges provided ItemStack with the first avaliable one in the + * container/player inventor between minIndex (included) and maxIndex + * (excluded). Args : stack, minIndex, maxIndex, negativDirection. /!\ the + * Container implementation do not check if the item is valid for the slot + */ + protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean reverseDirection) { + boolean flag = false; + int i = startIndex; + if (reverseDirection) { + i = endIndex - 1; + } + if (stack.isStackable()) { + while (!stack.isEmpty()) { + if (reverseDirection) { + if (i < startIndex) { + break; + } + } else if (i >= endIndex) { + break; + } + Slot slot = this.inventorySlots.get(i); + ItemStack itemstack = slot.getStack(); + if (slot.isItemValid(itemstack) && !itemstack.isEmpty() && areItemsAndTagsEqual(stack, itemstack)) { + int j = itemstack.getCount() + stack.getCount(); + int maxSize = Math.min(slot.getSlotStackLimit(), stack.getMaxStackSize()); + if (j <= maxSize) { + stack.setCount(0); + itemstack.setCount(j); + slot.putStack(itemstack); + flag = true; + } else if (itemstack.getCount() < maxSize) { + stack.shrink(maxSize - itemstack.getCount()); + itemstack.setCount(maxSize); + slot.putStack(itemstack); + flag = true; + } + } + if (reverseDirection) { + --i; + } else { + ++i; + } + } + } + if (!stack.isEmpty()) { + if (reverseDirection) { + i = endIndex - 1; + } else { + i = startIndex; + } + while (true) { + if (reverseDirection) { + if (i < startIndex) { + break; + } + } else if (i >= endIndex) { + break; + } + Slot slot1 = this.inventorySlots.get(i); + ItemStack itemstack1 = slot1.getStack(); + if (itemstack1.isEmpty() && slot1.isItemValid(stack)) { + if (stack.getCount() > slot1.getSlotStackLimit()) { + slot1.putStack(stack.split(slot1.getSlotStackLimit())); + } else { + slot1.putStack(stack.split(stack.getCount())); + } + slot1.onSlotChanged(); + flag = true; + break; + } + if (reverseDirection) { + --i; + } else { + ++i; + } + } + } + return flag; + } + + @Override + public void onContainerClosed(PlayerEntity playerIn) { + super.onContainerClosed(playerIn); + if (!bound && (playerIn instanceof ServerPlayerEntity)) { + if (!playerIn.isAlive() || playerIn instanceof ServerPlayerEntity && ((ServerPlayerEntity) playerIn).hasDisconnected()) { + for (int j = 0; j < internal.getSlots(); ++j) { + if (j == 0) + continue; + if (j == 1) + continue; + playerIn.dropItem(internal.extractItem(j, internal.getStackInSlot(j).getCount(), false), false); + } + } else { + for (int i = 0; i < internal.getSlots(); ++i) { + if (i == 0) + continue; + if (i == 1) + continue; + playerIn.inventory.placeItemBackInInventory(playerIn.world, + internal.extractItem(i, internal.getStackInSlot(i).getCount(), false)); + } + } + } + } + + private void slotChanged(int slotid, int ctype, int meta) { + if (this.world != null && this.world.isRemote()) { + MarkscoinsMod.PACKET_HANDLER.sendToServer(new GUISlotChangedMessage(slotid, x, y, z, ctype, meta)); + handleSlotAction(entity, slotid, ctype, meta, x, y, z); + } + } + } + + public static class ButtonPressedMessage { + int buttonID, x, y, z; + public ButtonPressedMessage(PacketBuffer buffer) { + this.buttonID = buffer.readInt(); + this.x = buffer.readInt(); + this.y = buffer.readInt(); + this.z = buffer.readInt(); + } + + public ButtonPressedMessage(int buttonID, int x, int y, int z) { + this.buttonID = buttonID; + this.x = x; + this.y = y; + this.z = z; + } + + public static void buffer(ButtonPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.buttonID); + buffer.writeInt(message.x); + buffer.writeInt(message.y); + buffer.writeInt(message.z); + } + + public static void handler(ButtonPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + PlayerEntity 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 class GUISlotChangedMessage { + int slotID, x, y, z, changeType, meta; + public GUISlotChangedMessage(int slotID, int x, int y, int z, int changeType, int meta) { + this.slotID = slotID; + this.x = x; + this.y = y; + this.z = z; + this.changeType = changeType; + this.meta = meta; + } + + public GUISlotChangedMessage(PacketBuffer buffer) { + this.slotID = buffer.readInt(); + this.x = buffer.readInt(); + this.y = buffer.readInt(); + this.z = buffer.readInt(); + this.changeType = buffer.readInt(); + this.meta = buffer.readInt(); + } + + public static void buffer(GUISlotChangedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.slotID); + buffer.writeInt(message.x); + buffer.writeInt(message.y); + buffer.writeInt(message.z); + buffer.writeInt(message.changeType); + buffer.writeInt(message.meta); + } + + public static void handler(GUISlotChangedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + PlayerEntity entity = context.getSender(); + int slotID = message.slotID; + int changeType = message.changeType; + int meta = message.meta; + int x = message.x; + int y = message.y; + int z = message.z; + handleSlotAction(entity, slotID, changeType, meta, x, y, z); + }); + context.setPacketHandled(true); + } + } + static void handleButtonAction(PlayerEntity entity, int buttonID, int x, int y, int z) { + World world = entity.world; + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (buttonID == 0) { + { + Map $_dependencies = new HashMap<>(); + $_dependencies.put("entity", entity); + BankTransferProcedure.executeProcedure($_dependencies); + } + } + } + + private static void handleSlotAction(PlayerEntity entity, int slotID, int changeType, int meta, int x, int y, int z) { + World world = entity.world; + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (slotID == 0 && changeType == 0) { + { + Map $_dependencies = new HashMap<>(); + $_dependencies.put("entity", entity); + $_dependencies.put("world", world); + BankInputCalcProcedure.executeProcedure($_dependencies); + } + } + if (slotID == 1 && changeType == 1) { + { + Map $_dependencies = new HashMap<>(); + $_dependencies.put("entity", entity); + BankOutputCalcProcedure.executeProcedure($_dependencies); + } + } + } +} diff --git a/src/main/java/net/rewey/markscoins/gui/BankGUIGuiWindow.java b/src/main/java/net/rewey/markscoins/gui/BankGUIGuiWindow.java new file mode 100644 index 0000000..12d14d8 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/gui/BankGUIGuiWindow.java @@ -0,0 +1,100 @@ + +package net.rewey.markscoins.gui; + +import net.rewey.markscoins.MarkscoinsModVariables; +import net.rewey.markscoins.MarkscoinsMod; + +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.gui.widget.button.Button; +import net.minecraft.client.gui.screen.inventory.ContainerScreen; +import net.minecraft.client.Minecraft; + +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class BankGUIGuiWindow extends ContainerScreen { + private World world; + private int x, y, z; + private PlayerEntity entity; + public BankGUIGuiWindow(BankGUIGui.GuiContainerMod container, PlayerInventory inventory, ITextComponent 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.xSize = 176; + this.ySize = 166; + } + private static final ResourceLocation texture = new ResourceLocation("markscoins:textures/bank_gui.png"); + @Override + public void render(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { + this.renderBackground(ms); + super.render(ms, mouseX, mouseY, partialTicks); + this.renderHoveredTooltip(ms, mouseX, mouseY); + } + + @Override + protected void drawGuiContainerBackgroundLayer(MatrixStack ms, float partialTicks, int gx, int gy) { + RenderSystem.color4f(1, 1, 1, 1); + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + Minecraft.getInstance().getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.blit(ms, k, l, 0, 0, this.xSize, this.ySize, this.xSize, this.ySize); + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("markscoins:textures/cashout.png")); + this.blit(ms, this.guiLeft + 70, this.guiTop + 40, 0, 0, 32, 32, 32, 32); + RenderSystem.disableBlend(); + } + + @Override + public boolean keyPressed(int key, int b, int c) { + if (key == 256) { + this.minecraft.player.closeScreen(); + return true; + } + return super.keyPressed(key, b, c); + } + + @Override + public void tick() { + super.tick(); + } + + @Override + protected void drawGuiContainerForegroundLayer(MatrixStack ms, int mouseX, int mouseY) { + this.font.drawString(ms, "Balance", 5, 5, -16777216); + this.font.drawString(ms, "" + ((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money_disp) + "", 4, 16, -16777215); + this.font.drawString(ms, "Deposit", 14, 41, -12829636); + this.font.drawString(ms, "Withdraw", 119, 41, -12829636); + } + + @Override + public void onClose() { + super.onClose(); + Minecraft.getInstance().keyboardListener.enableRepeatEvents(false); + } + + @Override + public void init(Minecraft minecraft, int width, int height) { + super.init(minecraft, width, height); + minecraft.keyboardListener.enableRepeatEvents(true); + this.addButton(new Button(this.guiLeft + 125, this.guiTop + 16, 30, 20, new StringTextComponent("Take"), e -> { + if (true) { + MarkscoinsMod.PACKET_HANDLER.sendToServer(new BankGUIGui.ButtonPressedMessage(0, x, y, z)); + BankGUIGui.handleButtonAction(entity, 0, x, y, z); + } + })); + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoinamethystItem.java b/src/main/java/net/rewey/markscoins/item/CoinamethystItem.java new file mode 100644 index 0000000..7aa0446 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoinamethystItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoinamethystItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coinamethyst") + public static final Item block = null; + public CoinamethystItem(MarkscoinsModElements instance) { + super(instance, 7); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).isImmuneToFire().rarity(Rarity.RARE)); + setRegistryName("coinamethyst"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("4,096PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoincopperItem.java b/src/main/java/net/rewey/markscoins/item/CoincopperItem.java new file mode 100644 index 0000000..bbb23ba --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoincopperItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoincopperItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coincopper") + public static final Item block = null; + public CoincopperItem(MarkscoinsModElements instance) { + super(instance, 4); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).rarity(Rarity.COMMON)); + setRegistryName("coincopper"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("16PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoindiamondItem.java b/src/main/java/net/rewey/markscoins/item/CoindiamondItem.java new file mode 100644 index 0000000..e3cb362 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoindiamondItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoindiamondItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coindiamond") + public static final Item block = null; + public CoindiamondItem(MarkscoinsModElements instance) { + super(instance, 10); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).isImmuneToFire().rarity(Rarity.EPIC)); + setRegistryName("coindiamond"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("1,048,576PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoinemeraldItem.java b/src/main/java/net/rewey/markscoins/item/CoinemeraldItem.java new file mode 100644 index 0000000..281b1d1 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoinemeraldItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoinemeraldItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coinemerald") + public static final Item block = null; + public CoinemeraldItem(MarkscoinsModElements instance) { + super(instance, 11); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).isImmuneToFire().rarity(Rarity.EPIC)); + setRegistryName("coinemerald"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("65,536PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoingoldItem.java b/src/main/java/net/rewey/markscoins/item/CoingoldItem.java new file mode 100644 index 0000000..1c34423 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoingoldItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoingoldItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coingold") + public static final Item block = null; + public CoingoldItem(MarkscoinsModElements instance) { + super(instance, 6); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).rarity(Rarity.UNCOMMON)); + setRegistryName("coingold"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("256PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoinironItem.java b/src/main/java/net/rewey/markscoins/item/CoinironItem.java new file mode 100644 index 0000000..a1b1b1b --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoinironItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoinironItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coiniron") + public static final Item block = null; + public CoinironItem(MarkscoinsModElements instance) { + super(instance, 5); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).rarity(Rarity.UNCOMMON)); + setRegistryName("coiniron"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("64PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoinnetheriteItem.java b/src/main/java/net/rewey/markscoins/item/CoinnetheriteItem.java new file mode 100644 index 0000000..a526f12 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoinnetheriteItem.java @@ -0,0 +1,66 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoinnetheriteItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coinnetherite") + public static final Item block = null; + public CoinnetheriteItem(MarkscoinsModElements instance) { + super(instance, 30); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).isImmuneToFire().rarity(Rarity.EPIC)); + setRegistryName("coinnetherite"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + @OnlyIn(Dist.CLIENT) + public boolean hasEffect(ItemStack itemstack) { + return true; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("4,194,304PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoinplatinumItem.java b/src/main/java/net/rewey/markscoins/item/CoinplatinumItem.java new file mode 100644 index 0000000..dd0cc80 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoinplatinumItem.java @@ -0,0 +1,66 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoinplatinumItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coinplatinum") + public static final Item block = null; + public CoinplatinumItem(MarkscoinsModElements instance) { + super(instance, 49); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).isImmuneToFire().rarity(Rarity.UNCOMMON)); + setRegistryName("coinplatinum"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + @OnlyIn(Dist.CLIENT) + public boolean hasEffect(ItemStack itemstack) { + return true; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("1,024PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoinrubyItem.java b/src/main/java/net/rewey/markscoins/item/CoinrubyItem.java new file mode 100644 index 0000000..c43ac81 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoinrubyItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoinrubyItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coinruby") + public static final Item block = null; + public CoinrubyItem(MarkscoinsModElements instance) { + super(instance, 9); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).isImmuneToFire().rarity(Rarity.EPIC)); + setRegistryName("coinruby"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("262,144PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoinsapphireItem.java b/src/main/java/net/rewey/markscoins/item/CoinsapphireItem.java new file mode 100644 index 0000000..aa15094 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoinsapphireItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoinsapphireItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coinsapphire") + public static final Item block = null; + public CoinsapphireItem(MarkscoinsModElements instance) { + super(instance, 8); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).isImmuneToFire().rarity(Rarity.RARE)); + setRegistryName("coinsapphire"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("16,384PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoinstoneItem.java b/src/main/java/net/rewey/markscoins/item/CoinstoneItem.java new file mode 100644 index 0000000..0d72892 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoinstoneItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoinstoneItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coinstone") + public static final Item block = null; + public CoinstoneItem(MarkscoinsModElements instance) { + super(instance, 2); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).rarity(Rarity.COMMON)); + setRegistryName("coinstone"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("4PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/item/CoinwoodItem.java b/src/main/java/net/rewey/markscoins/item/CoinwoodItem.java new file mode 100644 index 0000000..30878ca --- /dev/null +++ b/src/main/java/net/rewey/markscoins/item/CoinwoodItem.java @@ -0,0 +1,58 @@ + +package net.rewey.markscoins.item; + +import net.rewey.markscoins.MarkscoinsModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.List; + +@MarkscoinsModElements.ModElement.Tag +public class CoinwoodItem extends MarkscoinsModElements.ModElement { + @ObjectHolder("markscoins:coinwood") + public static final Item block = null; + public CoinwoodItem(MarkscoinsModElements instance) { + super(instance, 1); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(null).maxStackSize(64).rarity(Rarity.COMMON)); + setRegistryName("coinwood"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getUseDuration(ItemStack itemstack) { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("1PC")); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/keybind/OpenBankKeyBinding.java b/src/main/java/net/rewey/markscoins/keybind/OpenBankKeyBinding.java new file mode 100644 index 0000000..acc00f9 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/keybind/OpenBankKeyBinding.java @@ -0,0 +1,104 @@ + +package net.rewey.markscoins.keybind; + +import org.lwjgl.glfw.GLFW; + +import net.rewey.markscoins.procedures.BankOpenGUIProcedure; +import net.rewey.markscoins.MarkscoinsModElements; +import net.rewey.markscoins.MarkscoinsMod; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; + +@MarkscoinsModElements.ModElement.Tag +public class OpenBankKeyBinding extends MarkscoinsModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + public OpenBankKeyBinding(MarkscoinsModElements instance) { + super(instance, 54); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.markscoins.open_bank", GLFW.GLFW_KEY_RIGHT_CONTROL, "key.categories.misc"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + MarkscoinsMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + } + } + } + } + public static class KeyBindingPressedMessage { + int type, pressedms; + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + { + Map $_dependencies = new HashMap<>(); + $_dependencies.put("entity", entity); + $_dependencies.put("x", x); + $_dependencies.put("y", y); + $_dependencies.put("z", z); + $_dependencies.put("world", world); + BankOpenGUIProcedure.executeProcedure($_dependencies); + } + } + } +} diff --git a/src/main/java/net/rewey/markscoins/procedures/BankInputCalcProcedure.java b/src/main/java/net/rewey/markscoins/procedures/BankInputCalcProcedure.java new file mode 100644 index 0000000..6eae2e4 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/procedures/BankInputCalcProcedure.java @@ -0,0 +1,655 @@ +package net.rewey.markscoins.procedures; + +import net.rewey.markscoins.item.CoinwoodItem; +import net.rewey.markscoins.item.CoinstoneItem; +import net.rewey.markscoins.item.CoinsapphireItem; +import net.rewey.markscoins.item.CoinrubyItem; +import net.rewey.markscoins.item.CoinplatinumItem; +import net.rewey.markscoins.item.CoinnetheriteItem; +import net.rewey.markscoins.item.CoinironItem; +import net.rewey.markscoins.item.CoingoldItem; +import net.rewey.markscoins.item.CoinemeraldItem; +import net.rewey.markscoins.item.CoindiamondItem; +import net.rewey.markscoins.item.CoincopperItem; +import net.rewey.markscoins.item.CoinamethystItem; +import net.rewey.markscoins.MarkscoinsModVariables; +import net.rewey.markscoins.MarkscoinsModElements; +import net.rewey.markscoins.MarkscoinsMod; + +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.IWorld; +import net.minecraft.item.ItemStack; +import net.minecraft.inventory.container.Slot; +import net.minecraft.inventory.container.Container; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.Entity; + +import java.util.function.Supplier; +import java.util.Map; + +@MarkscoinsModElements.ModElement.Tag +public class BankInputCalcProcedure extends MarkscoinsModElements.ModElement { + public BankInputCalcProcedure(MarkscoinsModElements instance) { + super(instance, 59); + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + MarkscoinsMod.LOGGER.warn("Failed to load dependency entity for procedure BankInputCalc!"); + return; + } + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + MarkscoinsMod.LOGGER.warn("Failed to load dependency world for procedure BankInputCalc!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + IWorld world = (IWorld) dependencies.get("world"); + new Object() { + private int ticks = 0; + private float waitTicks; + private IWorld world; + public void start(IWorld world, int waitTicks) { + this.waitTicks = waitTicks; + MinecraftForge.EVENT_BUS.register(this); + this.world = world; + } + + @SubscribeEvent + public void tick(TickEvent.ServerTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + this.ticks += 1; + if (this.ticks >= this.waitTicks) + run(); + } + } + + private void run() { + if ((new ItemStack(CoinwoodItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + (new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0)))); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoinstoneItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 4)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoincopperItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 16)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoinironItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 64)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoingoldItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 256)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoinplatinumItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 1024)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoinamethystItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 4096)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoinsapphireItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 16384)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoinemeraldItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 65536)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoinrubyItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 262144)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoindiamondItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 1048576)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else if ((new ItemStack(CoinnetheriteItem.block, (int) (1)).getItem() == (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (0))).getItem())) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + ((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (0))) * 4194304)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (0))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } else { + System.out.println("Invalid Input"); + } + MinecraftForge.EVENT_BUS.unregister(this); + } + }.start(world, (int) 1); + } +} diff --git a/src/main/java/net/rewey/markscoins/procedures/BankOpenGUIProcedure.java b/src/main/java/net/rewey/markscoins/procedures/BankOpenGUIProcedure.java new file mode 100644 index 0000000..1562bb2 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/procedures/BankOpenGUIProcedure.java @@ -0,0 +1,80 @@ +package net.rewey.markscoins.procedures; + +import net.rewey.markscoins.gui.BankGUIGui; +import net.rewey.markscoins.MarkscoinsModElements; +import net.rewey.markscoins.MarkscoinsMod; + +import net.minecraftforge.fml.network.NetworkHooks; + +import net.minecraft.world.IWorld; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.inventory.container.INamedContainerProvider; +import net.minecraft.inventory.container.Container; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; + +import java.util.Map; + +import io.netty.buffer.Unpooled; + +@MarkscoinsModElements.ModElement.Tag +public class BankOpenGUIProcedure extends MarkscoinsModElements.ModElement { + public BankOpenGUIProcedure(MarkscoinsModElements instance) { + super(instance, 62); + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + MarkscoinsMod.LOGGER.warn("Failed to load dependency entity for procedure BankOpenGUI!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + MarkscoinsMod.LOGGER.warn("Failed to load dependency x for procedure BankOpenGUI!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + MarkscoinsMod.LOGGER.warn("Failed to load dependency y for procedure BankOpenGUI!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + MarkscoinsMod.LOGGER.warn("Failed to load dependency z for procedure BankOpenGUI!"); + return; + } + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + MarkscoinsMod.LOGGER.warn("Failed to load dependency world for procedure BankOpenGUI!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + IWorld world = (IWorld) dependencies.get("world"); + { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + BlockPos _bpos = new BlockPos((int) x, (int) (y + 1), (int) z); + NetworkHooks.openGui((ServerPlayerEntity) _ent, new INamedContainerProvider() { + @Override + public ITextComponent getDisplayName() { + return new StringTextComponent("BankGUI"); + } + + @Override + public Container createMenu(int id, PlayerInventory inventory, PlayerEntity player) { + return new BankGUIGui.GuiContainerMod(id, inventory, new PacketBuffer(Unpooled.buffer()).writeBlockPos(_bpos)); + } + }, _bpos); + } + } + } +} diff --git a/src/main/java/net/rewey/markscoins/procedures/BankOutputCalcProcedure.java b/src/main/java/net/rewey/markscoins/procedures/BankOutputCalcProcedure.java new file mode 100644 index 0000000..8224c86 --- /dev/null +++ b/src/main/java/net/rewey/markscoins/procedures/BankOutputCalcProcedure.java @@ -0,0 +1,537 @@ +package net.rewey.markscoins.procedures; + +import net.rewey.markscoins.item.CoinwoodItem; +import net.rewey.markscoins.item.CoinstoneItem; +import net.rewey.markscoins.item.CoinsapphireItem; +import net.rewey.markscoins.item.CoinrubyItem; +import net.rewey.markscoins.item.CoinplatinumItem; +import net.rewey.markscoins.item.CoinnetheriteItem; +import net.rewey.markscoins.item.CoinironItem; +import net.rewey.markscoins.item.CoingoldItem; +import net.rewey.markscoins.item.CoinemeraldItem; +import net.rewey.markscoins.item.CoindiamondItem; +import net.rewey.markscoins.item.CoincopperItem; +import net.rewey.markscoins.item.CoinamethystItem; +import net.rewey.markscoins.MarkscoinsModVariables; +import net.rewey.markscoins.MarkscoinsModElements; +import net.rewey.markscoins.MarkscoinsMod; + +import net.minecraft.item.ItemStack; +import net.minecraft.inventory.container.Slot; +import net.minecraft.inventory.container.Container; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; + +import java.util.function.Supplier; +import java.util.Map; + +@MarkscoinsModElements.ModElement.Tag +public class BankOutputCalcProcedure extends MarkscoinsModElements.ModElement { + public BankOutputCalcProcedure(MarkscoinsModElements instance) { + super(instance, 60); + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + MarkscoinsMod.LOGGER.warn("Failed to load dependency entity for procedure BankOutputCalc!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((0 < ((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money))) { + if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 4)) { + { + double _setval = (double) Math.floor(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoinwoodItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 16)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 4)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 4)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoinstoneItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 64)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 16)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 16)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoincopperItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 256)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 64)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 64)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoinironItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 1024)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 256)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 256)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoingoldItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 4096)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 1024)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 1024)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoinplatinumItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 16384)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 4096)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 4096)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoinamethystItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 65536)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 16384)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 16384)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoinsapphireItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 262144)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 65536)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 65536)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoinemeraldItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 1048576)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 262144)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 262144)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoinrubyItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) < 4194304)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 1048576)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 1048576)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoindiamondItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } else if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) >= 4194304)) { + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) / 4194304)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.display = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) Math.floor((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display) * 4194304)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + Container _current = ((PlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack _setstack = new ItemStack(CoinnetheriteItem.block, (int) (1)); + _setstack.setCount((int) new Object() { + int convert(String s) { + try { + return Integer.parseInt(s.trim()); + } catch (Exception e) { + } + return 0; + } + }.convert((new java.text.DecimalFormat("#") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display))))); + ((Slot) ((Map) invobj).get((int) (1))).putStack(_setstack); + _current.detectAndSendChanges(); + } + } + } + } + System.out.println((("Display: ") + "" + (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display)))); + } + { + String _setval = (String) (new java.text.DecimalFormat("#,###,###.### PC") + .format(((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money))); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money_disp = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/net/rewey/markscoins/procedures/BankTransferProcedure.java b/src/main/java/net/rewey/markscoins/procedures/BankTransferProcedure.java new file mode 100644 index 0000000..9429dbb --- /dev/null +++ b/src/main/java/net/rewey/markscoins/procedures/BankTransferProcedure.java @@ -0,0 +1,100 @@ +package net.rewey.markscoins.procedures; + +import net.rewey.markscoins.MarkscoinsModVariables; +import net.rewey.markscoins.MarkscoinsModElements; +import net.rewey.markscoins.MarkscoinsMod; + +import net.minecraftforge.items.ItemHandlerHelper; + +import net.minecraft.item.ItemStack; +import net.minecraft.inventory.container.Slot; +import net.minecraft.inventory.container.Container; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; + +import java.util.function.Supplier; +import java.util.Map; + +@MarkscoinsModElements.ModElement.Tag +public class BankTransferProcedure extends MarkscoinsModElements.ModElement { + public BankTransferProcedure(MarkscoinsModElements instance) { + super(instance, 61); + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + MarkscoinsMod.LOGGER.warn("Failed to load dependency entity for procedure BankTransfer!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) >= 0)) { + if (((new Object() { + public int getAmount(int sltid) { + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ItemStack stack = ((Slot) ((Map) invobj).get(sltid)).getStack();; + if (stack != null) + return stack.getCount(); + } + } + } + return 0; + } + }.getAmount((int) (1))) > 0)) { + { + double _setval = (double) (((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).money) + - ((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).transfer)); + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.money = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (double) 0; + entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.transfer = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof PlayerEntity) { + ItemStack _setstack = (new Object() { + public ItemStack getItemStack(int sltid) { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) _ent).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + return ((Slot) ((Map) invobj).get(sltid)).getStack(); + } + } + } + return ItemStack.EMPTY; + } + }.getItemStack((int) (1))); + _setstack.setCount((int) ((entity.getCapability(MarkscoinsModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new MarkscoinsModVariables.PlayerVariables())).display)); + ItemHandlerHelper.giveItemToPlayer(((PlayerEntity) entity), _setstack); + } + if (entity instanceof ServerPlayerEntity) { + Container _current = ((ServerPlayerEntity) entity).openContainer; + if (_current instanceof Supplier) { + Object invobj = ((Supplier) _current).get(); + if (invobj instanceof Map) { + ((Slot) ((Map) invobj).get((int) (1))).putStack(ItemStack.EMPTY); + _current.detectAndSendChanges(); + } + } + } + } + } + } +} diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..3379719 --- /dev/null +++ b/src/main/resources/META-INF/mods.toml @@ -0,0 +1,23 @@ +modLoader="javafml" +loaderVersion="[36,)" +license="Academic Free License v3.0" + +[[mods]] +modId="markscoins" +version="1.0.0" +displayName="Mark's Coins" +credits="Created using mod maker MCreator - https://mcreator.net/about" +displayURL="https://mcreator.net" +logoFile="logo.png" +authors="marewey, MCreator" + +[[dependencies.markscoins]] + modId="minecraft" + mandatory=true + versionRange="[1.16.5]" + ordering="NONE" + side="BOTH" + + + + diff --git a/src/main/resources/assets/markscoins/lang/en_us.json b/src/main/resources/assets/markscoins/lang/en_us.json new file mode 100644 index 0000000..2e6ce53 --- /dev/null +++ b/src/main/resources/assets/markscoins/lang/en_us.json @@ -0,0 +1,32 @@ +{ + "item.markscustom.coinnetherite": "Netherite Coin", + "item.markscustom.coinsapphire": "Sapphire Coin", + "key.markscustom.open_bank": "Open Bank", + "item.markscustom.coinplatinum": "Platinum Coin", + "key.markscoins.open_bank": "Open Bank", + "item.markscoins.coinnetherite": "Netherite Coin", + "item.markscustom.coinwood": "Wood Coin", + "advancements.piggybank.descr": "Save up till you get a netherite coin", + "item.markscoins.coinamethyst": "Amethyst Coin", + "item.markscustom.coindiamond": "Diamond Coin", + "item.markscustom.coingold": "Gold Coin", + "item.markscoins.coinsapphire": "Sapphire Coin", + "advancements.piggybank.title": "Piggy Bank", + "advancements.starter.descr": "Get your first coins", + "item.markscustom.coinstone": "Stone Coin", + "item.markscustom.coincopper": "Copper Coin", + "item.markscustom.coinemerald": "Emerald Coin", + "item.markscoins.coiniron": "Iron Coin", + "item.markscustom.coinamethyst": "Amethyst Coin", + "item.markscoins.coingold": "Gold Coin", + "item.markscustom.coinruby": "Ruby Coin", + "advancements.starter.title": "Starting the Economy", + "item.markscoins.coinruby": "Ruby Coin", + "item.markscoins.coincopper": "Copper Coin", + "item.markscoins.coinplatinum": "Platinum Coin", + "item.markscoins.coinemerald": "Emerald Coin", + "item.markscoins.coinstone": "Stone Coin", + "item.markscoins.coinwood": "Wood Coin", + "item.markscoins.coindiamond": "Diamond Coin", + "item.markscustom.coiniron": "Iron Coin" +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coinamethyst.json b/src/main/resources/assets/markscoins/models/item/coinamethyst.json new file mode 100644 index 0000000..3e94907 --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coinamethyst.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_amethyst" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coincopper.json b/src/main/resources/assets/markscoins/models/item/coincopper.json new file mode 100644 index 0000000..4e20398 --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coincopper.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_bronze" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coindiamond.json b/src/main/resources/assets/markscoins/models/item/coindiamond.json new file mode 100644 index 0000000..44ab39a --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coindiamond.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_diamond" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coinemerald.json b/src/main/resources/assets/markscoins/models/item/coinemerald.json new file mode 100644 index 0000000..ed14471 --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coinemerald.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_emerald" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coingold.json b/src/main/resources/assets/markscoins/models/item/coingold.json new file mode 100644 index 0000000..8e130ea --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coingold.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_gold" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coiniron.json b/src/main/resources/assets/markscoins/models/item/coiniron.json new file mode 100644 index 0000000..380f444 --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coiniron.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_iron" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coinnetherite.json b/src/main/resources/assets/markscoins/models/item/coinnetherite.json new file mode 100644 index 0000000..600fb2c --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coinnetherite.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_netherite" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coinplatinum.json b/src/main/resources/assets/markscoins/models/item/coinplatinum.json new file mode 100644 index 0000000..4ce6696 --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coinplatinum.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_platinum" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coinruby.json b/src/main/resources/assets/markscoins/models/item/coinruby.json new file mode 100644 index 0000000..4b2363c --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coinruby.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_ruby" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coinsapphire.json b/src/main/resources/assets/markscoins/models/item/coinsapphire.json new file mode 100644 index 0000000..087a87a --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coinsapphire.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_sapphire" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coinstone.json b/src/main/resources/assets/markscoins/models/item/coinstone.json new file mode 100644 index 0000000..f63ee78 --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coinstone.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_stone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/models/item/coinwood.json b/src/main/resources/assets/markscoins/models/item/coinwood.json new file mode 100644 index 0000000..99ff86b --- /dev/null +++ b/src/main/resources/assets/markscoins/models/item/coinwood.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "markscoins:items/coin_wood" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/sounds.json b/src/main/resources/assets/markscoins/sounds.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/markscoins/sounds.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/markscoins/textures/bank_gui.png b/src/main/resources/assets/markscoins/textures/bank_gui.png new file mode 100644 index 0000000..9d09eca Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/bank_gui.png differ diff --git a/src/main/resources/assets/markscoins/textures/cashout.png b/src/main/resources/assets/markscoins/textures/cashout.png new file mode 100644 index 0000000..00a2766 Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/cashout.png differ diff --git a/src/main/resources/assets/markscoins/textures/coin_diamond.png b/src/main/resources/assets/markscoins/textures/coin_diamond.png new file mode 100644 index 0000000..1ef9848 Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/coin_diamond.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_amethyst.png b/src/main/resources/assets/markscoins/textures/items/coin_amethyst.png new file mode 100644 index 0000000..ea363ed Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_amethyst.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_bronze.png b/src/main/resources/assets/markscoins/textures/items/coin_bronze.png new file mode 100644 index 0000000..ba129d4 Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_bronze.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_diamond.png b/src/main/resources/assets/markscoins/textures/items/coin_diamond.png new file mode 100644 index 0000000..1ef9848 Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_diamond.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_emerald.png b/src/main/resources/assets/markscoins/textures/items/coin_emerald.png new file mode 100644 index 0000000..186f88a Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_emerald.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_gold.png b/src/main/resources/assets/markscoins/textures/items/coin_gold.png new file mode 100644 index 0000000..25d67ae Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_gold.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_iron.png b/src/main/resources/assets/markscoins/textures/items/coin_iron.png new file mode 100644 index 0000000..4ef6a2b Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_iron.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_netherite.png b/src/main/resources/assets/markscoins/textures/items/coin_netherite.png new file mode 100644 index 0000000..fb0752c Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_netherite.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_platinum.png b/src/main/resources/assets/markscoins/textures/items/coin_platinum.png new file mode 100644 index 0000000..e888f72 Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_platinum.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_ruby.png b/src/main/resources/assets/markscoins/textures/items/coin_ruby.png new file mode 100644 index 0000000..3b8bf11 Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_ruby.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_sapphire.png b/src/main/resources/assets/markscoins/textures/items/coin_sapphire.png new file mode 100644 index 0000000..e617764 Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_sapphire.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_stone.png b/src/main/resources/assets/markscoins/textures/items/coin_stone.png new file mode 100644 index 0000000..3a016a7 Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_stone.png differ diff --git a/src/main/resources/assets/markscoins/textures/items/coin_wood.png b/src/main/resources/assets/markscoins/textures/items/coin_wood.png new file mode 100644 index 0000000..c23a634 Binary files /dev/null and b/src/main/resources/assets/markscoins/textures/items/coin_wood.png differ diff --git a/src/main/resources/assets/markscustom/textures/cashout.png b/src/main/resources/assets/markscustom/textures/cashout.png new file mode 100644 index 0000000..0a33501 Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/cashout.png differ diff --git a/src/main/resources/assets/markscustom/textures/coin_diamond.png b/src/main/resources/assets/markscustom/textures/coin_diamond.png new file mode 100644 index 0000000..1ef9848 Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/coin_diamond.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_amethyst.png b/src/main/resources/assets/markscustom/textures/items/coin_amethyst.png new file mode 100644 index 0000000..ea363ed Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_amethyst.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_bronze.png b/src/main/resources/assets/markscustom/textures/items/coin_bronze.png new file mode 100644 index 0000000..ba129d4 Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_bronze.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_diamond.png b/src/main/resources/assets/markscustom/textures/items/coin_diamond.png new file mode 100644 index 0000000..1ef9848 Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_diamond.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_emerald.png b/src/main/resources/assets/markscustom/textures/items/coin_emerald.png new file mode 100644 index 0000000..186f88a Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_emerald.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_gold.png b/src/main/resources/assets/markscustom/textures/items/coin_gold.png new file mode 100644 index 0000000..25d67ae Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_gold.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_iron.png b/src/main/resources/assets/markscustom/textures/items/coin_iron.png new file mode 100644 index 0000000..4ef6a2b Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_iron.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_netherite.png b/src/main/resources/assets/markscustom/textures/items/coin_netherite.png new file mode 100644 index 0000000..fb0752c Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_netherite.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_platinum.png b/src/main/resources/assets/markscustom/textures/items/coin_platinum.png new file mode 100644 index 0000000..e888f72 Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_platinum.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_ruby.png b/src/main/resources/assets/markscustom/textures/items/coin_ruby.png new file mode 100644 index 0000000..3b8bf11 Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_ruby.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_sapphire.png b/src/main/resources/assets/markscustom/textures/items/coin_sapphire.png new file mode 100644 index 0000000..e617764 Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_sapphire.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_stone.png b/src/main/resources/assets/markscustom/textures/items/coin_stone.png new file mode 100644 index 0000000..3a016a7 Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_stone.png differ diff --git a/src/main/resources/assets/markscustom/textures/items/coin_wood.png b/src/main/resources/assets/markscustom/textures/items/coin_wood.png new file mode 100644 index 0000000..c23a634 Binary files /dev/null and b/src/main/resources/assets/markscustom/textures/items/coin_wood.png differ diff --git a/src/main/resources/data/forge/tags/items/coins.json b/src/main/resources/data/forge/tags/items/coins.json new file mode 100644 index 0000000..279bc19 --- /dev/null +++ b/src/main/resources/data/forge/tags/items/coins.json @@ -0,0 +1,17 @@ +{ + "replace": false, + "values": [ + "markscoins:coinwood", + "markscoins:coinstone", + "markscoins:coincopper", + "markscoins:coiniron", + "markscoins:coingold", + "markscoins:coinamethyst", + "markscoins:coinsapphire", + "markscoins:coinruby", + "markscoins:coindiamond", + "markscoins:coinemerald", + "markscoins:coinnetherite", + "markscoins:coinplatinum" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/advancements/piggybank.json b/src/main/resources/data/markscoins/advancements/piggybank.json new file mode 100644 index 0000000..7a634fb --- /dev/null +++ b/src/main/resources/data/markscoins/advancements/piggybank.json @@ -0,0 +1,40 @@ +{ + "display": { + "icon": { + "item": "markscoins:coinnetherite" + }, + "title": { + "translate": "advancements.piggybank.title" + }, + "description": { + "translate": "advancements.piggybank.descr" + }, + "frame": "challenge", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "piggybank": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "markscoins:coinnetherite", + "count": { + "min": 1, + "max": 64 + } + } + ] + } + } + }, + "rewards": { + "experience": 8, + "recipes": [ + "markscoins:deleted_mod_element" + ] + }, + "parent": "minecraft:story/root" +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/advancements/starter.json b/src/main/resources/data/markscoins/advancements/starter.json new file mode 100644 index 0000000..936b988 --- /dev/null +++ b/src/main/resources/data/markscoins/advancements/starter.json @@ -0,0 +1,33 @@ +{ + "display": { + "icon": { + "item": "markscoins:coingold" + }, + "title": { + "translate": "advancements.starter.title" + }, + "description": { + "translate": "advancements.starter.descr" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "starter": { + "trigger": "minecraft:tick" + } + }, + "rewards": { + "experience": 0, + "loot": [ + "markscoins:coinloot" + ], + "recipes": [ + "markscoins:woodstone", + "markscoins:stonecopper" + ] + }, + "parent": "minecraft:story/root" +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/loot_tables/coinloot.json b/src/main/resources/data/markscoins/loot_tables/coinloot.json new file mode 100644 index 0000000..ac9cdc9 --- /dev/null +++ b/src/main/resources/data/markscoins/loot_tables/coinloot.json @@ -0,0 +1,201 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "min": 1, + "max": 8 + }, + "bonus_rolls": { + "min": 1, + "max": 4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "markscoins:coinwood", + "weight": 32, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 8 + } + }, + { + "function": "minecraft:apply_bonus", + "enchantment": "minecraft:fortune", + "formula": "minecraft:ore_drops" + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coinstone", + "weight": 16, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 6 + } + }, + { + "function": "minecraft:apply_bonus", + "enchantment": "minecraft:fortune", + "formula": "minecraft:ore_drops" + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coincopper", + "weight": 8, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 4 + } + }, + { + "function": "minecraft:apply_bonus", + "enchantment": "minecraft:fortune", + "formula": "minecraft:ore_drops" + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coiniron", + "weight": 4, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coingold", + "weight": 1, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 1 + } + } + ] + } + ] + }, + { + "rolls": { + "min": 1, + "max": 16 + }, + "bonus_rolls": { + "min": 1, + "max": 8 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "markscoins:coinstone", + "weight": 8, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 16 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coinwood", + "weight": 8, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 24 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coincopper", + "weight": 4, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 8 + } + } + ] + } + ] + }, + { + "rolls": { + "min": 1, + "max": 32 + }, + "bonus_rolls": { + "min": 1, + "max": 16 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "markscoins:coinwood", + "weight": 8, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 8 + } + }, + { + "function": "minecraft:apply_bonus", + "enchantment": "minecraft:fortune", + "formula": "minecraft:ore_drops" + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coinstone", + "weight": 4, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 4 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/amethystplatinum.json b/src/main/resources/data/markscoins/recipes/amethystplatinum.json new file mode 100644 index 0000000..397ccf7 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/amethystplatinum.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinamethyst" + } + ], + "result": { + "item": "markscoins:coinplatinum", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/amethystsapphire.json b/src/main/resources/data/markscoins/recipes/amethystsapphire.json new file mode 100644 index 0000000..dd6182c --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/amethystsapphire.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinamethyst" + }, + { + "item": "markscoins:coinamethyst" + }, + { + "item": "markscoins:coinamethyst" + }, + { + "item": "markscoins:coinamethyst" + } + ], + "result": { + "item": "markscoins:coinsapphire", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/copperiron.json b/src/main/resources/data/markscoins/recipes/copperiron.json new file mode 100644 index 0000000..9b30432 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/copperiron.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coincopper" + }, + { + "item": "markscoins:coincopper" + }, + { + "item": "markscoins:coincopper" + }, + { + "item": "markscoins:coincopper" + } + ], + "result": { + "item": "markscoins:coiniron", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/copperstone.json b/src/main/resources/data/markscoins/recipes/copperstone.json new file mode 100644 index 0000000..3b04c7b --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/copperstone.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coincopper" + } + ], + "result": { + "item": "markscoins:coinstone", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/diamondnetherite.json b/src/main/resources/data/markscoins/recipes/diamondnetherite.json new file mode 100644 index 0000000..4f336c3 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/diamondnetherite.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coindiamond" + }, + { + "item": "markscoins:coindiamond" + }, + { + "item": "markscoins:coindiamond" + }, + { + "item": "markscoins:coindiamond" + } + ], + "result": { + "item": "markscoins:coinnetherite", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/diamondruby.json b/src/main/resources/data/markscoins/recipes/diamondruby.json new file mode 100644 index 0000000..207fa37 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/diamondruby.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coindiamond" + } + ], + "result": { + "item": "markscoins:coinruby", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/emeraldruby.json b/src/main/resources/data/markscoins/recipes/emeraldruby.json new file mode 100644 index 0000000..cd77704 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/emeraldruby.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinemerald" + }, + { + "item": "markscoins:coinemerald" + }, + { + "item": "markscoins:coinemerald" + }, + { + "item": "markscoins:coinemerald" + } + ], + "result": { + "item": "markscoins:coinruby", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/emeraldsapphire.json b/src/main/resources/data/markscoins/recipes/emeraldsapphire.json new file mode 100644 index 0000000..5586d04 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/emeraldsapphire.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinemerald" + } + ], + "result": { + "item": "markscoins:coinsapphire", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/goldiron.json b/src/main/resources/data/markscoins/recipes/goldiron.json new file mode 100644 index 0000000..d8da5d5 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/goldiron.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coingold" + } + ], + "result": { + "item": "markscoins:coiniron", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/goldplatinum.json b/src/main/resources/data/markscoins/recipes/goldplatinum.json new file mode 100644 index 0000000..c761899 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/goldplatinum.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coingold" + }, + { + "item": "markscoins:coingold" + }, + { + "item": "markscoins:coingold" + }, + { + "item": "markscoins:coingold" + } + ], + "result": { + "item": "markscoins:coinplatinum", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/ironcopper.json b/src/main/resources/data/markscoins/recipes/ironcopper.json new file mode 100644 index 0000000..dd6f060 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/ironcopper.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coiniron" + } + ], + "result": { + "item": "markscoins:coincopper", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/irongold.json b/src/main/resources/data/markscoins/recipes/irongold.json new file mode 100644 index 0000000..5264aae --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/irongold.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coiniron" + }, + { + "item": "markscoins:coiniron" + }, + { + "item": "markscoins:coiniron" + }, + { + "item": "markscoins:coiniron" + } + ], + "result": { + "item": "markscoins:coingold", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/makebronze.json b/src/main/resources/data/markscoins/recipes/makebronze.json new file mode 100644 index 0000000..c8d7337 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/makebronze.json @@ -0,0 +1,12 @@ +{ + "type": "minecraft:smithing", + "base": { + "item": "minecraft:bell" + }, + "addition": { + "item": "minecraft:flower_pot" + }, + "result": { + "item": "markscoins:coincopper" + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/makeiron.json b/src/main/resources/data/markscoins/recipes/makeiron.json new file mode 100644 index 0000000..cc233b6 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/makeiron.json @@ -0,0 +1,12 @@ +{ + "type": "minecraft:smithing", + "base": { + "item": "minecraft:iron_block" + }, + "addition": { + "item": "minecraft:flower_pot" + }, + "result": { + "item": "markscoins:coiniron" + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/makestone.json b/src/main/resources/data/markscoins/recipes/makestone.json new file mode 100644 index 0000000..3a20038 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/makestone.json @@ -0,0 +1,9 @@ +{ + "group": "markscoins", + "type": "minecraft:stonecutting", + "count": 1, + "ingredient": { + "tag": "minecraft:slabs" + }, + "result": "markscoins:coinstone" +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/makestone_2.json b/src/main/resources/data/markscoins/recipes/makestone_2.json new file mode 100644 index 0000000..94f2c13 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/makestone_2.json @@ -0,0 +1,12 @@ +{ + "type": "minecraft:smithing", + "base": { + "tag": "forge:stone" + }, + "addition": { + "item": "minecraft:flower_pot" + }, + "result": { + "item": "markscoins:coinstone" + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/makewood.json b/src/main/resources/data/markscoins/recipes/makewood.json new file mode 100644 index 0000000..c43a8c7 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/makewood.json @@ -0,0 +1,12 @@ +{ + "type": "minecraft:smithing", + "base": { + "item": "minecraft:oak_log" + }, + "addition": { + "item": "minecraft:flower_pot" + }, + "result": { + "item": "markscoins:coinwood" + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/makewood_1.json b/src/main/resources/data/markscoins/recipes/makewood_1.json new file mode 100644 index 0000000..0e3ef56 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/makewood_1.json @@ -0,0 +1,12 @@ +{ + "type": "minecraft:smithing", + "base": { + "item": "minecraft:leather" + }, + "addition": { + "item": "minecraft:flower_pot" + }, + "result": { + "item": "markscoins:coinwood" + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/makewood_2.json b/src/main/resources/data/markscoins/recipes/makewood_2.json new file mode 100644 index 0000000..ebcec0a --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/makewood_2.json @@ -0,0 +1,12 @@ +{ + "type": "minecraft:smithing", + "base": { + "item": "minecraft:bone_meal" + }, + "addition": { + "item": "minecraft:flower_pot" + }, + "result": { + "item": "markscoins:coinwood" + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/netheritediamond.json b/src/main/resources/data/markscoins/recipes/netheritediamond.json new file mode 100644 index 0000000..9f8c0e0 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/netheritediamond.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinnetherite" + } + ], + "result": { + "item": "markscoins:coindiamond", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/platinumamethyst.json b/src/main/resources/data/markscoins/recipes/platinumamethyst.json new file mode 100644 index 0000000..d4d97ce --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/platinumamethyst.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinplatinum" + }, + { + "item": "markscoins:coinplatinum" + }, + { + "item": "markscoins:coinplatinum" + }, + { + "item": "markscoins:coinplatinum" + } + ], + "result": { + "item": "markscoins:coinamethyst", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/platinumgold.json b/src/main/resources/data/markscoins/recipes/platinumgold.json new file mode 100644 index 0000000..15b22b8 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/platinumgold.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinplatinum" + } + ], + "result": { + "item": "markscoins:coingold", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/rottenflesh_2_leather.json b/src/main/resources/data/markscoins/recipes/rottenflesh_2_leather.json new file mode 100644 index 0000000..0051708 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/rottenflesh_2_leather.json @@ -0,0 +1,12 @@ +{ + "group": "markscoins", + "type": "minecraft:campfire_cooking", + "experience": 1, + "cookingtime": 400, + "ingredient": { + "item": "minecraft:rotten_flesh" + }, + "result": { + "item": "minecraft:leather" + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/rubydiamond.json b/src/main/resources/data/markscoins/recipes/rubydiamond.json new file mode 100644 index 0000000..88686d0 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/rubydiamond.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinruby" + }, + { + "item": "markscoins:coinruby" + }, + { + "item": "markscoins:coinruby" + }, + { + "item": "markscoins:coinruby" + } + ], + "result": { + "item": "markscoins:coindiamond", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/rubyemerald.json b/src/main/resources/data/markscoins/recipes/rubyemerald.json new file mode 100644 index 0000000..d650da7 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/rubyemerald.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinruby" + } + ], + "result": { + "item": "markscoins:coinemerald", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/sapphireamethyst.json b/src/main/resources/data/markscoins/recipes/sapphireamethyst.json new file mode 100644 index 0000000..5a0cfe2 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/sapphireamethyst.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinsapphire" + } + ], + "result": { + "item": "markscoins:coinamethyst", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/sapphireemerald.json b/src/main/resources/data/markscoins/recipes/sapphireemerald.json new file mode 100644 index 0000000..29698fc --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/sapphireemerald.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinsapphire" + }, + { + "item": "markscoins:coinsapphire" + }, + { + "item": "markscoins:coinsapphire" + }, + { + "item": "markscoins:coinsapphire" + } + ], + "result": { + "item": "markscoins:coinemerald", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/stonecopper.json b/src/main/resources/data/markscoins/recipes/stonecopper.json new file mode 100644 index 0000000..c79237a --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/stonecopper.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinstone" + }, + { + "item": "markscoins:coinstone" + }, + { + "item": "markscoins:coinstone" + }, + { + "item": "markscoins:coinstone" + } + ], + "result": { + "item": "markscoins:coincopper", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/stonewood.json b/src/main/resources/data/markscoins/recipes/stonewood.json new file mode 100644 index 0000000..a912c0b --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/stonewood.json @@ -0,0 +1,13 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinstone" + } + ], + "result": { + "item": "markscoins:coinwood", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/markscoins/recipes/woodstone.json b/src/main/resources/data/markscoins/recipes/woodstone.json new file mode 100644 index 0000000..12c98c7 --- /dev/null +++ b/src/main/resources/data/markscoins/recipes/woodstone.json @@ -0,0 +1,22 @@ +{ + "group": "markscoins", + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "markscoins:coinwood" + }, + { + "item": "markscoins:coinwood" + }, + { + "item": "markscoins:coinwood" + }, + { + "item": "markscoins:coinwood" + } + ], + "result": { + "item": "markscoins:coinstone", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/loot_tables/chests/abandoned_mineshaft.json b/src/main/resources/data/minecraft/loot_tables/chests/abandoned_mineshaft.json new file mode 100644 index 0000000..ca362f2 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/chests/abandoned_mineshaft.json @@ -0,0 +1,78 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "min": 0, + "max": 17 + }, + "bonus_rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "markscoins:coinwood", + "weight": 15, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 8 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coinstone", + "weight": 10, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 4 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coincopper", + "weight": 5, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coiniron", + "weight": 1, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 1 + } + }, + { + "function": "minecraft:apply_bonus", + "enchantment": "minecraft:fortune", + "formula": "minecraft:ore_drops" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/loot_tables/chests/end_city_treasure.json b/src/main/resources/data/minecraft/loot_tables/chests/end_city_treasure.json new file mode 100644 index 0000000..888575d --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/chests/end_city_treasure.json @@ -0,0 +1,59 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "min": 1, + "max": 4 + }, + "bonus_rolls": { + "min": 1, + "max": 2 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "markscoins:coinamethyst", + "weight": 1, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 3 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coinsapphire", + "weight": 1, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "markscoins:coinruby", + "weight": 1, + "functions": [ + { + "function": "set_count", + "count": { + "min": 1, + "max": 1 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png new file mode 100644 index 0000000..1ef9848 Binary files /dev/null and b/src/main/resources/logo.png differ diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..d799e97 --- /dev/null +++ b/src/main/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "markscoins mod resources", + "pack_format": 6 + } +} \ No newline at end of file