Skip to content

Commit

Permalink
alchemy_craft_block
Browse files Browse the repository at this point in the history
  • Loading branch information
hrmcngs committed Nov 26, 2024
1 parent 73a77f0 commit fb40428
Show file tree
Hide file tree
Showing 13 changed files with 1,814 additions and 0 deletions.
132 changes: 132 additions & 0 deletions elements/AlchemyCraftBlock.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"_fv": 43,
"_type": "block",
"definition": {
"texture": "bluepurgeair",
"textureTop": "dai",
"textureLeft": "bluepurgeair",
"textureFront": "bluepurgeair",
"textureRight": "bluepurgeair",
"textureBack": "bluepurgeair",
"renderType": 10,
"customModelName": "Normal",
"rotationMode": 0,
"enablePitch": false,
"emissiveRendering": false,
"displayFluidOverlay": false,
"itemTexture": "",
"particleTexture": "",
"tintType": "No tint",
"isItemTinted": false,
"hasTransparency": false,
"connectedSides": false,
"transparencyType": "SOLID",
"disableOffset": false,
"boundingBoxes": [
{
"mx": 0.0,
"my": 0.0,
"mz": 0.0,
"Mx": 16.0,
"My": 16.0,
"Mz": 16.0,
"subtract": false
}
],
"name": "Alchemy Craft Block",
"specialInfo": [],
"hardness": 1.0,
"resistance": 10.0,
"hasGravity": false,
"isWaterloggable": false,
"creativeTab": {
"value": "CUSTOM:MagicBooks"
},
"destroyTool": "axe",
"customDrop": {
"value": ""
},
"dropAmount": 1,
"useLootTableForDrops": false,
"requiresCorrectTool": false,
"enchantPowerBonus": 0.0,
"plantsGrowOn": false,
"canRedstoneConnect": false,
"lightOpacity": 15,
"material": {
"value": "WOOD"
},
"tickRate": 0,
"tickRandomly": false,
"isReplaceable": false,
"canProvidePower": false,
"emittedRedstonePower": {
"fixedValue": 15.0
},
"colorOnMap": "DEFAULT",
"creativePickItem": {
"value": ""
},
"offsetType": "NONE",
"aiPathNodeType": "DEFAULT",
"flammability": 0,
"fireSpreadSpeed": 0,
"isLadder": false,
"slipperiness": 0.6,
"speedFactor": 1.0,
"jumpFactor": 1.0,
"reactionToPushing": "NORMAL",
"isNotColidable": false,
"isCustomSoundType": false,
"soundOnStep": {
"value": "WOOD"
},
"breakSound": {
"value": ""
},
"fallSound": {
"value": ""
},
"hitSound": {
"value": ""
},
"placeSound": {
"value": ""
},
"stepSound": {
"value": ""
},
"luminance": 0,
"unbreakable": false,
"breakHarvestLevel": 1,
"isBonemealable": false,
"hasInventory": false,
"guiBoundTo": "<NONE>",
"openGUIOnRightClick": false,
"inventorySize": 9,
"inventoryStackSize": 64,
"inventoryDropWhenDestroyed": true,
"inventoryComparatorPower": true,
"inventoryOutSlotIDs": [],
"inventoryInSlotIDs": [],
"hasEnergyStorage": false,
"energyInitial": 0,
"energyCapacity": 400000,
"energyMaxReceive": 200,
"energyMaxExtract": 200,
"isFluidTank": false,
"fluidCapacity": 8000,
"fluidRestrictions": [],
"onBlockAdded": {
"name": "AlchemyCraftBlockBlockAdded"
},
"spawnWorldTypes": [],
"restrictionBiomes": [],
"blocksToReplace": [],
"generationShape": "UNIFORM",
"frequencyPerChunks": 10,
"frequencyOnChunk": 16,
"minGenerateHeight": 0,
"maxGenerateHeight": 64
}
}
7 changes: 7 additions & 0 deletions elements/AlchemyCraftBlockBlockAdded.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"_fv": 43,
"_type": "procedure",
"definition": {
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"event_trigger\" deletable=\"false\" x=\"40\" y=\"40\"><field name=\"trigger\">no_ext_trigger</field><next><block type=\"execute_command\"><value name=\"command\"><block type=\"text\"><field name=\"TEXT\">/summon minecraft:armor_stand ~ ~-0.5 ~ {Invisible:true,Invulnerable:true,PersistenceRequired:true,NoBasePlate:true,NoGravity:true,Small:true,DisabledSlots:4144959,Tags:[\"minecraft_armor_weapon_alchemy_craft_block_mahouzinn\"]}</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value></block></next></block></xml>"
}
}
49 changes: 49 additions & 0 deletions minecraft_armor_weapon.mcreator
Original file line number Diff line number Diff line change
Expand Up @@ -8896,6 +8896,53 @@
"src/main/resources/data/minecraft_armor_weapon/functions/sword_stand_luna.mcfunction"
]
}
},
{
"name": "AlchemyCraftBlockBlockAdded",
"type": "procedure",
"sortid": 586,
"compiles": true,
"locked_code": false,
"registry_name": "alchemy_craft_block_block_added",
"metadata": {
"files": [
"src/main/java/minecraftarmorweapon/procedures/AlchemyCraftBlockBlockAddedProcedure.java"
],
"dependencies": [
{
"name": "x",
"type": "number"
},
{
"name": "y",
"type": "number"
},
{
"name": "z",
"type": "number"
},
{
"name": "world",
"type": "world"
}
]
}
},
{
"name": "AlchemyCraftBlock",
"type": "block",
"sortid": 587,
"compiles": true,
"locked_code": false,
"registry_name": "alchemy_craft_block",
"metadata": {
"files": [
"src/main/resources/assets/minecraft_armor_weapon/blockstates/alchemy_craft_block.json",
"src/main/java/minecraftarmorweapon/block/AlchemyCraftBlockBlock.java",
"src/main/resources/assets/minecraft_armor_weapon/models/block/alchemy_craft_block.json",
"src/main/resources/assets/minecraft_armor_weapon/models/item/alchemy_craft_block.json"
]
}
}
],
"variable_elements": [
Expand Down Expand Up @@ -9337,6 +9384,7 @@
"effect.minecraft_armor_weapon.zokuseizanngeki": "zannfgeki",
"item.minecraft_armor_weapon.rpg_book": "RPG Book",
"effect.minecraft_armor_weapon.tameteru": "minecraft_armor_weapon:test_bow_tameteru",
"block.minecraft_armor_weapon.alchemy_craft_block": "Alchemy Craft Block",
"effect.minecraft_armor_weapon.aa": "n0okku",
"item.minecraft_armor_weapon.dragon_green_armor_chestplate": "§2Dragon green chestplate",
"item.minecraft_armor_weapon.dragon_black_armor_leggings": "§8Dragon black leggings",
Expand Down Expand Up @@ -9597,6 +9645,7 @@
"effect.minecraft_armor_weapon.zokuseizanngeki": "zannfgeki",
"item.minecraft_armor_weapon.rpg_book": "RPG Book",
"effect.minecraft_armor_weapon.tameteru": "minecraft_armor_weapon:test_bow_tameteru",
"block.minecraft_armor_weapon.alchemy_craft_block": "Alchemy Craft Block",
"effect.minecraft_armor_weapon.aa": "n0okku",
"item.minecraft_armor_weapon.dragon_green_armor_chestplate": "§2Dragon green chestplate",
"item.minecraft_armor_weapon.dragon_black_armor_leggings": "§8Dragon black leggings",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

package minecraftarmorweapon.block;

import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.item.ItemStack;
import net.minecraft.core.BlockPos;

import minecraftarmorweapon.procedures.AlchemyCraftBlockBlockAddedProcedure;

import java.util.List;
import java.util.Collections;

public class AlchemyCraftBlockBlock extends Block {
public AlchemyCraftBlockBlock() {
super(BlockBehaviour.Properties.of(Material.WOOD).sound(SoundType.WOOD).strength(1f, 10f));
}

@Override
public int getLightBlock(BlockState state, BlockGetter worldIn, BlockPos pos) {
return 15;
}

@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, 1));
}

@Override
public void onPlace(BlockState blockstate, Level world, BlockPos pos, BlockState oldState, boolean moving) {
super.onPlace(blockstate, world, pos, oldState, moving);
AlchemyCraftBlockBlockAddedProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ public class MinecraftArmorWeaponModBlocks {
public static final RegistryObject<Block> WITHER_SKELETON_SPAWNER = REGISTRY.register("wither_skeleton_spawner", () -> new WitherSkeletonSpawnerBlock());
public static final RegistryObject<Block> CUSTOM_CRAFTER_CRAFTING = REGISTRY.register("custom_crafter_crafting", () -> new CustomCrafterCraftingBlock());
public static final RegistryObject<Block> ITEM_STAN = REGISTRY.register("item_stan", () -> new ItemStanBlock());
public static final RegistryObject<Block> ALCHEMY_CRAFT_BLOCK = REGISTRY.register("alchemy_craft_block", () -> new AlchemyCraftBlockBlock());
}
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ public class MinecraftArmorWeaponModItems {
public static final RegistryObject<Item> PUMPKIN_HEAD_HELMET = REGISTRY.register("pumpkin_head_helmet", () -> new PumpkinHeadItem.Helmet());
public static final RegistryObject<Item> TUKAENA = REGISTRY.register("tukaena", () -> new TukaenaItem());
public static final RegistryObject<Item> ITEM_STAN = block(MinecraftArmorWeaponModBlocks.ITEM_STAN, MinecraftArmorWeaponModTabs.TAB_MAGIC_BOOKS);
public static final RegistryObject<Item> ALCHEMY_CRAFT_BLOCK = block(MinecraftArmorWeaponModBlocks.ALCHEMY_CRAFT_BLOCK, MinecraftArmorWeaponModTabs.TAB_MAGIC_BOOKS);

private static RegistryObject<Item> block(RegistryObject<Block> block, CreativeModeTab tab) {
return REGISTRY.register(block.getId().getPath(), () -> new BlockItem(block.get(), new Item.Properties().tab(tab)));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package minecraftarmorweapon.procedures;

import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.network.chat.Component;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.CommandSource;

public class AlchemyCraftBlockBlockAddedProcedure {
public static void execute(LevelAccessor world, double x, double y, double z) {
if (world instanceof ServerLevel _level)
_level.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, new Vec3(x, y, z), Vec2.ZERO, _level, 4, "", Component.literal(""), _level.getServer(), null).withSuppressedOutput(),
"/summon minecraft:armor_stand ~ ~-0.5 ~ {Invisible:true,Invulnerable:true,PersistenceRequired:true,NoBasePlate:true,NoGravity:true,Small:true,DisabledSlots:4144959,Tags:[\"minecraft_armor_weapon_alchemy_craft_block_mahouzinn\"]}");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "minecraft_armor_weapon:block/alchemy_craft_block"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parent": "block/cube",
"textures": {
"down": "minecraft_armor_weapon:blocks/bluepurgeair",
"up": "minecraft_armor_weapon:blocks/dai",
"north": "minecraft_armor_weapon:blocks/bluepurgeair",
"east": "minecraft_armor_weapon:blocks/bluepurgeair",
"south": "minecraft_armor_weapon:blocks/bluepurgeair",
"west": "minecraft_armor_weapon:blocks/bluepurgeair",
"particle": "minecraft_armor_weapon:blocks/bluepurgeair"
},
"render_type": "solid"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parent": "minecraft_armor_weapon:block/alchemy_craft_block",
"display": {
"thirdperson": {
"rotation": [
10,
-45,
170
],
"translation": [
0,
1.5,
-2.75
],
"scale": [
0.375,
0.375,
0.375
]
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"minecraft_armor_weapon:alchemy_craft_block"
]
}
Loading

0 comments on commit fb40428

Please sign in to comment.