mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
remove LivingEntity#safeFallDistance API
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 4 Oct 2020 19:08:53 -0500
|
||||
Subject: [PATCH] Infinity bow settings
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
index 5ca843df5b4caa668953e5e36a9b20fabeb35046..4ae6b98b6a0d41e949b055f0678200a672a1df38 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
@@ -29,7 +29,7 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
int i = this.getUseDuration(stack) - remainingUseTicks;
|
||||
float f = getPowerForTime(i);
|
||||
if (!((double)f < 0.1)) {
|
||||
- List<ItemStack> list = draw(stack, itemStack, player);
|
||||
+ List<ItemStack> list = draw(stack, itemStack, player, !((itemStack.is(Items.ARROW) && world.purpurConfig.infinityWorksWithNormalArrows) || (itemStack.is(Items.TIPPED_ARROW) && world.purpurConfig.infinityWorksWithTippedArrows) || (itemStack.is(Items.SPECTRAL_ARROW) && world.purpurConfig.infinityWorksWithSpectralArrows)));
|
||||
if (!world.isClientSide() && !list.isEmpty()) {
|
||||
this.shoot(world, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
|
||||
ItemStack itemStack = user.getItemInHand(hand);
|
||||
boolean bl = !user.getProjectile(itemStack).isEmpty();
|
||||
- if (!user.hasInfiniteMaterials() && !bl) {
|
||||
+ if (!(world.purpurConfig.infinityWorksWithoutArrows && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, itemStack) > 0) && !user.hasInfiniteMaterials() && !bl) {
|
||||
return InteractionResultHolder.fail(itemStack);
|
||||
} else {
|
||||
user.startUsingItem(hand);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index e6aa3036b089b509a6187e9909c353eb129369b9..4b88a659aeff786bcca0e8bd068fa6dadf63d17e 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -140,6 +140,17 @@ public class PurpurWorldConfig {
|
||||
entityLifeSpan = getInt("gameplay-mechanics.entity-lifespan", entityLifeSpan);
|
||||
}
|
||||
|
||||
+ public boolean infinityWorksWithoutArrows = false;
|
||||
+ public boolean infinityWorksWithNormalArrows = true;
|
||||
+ public boolean infinityWorksWithSpectralArrows = false;
|
||||
+ public boolean infinityWorksWithTippedArrows = false;
|
||||
+ private void infinityArrowsSettings() {
|
||||
+ infinityWorksWithoutArrows = getBoolean("gameplay-mechanics.infinity-bow.works-without-arrows", infinityWorksWithoutArrows);
|
||||
+ infinityWorksWithNormalArrows = getBoolean("gameplay-mechanics.infinity-bow.normal-arrows", infinityWorksWithNormalArrows);
|
||||
+ infinityWorksWithSpectralArrows = getBoolean("gameplay-mechanics.infinity-bow.spectral-arrows", infinityWorksWithSpectralArrows);
|
||||
+ infinityWorksWithTippedArrows = getBoolean("gameplay-mechanics.infinity-bow.tipped-arrows", infinityWorksWithTippedArrows);
|
||||
+ }
|
||||
+
|
||||
public List<Item> itemImmuneToCactus = new ArrayList<>();
|
||||
public List<Item> itemImmuneToExplosion = new ArrayList<>();
|
||||
public List<Item> itemImmuneToFire = new ArrayList<>();
|
||||
Reference in New Issue
Block a user