Skip to content

Commit

Permalink
backport 2.2.5 fixes from 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Oct 10, 2024
1 parent af8e99f commit 493d3f8
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 35 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# suppress inspection "UnusedProperty" for whole file
org.gradle.jvmargs=-Xmx2G

paradiseLostVersion=2.2.4-beta+1.20.3
paradiseLostVersion=2.2.5-beta+1.20.3

minecraft_version=1.20.3
yarn_mappings=1.20.3+build.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ public void tryCraft() {
if (convertBlock != Blocks.BEE_NEST) {
stack.decrement(1);

if (convertBlock != world.getBlockState(this.pos).getBlock()) {
world.setBlockState(attachedPos, convertBlock.getDefaultState(), 0);
if (convertBlock != attachedBlock.getBlock()) {
world.setBlockState(attachedPos, convertBlock.getDefaultState());
}
if (!world.isClient) world.playSound(null, pos, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.BLOCKS, 0.5f, world.getRandom().nextFloat() * 0.4f + 0.8f);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.Blocks;
import net.minecraft.block.ShapeContext;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
Expand Down Expand Up @@ -71,7 +72,7 @@ public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {

BlockPos blockPos = pos.offset(direction.getOpposite());
BlockState blockState = world.getBlockState(blockPos);
return blockState.isSideSolidFullSquare(world, blockPos, direction);
return blockState.isSideSolidFullSquare(world, blockPos, direction) || blockState.isOf(Blocks.DRAGON_HEAD);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@

import net.fabricmc.yarn.constants.MiningLevels;
import net.id.paradiselost.items.ParadiseLostItems;
import net.id.paradiselost.items.utils.IngredientUtil;
import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Lazy;

import java.util.function.Supplier;

import static net.id.paradiselost.items.tools.ParadiseLostToolMaterials.ParadiseToolMaterial.create;

@SuppressWarnings("unused")
public class ParadiseLostToolMaterials {
public static ToolMaterial OLVITE = create(MiningLevels.IRON, 250, 4.5f, 2f, 14, () -> IngredientUtil.itemIngredient(ParadiseLostItems.OLVITE));
public static ToolMaterial SURTRUM = create(MiningLevels.DIAMOND, 827, 7.0f, 3f, 16, () -> IngredientUtil.itemIngredient(ParadiseLostItems.REFINED_SURTRUM));
public static ToolMaterial GLAZED_GOLD = create(MiningLevels.IRON, 131, 12f, 2f, 22, () -> IngredientUtil.itemIngredient(ParadiseLostItems.GOLDEN_AMBER));

public static final ToolMaterial OLVITE = create(MiningLevels.IRON, 250, 4.5f, 2f, 14, () -> Ingredient.ofItems(ParadiseLostItems.OLVITE));
public static ToolMaterial SURTRUM = create(MiningLevels.DIAMOND, 827, 7.0f, 3f, 16, () -> Ingredient.ofItems(ParadiseLostItems.REFINED_SURTRUM));
public static ToolMaterial GLAZED_GOLD = create(MiningLevels.IRON, 131, 12f, 2f, 22, () -> Ingredient.ofItems(ParadiseLostItems.GOLDEN_AMBER));


static class ParadiseToolMaterial implements ToolMaterial {
Expand All @@ -26,18 +23,18 @@ static class ParadiseToolMaterial implements ToolMaterial {
private final float miningSpeed;
private final float attackDamage;
private final int enchantability;
private final Lazy<Ingredient> repairIngredient;
private final Supplier<Ingredient> repairIngredient;

ParadiseToolMaterial(int miningLevel, int itemDurability, float miningSpeed, float attackDamage, int enchantability, Supplier repairIngredient) {
ParadiseToolMaterial(int miningLevel, int itemDurability, float miningSpeed, float attackDamage, int enchantability, Supplier<Ingredient> repairIngredient) {
this.miningLevel = miningLevel;
this.itemDurability = itemDurability;
this.miningSpeed = miningSpeed;
this.attackDamage = attackDamage;
this.enchantability = enchantability;
this.repairIngredient = new Lazy(repairIngredient);
this.repairIngredient = repairIngredient;
}

public static ParadiseToolMaterial create(int miningLevel, int itemDurability, float miningSpeed, float attackDamage, int enchantability, Supplier repairIngredient) {
public static ParadiseToolMaterial create(int miningLevel, int itemDurability, float miningSpeed, float attackDamage, int enchantability, Supplier<Ingredient> repairIngredient) {
return new ParadiseToolMaterial(miningLevel, itemDurability, miningSpeed, attackDamage, enchantability, repairIngredient);
}

Expand Down
17 changes: 0 additions & 17 deletions src/main/java/net/id/paradiselost/items/utils/IngredientUtil.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
"##",
"##"
],
"key": {
"#": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
],
"result": {
"item": "paradise_lost:flaxweave",
"count": 9
"count": 4
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "paradise_lost:tree_tap",
"ingredient": {
"item": "minecraft:glass_bottle"
},
"tapped_block": "minecraft:dragon_head",
"result_block": "minecraft:dragon_head",
"result": {
"item": "minecraft:dragon_breath"
},
"chance": 8
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "paradise_lost:tree_tap",
"ingredient": {
"item": "minecraft:glass_bottle"
},
"tapped_block": "minecraft:crying_obsidian",
"result_block": "minecraft:obsidian",
"result": {
"item": "minecraft:potion",
"nbt": {
"Potion": "minecraft:regeneration"
}
},
"chance": 2
}

0 comments on commit 493d3f8

Please sign in to comment.