Skip to content

Commit

Permalink
[~+] Misc. fixes, Vanilla injections
Browse files Browse the repository at this point in the history
  • Loading branch information
crispytwig committed Feb 7, 2024
1 parent e313541 commit e12a024
Show file tree
Hide file tree
Showing 22 changed files with 140 additions and 61 deletions.
60 changes: 60 additions & 0 deletions src/main/java/com/starfish_studios/foundation/Foundation.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,66 @@ public void onInitialize() {
entries.addAfter(FoundationItems.STONE_FENCE, FoundationItems.STONE_TILES);
entries.addAfter(FoundationItems.STONE_TILES, FoundationItems.STONE_TILE_STAIRS);
entries.addAfter(FoundationItems.STONE_TILE_STAIRS, FoundationItems.STONE_TILE_SLAB);


entries.addAfter(Items.OAK_SLAB, FoundationItems.OAK_LAYER);
entries.addAfter(Items.SPRUCE_SLAB, FoundationItems.SPRUCE_LAYER);
entries.addAfter(Items.BIRCH_SLAB, FoundationItems.BIRCH_LAYER);
entries.addAfter(Items.JUNGLE_SLAB, FoundationItems.JUNGLE_LAYER);
entries.addAfter(Items.ACACIA_SLAB, FoundationItems.ACACIA_LAYER);
entries.addAfter(Items.DARK_OAK_SLAB, FoundationItems.DARK_OAK_LAYER);
entries.addAfter(Items.CRIMSON_SLAB, FoundationItems.CRIMSON_LAYER);
entries.addAfter(Items.WARPED_SLAB, FoundationItems.WARPED_LAYER);
entries.addAfter(Items.MANGROVE_SLAB, FoundationItems.MANGROVE_LAYER);
entries.addAfter(Items.BAMBOO_SLAB, FoundationItems.BAMBOO_LAYER);
entries.addAfter(Items.BAMBOO_MOSAIC_SLAB, FoundationItems.BAMBOO_MOSAIC_LAYER);
entries.addAfter(Items.CHERRY_SLAB, FoundationItems.CHERRY_LAYER);

entries.addAfter(Items.STONE, FoundationItems.STONE_LAYER);
entries.addAfter(Items.COBBLESTONE, FoundationItems.COBBLESTONE_LAYER);
entries.addAfter(Items.MOSSY_COBBLESTONE, FoundationItems.MOSSY_COBBLESTONE_LAYER);
entries.addAfter(Items.SMOOTH_STONE, FoundationItems.SMOOTH_STONE_LAYER);
entries.addAfter(Items.STONE_BRICKS, FoundationItems.STONE_BRICK_LAYER);
entries.addAfter(Items.MOSSY_STONE_BRICKS, FoundationItems.MOSSY_STONE_BRICK_LAYER);

entries.addAfter(Items.GRANITE_SLAB, FoundationItems.GRANITE_LAYER);
entries.addAfter(Items.POLISHED_GRANITE_SLAB, FoundationItems.POLISHED_GRANITE_LAYER);
entries.addAfter(Items.DIORITE_SLAB, FoundationItems.DIORITE_LAYER);
entries.addAfter(Items.POLISHED_DIORITE_SLAB, FoundationItems.POLISHED_DIORITE_LAYER);
entries.addAfter(Items.ANDESITE_SLAB, FoundationItems.ANDESITE_LAYER);
entries.addAfter(Items.POLISHED_ANDESITE_SLAB, FoundationItems.POLISHED_ANDESITE_LAYER);
entries.addAfter(Items.COBBLED_DEEPSLATE_SLAB, FoundationItems.COBBLED_DEEPSLATE_LAYER);
entries.addAfter(Items.POLISHED_DEEPSLATE_SLAB, FoundationItems.POLISHED_DEEPSLATE_LAYER);
entries.addAfter(Items.DEEPSLATE_BRICK_SLAB, FoundationItems.DEEPSLATE_BRICK_LAYER);
entries.addAfter(Items.DEEPSLATE_TILE_SLAB, FoundationItems.DEEPSLATE_TILE_LAYER);

entries.addAfter(Items.BRICK_SLAB, FoundationItems.BRICK_LAYER);
entries.addAfter(Items.MUD_BRICK_SLAB, FoundationItems.MUD_BRICK_LAYER);
entries.addAfter(Items.SANDSTONE_SLAB, FoundationItems.SANDSTONE_LAYER);
entries.addAfter(Items.SMOOTH_SANDSTONE_SLAB, FoundationItems.SMOOTH_SANDSTONE_LAYER);
entries.addAfter(Items.RED_SANDSTONE_SLAB, FoundationItems.RED_SANDSTONE_LAYER);
entries.addAfter(Items.SMOOTH_RED_SANDSTONE_SLAB, FoundationItems.SMOOTH_RED_SANDSTONE_LAYER);
entries.addAfter(Items.PRISMARINE_SLAB, FoundationItems.PRISMARINE_LAYER);
entries.addAfter(Items.PRISMARINE_BRICK_SLAB, FoundationItems.PRISMARINE_BRICK_LAYER);
entries.addAfter(Items.DARK_PRISMARINE_SLAB, FoundationItems.DARK_PRISMARINE_LAYER);
entries.addAfter(Items.NETHER_BRICK_SLAB, FoundationItems.NETHER_BRICK_LAYER);
entries.addAfter(Items.RED_NETHER_BRICK_SLAB, FoundationItems.RED_NETHER_BRICK_LAYER);

entries.addAfter(Items.BLACKSTONE_SLAB, FoundationItems.BLACKSTONE_LAYER);
entries.addAfter(Items.POLISHED_BLACKSTONE_SLAB, FoundationItems.POLISHED_BLACKSTONE_LAYER);
entries.addAfter(Items.POLISHED_BLACKSTONE_BRICK_SLAB, FoundationItems.POLISHED_BLACKSTONE_BRICK_LAYER);
entries.addAfter(Items.END_STONE_BRICK_SLAB, FoundationItems.END_STONE_BRICK_LAYER);
entries.addAfter(Items.PURPUR_SLAB, FoundationItems.PURPUR_LAYER);
entries.addAfter(Items.QUARTZ_SLAB, FoundationItems.QUARTZ_LAYER);

entries.addAfter(Items.CUT_COPPER_SLAB, FoundationItems.CUT_COPPER_LAYER);
entries.addAfter(Items.EXPOSED_CUT_COPPER_SLAB, FoundationItems.EXPOSED_CUT_COPPER_LAYER);
entries.addAfter(Items.WEATHERED_CUT_COPPER_SLAB, FoundationItems.WEATHERED_CUT_COPPER_LAYER);
entries.addAfter(Items.OXIDIZED_CUT_COPPER_SLAB, FoundationItems.OXIDIZED_CUT_COPPER_LAYER);
entries.addAfter(Items.WAXED_CUT_COPPER_SLAB, FoundationItems.WAXED_CUT_COPPER_LAYER);
entries.addAfter(Items.WAXED_EXPOSED_CUT_COPPER_SLAB, FoundationItems.WAXED_EXPOSED_CUT_COPPER_LAYER);
entries.addAfter(Items.WAXED_WEATHERED_CUT_COPPER_SLAB, FoundationItems.WAXED_WEATHERED_CUT_COPPER_LAYER);
entries.addAfter(Items.WAXED_OXIDIZED_CUT_COPPER_SLAB, FoundationItems.WAXED_OXIDIZED_CUT_COPPER_LAYER);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP
if (!open) {
if (blockState.getValue(HINGE).equals(DoorHingeSide.LEFT)) {
boolean openFlag = checkForAirColumn(level, startPos.relative(blockState.getValue(FACING).getOpposite())) && checkForAirColumn(level, startPos.relative(blockState.getValue(FACING).getOpposite()).relative(blockState.getValue(FACING).getCounterClockWise()));
if (!openFlag) return InteractionResult.FAIL;
if (!openFlag) {
level.playSound(player, blockPos, SoundEvents.ZOMBIE_ATTACK_WOODEN_DOOR, SoundSource.BLOCKS, 0.3F, 0.5F);
return InteractionResult.SUCCESS;
}
placeAirColumn(level, startPos.relative(blockState.getValue(FACING).getCounterClockWise()));
placeDoorColumn(blockState, level, startPos, 0, true);
placeDoorColumn(blockState, level, startPos.relative(blockState.getValue(FACING).getOpposite()), 1, true);
Expand All @@ -202,7 +205,11 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP
}
else{
boolean openFlag = checkForAirColumn(level, startPos.relative(blockState.getValue(FACING).getOpposite())) && checkForAirColumn(level, startPos.relative(blockState.getValue(FACING).getOpposite()).relative(blockState.getValue(FACING).getClockWise()));
if (!openFlag) return InteractionResult.FAIL;

if (!openFlag) {
level.playSound(player, blockPos, SoundEvents.ZOMBIE_ATTACK_WOODEN_DOOR, SoundSource.BLOCKS, 0.3F, 0.5F);
return InteractionResult.SUCCESS;
}
placeAirColumn(level, startPos.relative(blockState.getValue(FACING).getClockWise()));
placeDoorColumn(blockState, level, startPos, 0, true);
placeDoorColumn(blockState, level, startPos.relative(blockState.getValue(FACING).getOpposite()), 1, true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.starfish_studios.foundation.block;

import com.starfish_studios.foundation.block.properties.FoundationBlockStateProperties;
import com.starfish_studios.foundation.block.properties.WoodStyle;
import com.starfish_studios.foundation.registry.FoundationItems;
import com.starfish_studios.foundation.registry.FoundationTags;
import net.minecraft.Util;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.InteractionHand;
Expand All @@ -15,12 +14,14 @@
import net.minecraft.world.level.block.LadderBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraft.world.phys.BlockHitResult;
import org.jetbrains.annotations.Nullable;

public class FoundationLadderBlock extends LadderBlock {
public static IntegerProperty STYLE = FoundationBlockStateProperties.STYLE;

public FoundationLadderBlock(int defaultStyle, Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP
level.playSound(player, blockPos, Blocks.SCAFFOLDING.getSoundType(level.getBlockState(blockPos)).getPlaceSound(), player.getSoundSource(), 1.0F, 1.0F);
return InteractionResult.SUCCESS;
}
else if (player.isCrouching()) {
else if (player.isShiftKeyDown()) {
blockState = blockState.cycle(OPEN);
level.setBlock(blockPos, blockState, 2);
if (blockState.getValue(WATERLOGGED)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uvlock": true
},
"facing=north,layers=4": {
"model": "minecraft:block/acacia",
"model": "minecraft:block/acacia_planks",
"uvlock": true
},
"facing=south,layers=1": {
Expand All @@ -54,7 +54,7 @@
"uvlock": true
},
"facing=south,layers=4": {
"model": "minecraft:block/acacia",
"model": "minecraft:block/acacia_planks",
"uvlock": true
},
"facing=west,layers=1": {
Expand All @@ -76,7 +76,7 @@
"uvlock": true
},
"facing=west,layers=4": {
"model": "minecraft:block/acacia",
"model": "minecraft:block/acacia_planks",
"uvlock": true
},
"facing=east,layers=1": {
Expand All @@ -98,7 +98,7 @@
"uvlock": true
},
"facing=east,layers=4": {
"model": "minecraft:block/acacia",
"model": "minecraft:block/acacia_planks",
"uvlock": true
},
"facing=down,layers=1": {
Expand All @@ -117,7 +117,7 @@
"uvlock": true
},
"facing=down,layers=4": {
"model": "minecraft:block/acacia",
"model": "minecraft:block/acacia_planks",
"uvlock": true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uvlock": true
},
"facing=north,layers=4": {
"model": "minecraft:block/bamboo",
"model": "minecraft:block/bamboo_planks",
"uvlock": true
},
"facing=south,layers=1": {
Expand All @@ -54,7 +54,7 @@
"uvlock": true
},
"facing=south,layers=4": {
"model": "minecraft:block/bamboo",
"model": "minecraft:block/bamboo_planks",
"uvlock": true
},
"facing=west,layers=1": {
Expand All @@ -76,7 +76,7 @@
"uvlock": true
},
"facing=west,layers=4": {
"model": "minecraft:block/bamboo",
"model": "minecraft:block/bamboo_planks",
"uvlock": true
},
"facing=east,layers=1": {
Expand All @@ -98,7 +98,7 @@
"uvlock": true
},
"facing=east,layers=4": {
"model": "minecraft:block/bamboo",
"model": "minecraft:block/bamboo_planks",
"uvlock": true
},
"facing=down,layers=1": {
Expand All @@ -117,7 +117,7 @@
"uvlock": true
},
"facing=down,layers=4": {
"model": "minecraft:block/bamboo",
"model": "minecraft:block/bamboo_planks",
"uvlock": true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uvlock": true
},
"facing=north,layers=4": {
"model": "minecraft:block/birch",
"model": "minecraft:block/birch_planks",
"uvlock": true
},
"facing=south,layers=1": {
Expand All @@ -54,7 +54,7 @@
"uvlock": true
},
"facing=south,layers=4": {
"model": "minecraft:block/birch",
"model": "minecraft:block/birch_planks",
"uvlock": true
},
"facing=west,layers=1": {
Expand All @@ -76,7 +76,7 @@
"uvlock": true
},
"facing=west,layers=4": {
"model": "minecraft:block/birch",
"model": "minecraft:block/birch_planks",
"uvlock": true
},
"facing=east,layers=1": {
Expand All @@ -98,7 +98,7 @@
"uvlock": true
},
"facing=east,layers=4": {
"model": "minecraft:block/birch",
"model": "minecraft:block/birch_planks",
"uvlock": true
},
"facing=down,layers=1": {
Expand All @@ -117,7 +117,7 @@
"uvlock": true
},
"facing=down,layers=4": {
"model": "minecraft:block/birch",
"model": "minecraft:block/birch_planks",
"uvlock": true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uvlock": true
},
"facing=north,layers=4": {
"model": "minecraft:block/cherry",
"model": "minecraft:block/cherry_planks",
"uvlock": true
},
"facing=south,layers=1": {
Expand All @@ -54,7 +54,7 @@
"uvlock": true
},
"facing=south,layers=4": {
"model": "minecraft:block/cherry",
"model": "minecraft:block/cherry_planks",
"uvlock": true
},
"facing=west,layers=1": {
Expand All @@ -76,7 +76,7 @@
"uvlock": true
},
"facing=west,layers=4": {
"model": "minecraft:block/cherry",
"model": "minecraft:block/cherry_planks",
"uvlock": true
},
"facing=east,layers=1": {
Expand All @@ -98,7 +98,7 @@
"uvlock": true
},
"facing=east,layers=4": {
"model": "minecraft:block/cherry",
"model": "minecraft:block/cherry_planks",
"uvlock": true
},
"facing=down,layers=1": {
Expand All @@ -117,7 +117,7 @@
"uvlock": true
},
"facing=down,layers=4": {
"model": "minecraft:block/cherry",
"model": "minecraft:block/cherry_planks",
"uvlock": true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uvlock": true
},
"facing=north,layers=4": {
"model": "minecraft:block/crimson",
"model": "minecraft:block/crimson_planks",
"uvlock": true
},
"facing=south,layers=1": {
Expand All @@ -54,7 +54,7 @@
"uvlock": true
},
"facing=south,layers=4": {
"model": "minecraft:block/crimson",
"model": "minecraft:block/crimson_planks",
"uvlock": true
},
"facing=west,layers=1": {
Expand All @@ -76,7 +76,7 @@
"uvlock": true
},
"facing=west,layers=4": {
"model": "minecraft:block/crimson",
"model": "minecraft:block/crimson_planks",
"uvlock": true
},
"facing=east,layers=1": {
Expand All @@ -98,7 +98,7 @@
"uvlock": true
},
"facing=east,layers=4": {
"model": "minecraft:block/crimson",
"model": "minecraft:block/crimson_planks",
"uvlock": true
},
"facing=down,layers=1": {
Expand All @@ -117,7 +117,7 @@
"uvlock": true
},
"facing=down,layers=4": {
"model": "minecraft:block/crimson",
"model": "minecraft:block/crimson_planks",
"uvlock": true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uvlock": true
},
"facing=north,layers=4": {
"model": "minecraft:block/dark_oak",
"model": "minecraft:block/dark_oak_planks",
"uvlock": true
},
"facing=south,layers=1": {
Expand All @@ -54,7 +54,7 @@
"uvlock": true
},
"facing=south,layers=4": {
"model": "minecraft:block/dark_oak",
"model": "minecraft:block/dark_oak_planks",
"uvlock": true
},
"facing=west,layers=1": {
Expand All @@ -76,7 +76,7 @@
"uvlock": true
},
"facing=west,layers=4": {
"model": "minecraft:block/dark_oak",
"model": "minecraft:block/dark_oak_planks",
"uvlock": true
},
"facing=east,layers=1": {
Expand All @@ -98,7 +98,7 @@
"uvlock": true
},
"facing=east,layers=4": {
"model": "minecraft:block/dark_oak",
"model": "minecraft:block/dark_oak_planks",
"uvlock": true
},
"facing=down,layers=1": {
Expand All @@ -117,7 +117,7 @@
"uvlock": true
},
"facing=down,layers=4": {
"model": "minecraft:block/dark_oak",
"model": "minecraft:block/dark_oak_planks",
"uvlock": true
}
}
Expand Down
Loading

0 comments on commit e12a024

Please sign in to comment.