Skip to content

Commit

Permalink
hopefully release?
Browse files Browse the repository at this point in the history
  • Loading branch information
unix-supremacist committed Sep 30, 2023
1 parent 9264ad1 commit 677fbb1
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 11 deletions.
7 changes: 7 additions & 0 deletions src/main/generated/data/alchemist/tags/blocks/obsidian.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"minecraft:obsidian",
"minecraft:crying_obsidian"
]
}
2 changes: 2 additions & 0 deletions src/main/generated/data/alchemist/tags/blocks/stone.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"minecraft:andesite",
"minecraft:diorite",
"minecraft:granite",
"minecraft:sandstone",
"minecraft:red_sandstone",
"minecraft:clay"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"minecraft:stone_bricks",
"minecraft:mossy_stone_bricks"
]
}
1 change: 1 addition & 0 deletions src/main/generated/data/alchemist/tags/blocks/terra.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"minecraft:dirt",
"minecraft:coarse_dirt",
"minecraft:cobblestone",
"minecraft:mossy_cobblestone",
"minecraft:cobbled_deepslate",
"minecraft:stone",
"minecraft:deepslate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player
level.setBlock(pos, Blocks.AIR.defaultBlockState(), 3);
return transmuteEntity(villagerList.get(0), level);
}

List<Wolf> wolfList = level.getEntitiesOfClass(Wolf.class, aABB);
if(!wolfList.isEmpty()){
level.setBlock(pos, Blocks.AIR.defaultBlockState(), 3);
return transmuteEntity(wolfList.get(0), level);
}
}

return InteractionResult.PASS;
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/io/github/unix_supremacist/data/BlockTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class BlockTag extends FabricTagProvider.BlockTagProvider {
public static TagKey<Block> netherwoodtag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "netherwood"));
public static TagKey<Block> leavetag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "leave"));
public static TagKey<Block> stonetag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stone"));
public static TagKey<Block> obsidiantag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "obsidian"));
public static TagKey<Block> stonebrickstag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stonebricks"));

public BlockTag(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> completableFuture) {
super(output, completableFuture);
Expand All @@ -38,6 +40,8 @@ public static void init(){
addExchange(netherwoodtag);
addExchange(leavetag);
addExchange(stonetag);
addExchange(obsidiantag);
addExchange(stonebrickstag);
}

@Override
Expand All @@ -47,6 +51,7 @@ protected void addTags(HolderLookup.Provider arg) {
terra.add(Blocks.DIRT);
terra.add(Blocks.COARSE_DIRT);
terra.add(Blocks.COBBLESTONE);
terra.add(Blocks.MOSSY_COBBLESTONE);
terra.add(Blocks.COBBLED_DEEPSLATE);
terra.add(Blocks.STONE);
terra.add(Blocks.DEEPSLATE);
Expand Down Expand Up @@ -102,7 +107,17 @@ protected void addTags(HolderLookup.Provider arg) {
stone.add(Blocks.ANDESITE);
stone.add(Blocks.DIORITE);
stone.add(Blocks.GRANITE);
stone.add(Blocks.SANDSTONE);
stone.add(Blocks.RED_SANDSTONE);
stone.add(Blocks.CLAY);

FabricTagBuilder obsidian = getOrCreateTagBuilder(obsidiantag);
obsidian.add(Blocks.OBSIDIAN);
obsidian.add(Blocks.CRYING_OBSIDIAN);

FabricTagBuilder stonebricks = getOrCreateTagBuilder(stonebrickstag);
stonebricks.add(Blocks.STONE_BRICKS);
stonebricks.add(Blocks.MOSSY_STONE_BRICKS);
}

public static Block getBlockWithOffset(Block b, ArrayList<Block> exchange, int o){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ default ArrayList<BlockPos> getArea(Direction dir, BlockPos anchor, BlockPos neg
}

default ArrayList<BlockPos> getAreaFromFacing(Direction dir, BlockPos anchor, int size, int depth){
Alchemist.LOGGER.error(size+" "+depth);
switch(dir) {
case SOUTH:
return getArea(dir, anchor, new BlockPos(-size, -size, -depth), new BlockPos(size, size, 0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ public InteractionResult useOn(UseOnContext context) {

if(!blocks.isEmpty()){
if (!context.getLevel().isClientSide()) for (BlockPos b : blocks){
context.getLevel().destroyBlock(b, !context.getPlayer().isCreative());
ItemStack stack = context.getPlayer().getItemInHand(context.getHand()).copy();
context.getPlayer().setItemInHand(context.getHand(), stack);
if(!(context.getLevel().getBlockState(b).getBlock().defaultDestroyTime() < 0)){
context.getLevel().destroyBlock(b, !context.getPlayer().isCreative());
ItemStack stack = context.getPlayer().getItemInHand(context.getHand()).copy();
context.getPlayer().setItemInHand(context.getHand(), stack);
}
}
result = InteractionResult.SUCCESS;
}
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"authors": [
"unix-supremacist"
],
"contributors": [
"Nolij"
],
"contact": {
"homepage": "https://unix-supremacist.github.io",
"sources": "https://github.com/unix-supremacist/alchemist"
Expand All @@ -29,6 +32,8 @@
"fabricloader": ">=0.14.21",
"minecraft": "~1.20.1",
"java": ">=17",
"fabric-api": "*"
"fabric-api": "*",
"trinkets": "*",
"playerabilitylib": "*"
}
}

0 comments on commit 677fbb1

Please sign in to comment.