Skip to content

Commit

Permalink
Merge pull request #3 from ubionexd/wearability
Browse files Browse the repository at this point in the history
Wearability
  • Loading branch information
ubionexd authored Jul 31, 2023
2 parents 73f7ec1 + 76e5160 commit 1847e04
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx1G
org.gradle.parallel = true

# Mod Properties
version = 1.0.0
version = 1.1.0
maven_group = net.ubinull
archives_base_name = pineapple

Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[versions]
# The latest versions are available at https://lambdaurora.dev/tools/import_quilt.html
minecraft = "1.20.1"
quilt_mappings = "1.20.1+build.20"
quilt_loader = "0.19.3-beta.1"
quilt_mappings = "1.20.1+build.21"
quilt_loader = "0.19.2" # moved back to a stable release for better compatibility

quilted_fabric_api = "7.0.6+0.85.0-1.20.1"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/ubinull/pineapple/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.quiltmc.qsl.item.setting.api.QuiltItemSettings;

public class ModBlocks {
public static final Block PINEAPPLE = registerBlock("pineapple", new PineappleBlock(QuiltBlockSettings.copyOf(Blocks.PUMPKIN).nonOpaque().breakInstantly()));
public static final Block PINEAPPLE = registerBlock("pineapple", new PineappleBlock(QuiltBlockSettings.copyOf(Blocks.CARVED_PUMPKIN).nonOpaque().breakInstantly()));

private static void buildingBlocksItemGroupAdd(FabricItemGroupEntries entries) {
entries.addItem(PINEAPPLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import net.minecraft.block.BlockState;
import net.minecraft.block.HorizontalFacingBlock;
import net.minecraft.block.ShapeContext;
import net.minecraft.client.particle.ItemBreakParticle;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleManager;
import net.minecraft.client.render.BlockBreakingInfo;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.Equippable;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.DirectionProperty;
Expand All @@ -19,20 +17,19 @@
import net.minecraft.world.BlockView;
import org.jetbrains.annotations.Nullable;

public class PineappleBlock extends HorizontalFacingBlock {
public class PineappleBlock extends HorizontalFacingBlock implements Equippable {
public static final DirectionProperty FACING = Properties.HORIZONTAL_FACING;
private static final VoxelShape SHAPE = Block.createCuboidShape(3.5, 0, 3.5, 12.5, 10, 12.5);

public PineappleBlock(Settings settings) {
super(settings);
}

@Override
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
return SHAPE;
}

public static final DirectionProperty FACING = Properties.HORIZONTAL_FACING;

public PineappleBlock(Settings settings) {
super(settings);
}

@Nullable
@Override
public BlockState getPlacementState(ItemPlacementContext ctx) {
Expand All @@ -54,4 +51,7 @@ protected void appendProperties(StateManager.Builder<Block, BlockState> builder)
builder.add(FACING);
}

public EquipmentSlot getPreferredSlot() {
return EquipmentSlot.HEAD;
}
}
6 changes: 3 additions & 3 deletions src/main/resources/quilt.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"depends": [
{
"id": "quilt_loader",
"versions": ">=0.17.0-"
"versions": ">=0.19.2-"
},
{
"id": "quilted_fabric_api",
"versions": ">=4.0.0-"
"versions": ">=7.0.6-"
},
{
"id": "minecraft",
"versions": ">=1.19.2"
"versions": ">=1.20.1"
}
]
}
Expand Down

0 comments on commit 1847e04

Please sign in to comment.