mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
6
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: draycia <lonelyyordle@gmail.com>
|
||||
Date: Tue, 31 Mar 2020 23:48:55 -0700
|
||||
Subject: [PATCH] Configurable villager breeding
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
|
||||
index aaf8d2cd3089adba69c873c4ea62b0e8837b21d6..2ff9dffc0f0b20582f5b3bffd01743ee26c63c20 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
|
||||
@@ -712,7 +712,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
|
||||
@Override
|
||||
public boolean canBreed() {
|
||||
- return this.bx + this.fv() >= 12 && this.getAge() == 0;
|
||||
+ return world.purpurConfig.villagerCanBreed && this.bx + this.fv() >= 12 && this.getAge() == 0; // Purpur
|
||||
}
|
||||
|
||||
private boolean fr() {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 201974ec4db915e5a79ed36625f0870a7ff84207..db5638c4f2b6d672e619c9ba44184b6d9fe113a1 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -517,6 +517,7 @@ public class PurpurWorldConfig {
|
||||
public boolean villagerFollowEmeraldBlock = false;
|
||||
public int villagerSpawnIronGolemRadius = 0;
|
||||
public int villagerSpawnIronGolemLimit = 0;
|
||||
+ public boolean villagerCanBreed = true;
|
||||
private void villagerSettings() {
|
||||
villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
||||
villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||
@@ -525,6 +526,7 @@ public class PurpurWorldConfig {
|
||||
villagerFollowEmeraldBlock = getBoolean("mobs.villager.follow-emerald-blocks", villagerFollowEmeraldBlock);
|
||||
villagerSpawnIronGolemRadius = getInt("mobs.villager.spawn-iron-golem.radius", villagerSpawnIronGolemRadius);
|
||||
villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit);
|
||||
+ villagerCanBreed = getBoolean("mobs.villager.can-breed", villagerCanBreed);
|
||||
}
|
||||
|
||||
public boolean villagerTraderCanBeLeashed = false;
|
||||
@@ -1,43 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: draycia <lonelyyordle@gmail.com>
|
||||
Date: Tue, 14 Apr 2020 00:35:12 -0700
|
||||
Subject: [PATCH] Redstone deactivates spawners
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
|
||||
index 33a5dbcc11455f81088d9fd685a8c4b1b8f4b1f2..b65609bab36650c46e9dabdd25a139ae2af9d83a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
|
||||
@@ -69,6 +69,7 @@ public abstract class MobSpawnerAbstract {
|
||||
private boolean h() {
|
||||
BlockPosition blockposition = this.b();
|
||||
|
||||
+ if (getWorld().purpurConfig.spawnerDeactivateByRedstone && getWorld().isBlockIndirectlyPowered(blockposition)) { return false; } // Purpur
|
||||
return this.a().isAffectsSpawningPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange); // Paper
|
||||
}
|
||||
|
||||
@@ -348,7 +349,7 @@ public abstract class MobSpawnerAbstract {
|
||||
|
||||
public abstract void a(int i);
|
||||
|
||||
- public abstract World a();
|
||||
+ public abstract World a(); public World getWorld() { return a(); } // Purpur - OBFHELPER
|
||||
|
||||
public abstract BlockPosition b();
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index db5638c4f2b6d672e619c9ba44184b6d9fe113a1..a36b9ea779fd984a16332e66f122d9505fad67de 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -330,6 +330,11 @@ public class PurpurWorldConfig {
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
}
|
||||
|
||||
+ public boolean spawnerDeactivateByRedstone = false;
|
||||
+ private void spawnerSettings() {
|
||||
+ spawnerDeactivateByRedstone = getBoolean("blocks.spawner.deactivate-by-redstone", spawnerDeactivateByRedstone);
|
||||
+ }
|
||||
+
|
||||
public boolean turtleEggsBreakFromExpOrbs = true;
|
||||
public boolean turtleEggsBreakFromItems = true;
|
||||
public boolean turtleEggsBreakFromMinecarts = true;
|
||||
@@ -1,46 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: draycia <lonelyyordle@gmail.com>
|
||||
Date: Wed, 29 Apr 2020 00:45:58 -0700
|
||||
Subject: [PATCH] Totems work in inventory
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index 068052f2df6baca9169b1b5bc9c990798649be8f..50b64ab1cbc1940d2f8b5d938e41f5a31830da5b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -1423,6 +1423,19 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.totemOfUndyingWorksInInventory && this instanceof EntityPlayer && (itemstack == null || itemstack.getItem() != Items.TOTEM_OF_UNDYING)) {
|
||||
+ EntityPlayer player = (EntityPlayer) this;
|
||||
+ for (ItemStack item : player.inventory.items) {
|
||||
+ if (item.getItem() == Items.TOTEM_OF_UNDYING) {
|
||||
+ itemstack1 = item;
|
||||
+ itemstack = item.cloneItemStack();
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
EntityResurrectEvent event = new EntityResurrectEvent((LivingEntity) this.getBukkitEntity());
|
||||
event.setCancelled(itemstack == null);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index a36b9ea779fd984a16332e66f122d9505fad67de..ad4da617cf718e1c03e1532a9b45d7f927539a14 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -247,6 +247,11 @@ public class PurpurWorldConfig {
|
||||
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
||||
}
|
||||
|
||||
+ public boolean totemOfUndyingWorksInInventory = false;
|
||||
+ private void totemOfUndyingWorksInInventory() {
|
||||
+ totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
|
||||
+ }
|
||||
+
|
||||
public boolean silkTouchEnabled = false;
|
||||
public String silkTouchSpawnerName = "Spawner";
|
||||
public List<String> silkTouchSpawnerLore = new ArrayList<>();
|
||||
@@ -1,47 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 24 Jul 2020 19:38:21 -0500
|
||||
Subject: [PATCH] Add vindicator johnny spawn chance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java
|
||||
index f0eda0b83bab8e3a8adbb569b5997402b0e08e9a..fe84d6d2b74b6ae00c4c66682107296a40b69adc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java
|
||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
+import net.minecraft.network.chat.ChatMessage;
|
||||
import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.sounds.SoundEffect;
|
||||
@@ -122,6 +123,12 @@ public class EntityVindicator extends EntityIllagerAbstract {
|
||||
((Navigation) this.getNavigation()).a(true);
|
||||
this.a(difficultydamagescaler);
|
||||
this.b(difficultydamagescaler);
|
||||
+ // Purpur start
|
||||
+ World world = worldaccess.getMinecraftWorld();
|
||||
+ if (world.purpurConfig.vindicatorJohnnySpawnChance > 0D && random.nextDouble() <= world.purpurConfig.vindicatorJohnnySpawnChance) {
|
||||
+ setCustomName(new ChatMessage("Johnny"));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
return groupdataentity1;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index ad4da617cf718e1c03e1532a9b45d7f927539a14..b328c9f69fd43ca7ed57ee7f5b46ca998f2cb672 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -40,6 +40,11 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
}
|
||||
|
||||
+ public double vindicatorJohnnySpawnChance = 0D;
|
||||
+ private void vindicatorSettings() {
|
||||
+ vindicatorJohnnySpawnChance = getDouble("mobs.vindicator.johnny.spawn-chance", vindicatorJohnnySpawnChance);
|
||||
+ }
|
||||
+
|
||||
private ConfigurationSection getConfigurationSection(String path) {
|
||||
ConfigurationSection section = PurpurConfig.config.getConfigurationSection("world-settings." + worldName + "." + path);
|
||||
return section != null ? section : PurpurConfig.config.getConfigurationSection("world-settings.default." + path);
|
||||
@@ -1,132 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 4 Aug 2020 17:11:58 -0500
|
||||
Subject: [PATCH] Add option to disable certain block updates
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockChorusFruit.java b/src/main/java/net/minecraft/world/level/block/BlockChorusFruit.java
|
||||
index 42a5345d569661726742a7ca53c2eb09f79a1958..248777af038bcbb20399d2aa24a42e77f8b8a9ba 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockChorusFruit.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockChorusFruit.java
|
||||
@@ -24,6 +24,7 @@ public class BlockChorusFruit extends BlockSprawling {
|
||||
|
||||
@Override
|
||||
public IBlockData getPlacedState(BlockActionContext blockactioncontext) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableChorusPlantUpdates) return this.getBlockData(); // Purpur
|
||||
return this.a((IBlockAccess) blockactioncontext.getWorld(), blockactioncontext.getClickPosition());
|
||||
}
|
||||
|
||||
@@ -40,6 +41,7 @@ public class BlockChorusFruit extends BlockSprawling {
|
||||
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableChorusPlantUpdates) return iblockdata; // Purpur
|
||||
if (!iblockdata.canPlace(generatoraccess, blockposition)) {
|
||||
generatoraccess.getBlockTickList().a(blockposition, this, 1);
|
||||
return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockHugeMushroom.java b/src/main/java/net/minecraft/world/level/block/BlockHugeMushroom.java
|
||||
index 987301bfb9d963e3bebc2653bd95cf7f17a2a1e4..fd61c18905e81b1b193260f1c32b4ad0e29be227 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockHugeMushroom.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockHugeMushroom.java
|
||||
@@ -24,30 +24,57 @@ public class BlockHugeMushroom extends Block {
|
||||
|
||||
public BlockHugeMushroom(BlockBase.Info blockbase_info) {
|
||||
super(blockbase_info);
|
||||
- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockHugeMushroom.a, true)).set(BlockHugeMushroom.b, true)).set(BlockHugeMushroom.c, true)).set(BlockHugeMushroom.d, true)).set(BlockHugeMushroom.e, true)).set(BlockHugeMushroom.f, true));
|
||||
+ this.j(this.blockStateList.getBlockData()
|
||||
+ .set(BlockHugeMushroom.a, true)
|
||||
+ .set(BlockHugeMushroom.b, true)
|
||||
+ .set(BlockHugeMushroom.c, true)
|
||||
+ .set(BlockHugeMushroom.d, true)
|
||||
+ .set(BlockHugeMushroom.e, true)
|
||||
+ .set(BlockHugeMushroom.f, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockData getPlacedState(BlockActionContext blockactioncontext) {
|
||||
World world = blockactioncontext.getWorld();
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return this.getBlockData();
|
||||
BlockPosition blockposition = blockactioncontext.getClickPosition();
|
||||
-
|
||||
- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockHugeMushroom.f, this != world.getType(blockposition.down()).getBlock())).set(BlockHugeMushroom.e, this != world.getType(blockposition.up()).getBlock())).set(BlockHugeMushroom.a, this != world.getType(blockposition.north()).getBlock())).set(BlockHugeMushroom.b, this != world.getType(blockposition.east()).getBlock())).set(BlockHugeMushroom.c, this != world.getType(blockposition.south()).getBlock())).set(BlockHugeMushroom.d, this != world.getType(blockposition.west()).getBlock());
|
||||
+ return this.getBlockData()
|
||||
+ .set(BlockHugeMushroom.f, this != world.getType(blockposition.down()).getBlock())
|
||||
+ .set(BlockHugeMushroom.e, this != world.getType(blockposition.up()).getBlock())
|
||||
+ .set(BlockHugeMushroom.a, this != world.getType(blockposition.north()).getBlock())
|
||||
+ .set(BlockHugeMushroom.b, this != world.getType(blockposition.east()).getBlock())
|
||||
+ .set(BlockHugeMushroom.c, this != world.getType(blockposition.south()).getBlock())
|
||||
+ .set(BlockHugeMushroom.d, this != world.getType(blockposition.west()).getBlock());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
- return iblockdata1.a((Block) this) ? (IBlockData) iblockdata.set((IBlockState) BlockHugeMushroom.g.get(enumdirection), false) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return iblockdata;
|
||||
+ return iblockdata1.a(this) ? iblockdata.set(BlockHugeMushroom.g.get(enumdirection), false) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) {
|
||||
- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.NORTH)), iblockdata.get(BlockHugeMushroom.a))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.SOUTH)), iblockdata.get(BlockHugeMushroom.c))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.EAST)), iblockdata.get(BlockHugeMushroom.b))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.WEST)), iblockdata.get(BlockHugeMushroom.d))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.UP)), iblockdata.get(BlockHugeMushroom.e))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.DOWN)), iblockdata.get(BlockHugeMushroom.f));
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return iblockdata;
|
||||
+ return iblockdata
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.NORTH)), iblockdata.get(BlockHugeMushroom.a))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.SOUTH)), iblockdata.get(BlockHugeMushroom.c))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.EAST)), iblockdata.get(BlockHugeMushroom.b))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.WEST)), iblockdata.get(BlockHugeMushroom.d))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.UP)), iblockdata.get(BlockHugeMushroom.e))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.DOWN)), iblockdata.get(BlockHugeMushroom.f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) {
|
||||
- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.NORTH)), iblockdata.get(BlockHugeMushroom.a))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.SOUTH)), iblockdata.get(BlockHugeMushroom.c))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.EAST)), iblockdata.get(BlockHugeMushroom.b))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.WEST)), iblockdata.get(BlockHugeMushroom.d))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.UP)), iblockdata.get(BlockHugeMushroom.e))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.DOWN)), iblockdata.get(BlockHugeMushroom.f));
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return iblockdata;
|
||||
+ return iblockdata
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.NORTH)), iblockdata.get(BlockHugeMushroom.a))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.SOUTH)), iblockdata.get(BlockHugeMushroom.c))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.EAST)), iblockdata.get(BlockHugeMushroom.b))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.WEST)), iblockdata.get(BlockHugeMushroom.d))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.UP)), iblockdata.get(BlockHugeMushroom.e))
|
||||
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.DOWN)), iblockdata.get(BlockHugeMushroom.f));
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockNote.java b/src/main/java/net/minecraft/world/level/block/BlockNote.java
|
||||
index feec1db88b22a4d13ffd3034633da79ed41b94fe..148718f8f96d94e76a4a7a96d5955b624c2dc661 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockNote.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockNote.java
|
||||
@@ -35,11 +35,13 @@ public class BlockNote extends Block {
|
||||
|
||||
@Override
|
||||
public IBlockData getPlacedState(BlockActionContext blockactioncontext) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableNoteBlockUpdates) return this.getBlockData(); // Purpur
|
||||
return (IBlockData) this.getBlockData().set(BlockNote.INSTRUMENT, BlockPropertyInstrument.a(blockactioncontext.getWorld().getType(blockactioncontext.getClickPosition().down())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableNoteBlockUpdates) return iblockdata; // Purpur
|
||||
return enumdirection == EnumDirection.DOWN ? (IBlockData) iblockdata.set(BlockNote.INSTRUMENT, BlockPropertyInstrument.a(iblockdata1)) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 013f8a21be68f4e0470c0b873252bf21dd611127..ad41b9a096e8618a1a033a47918dd26c75781f96 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -202,6 +202,15 @@ public class PurpurConfig {
|
||||
allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
||||
}
|
||||
|
||||
+ public static boolean disableMushroomBlockUpdates = false;
|
||||
+ public static boolean disableNoteBlockUpdates = false;
|
||||
+ public static boolean disableChorusPlantUpdates = false;
|
||||
+ private static void blockUpdatesSettings() {
|
||||
+ disableMushroomBlockUpdates = getBoolean("settings.blocks.disable-mushroom-updates", disableMushroomBlockUpdates);
|
||||
+ disableNoteBlockUpdates = getBoolean("settings.blocks.disable-note-block-updates", disableNoteBlockUpdates);
|
||||
+ disableChorusPlantUpdates = getBoolean("settings.blocks.disable-chorus-plant-updates", disableChorusPlantUpdates);
|
||||
+ }
|
||||
+
|
||||
public static boolean loggerSuppressInitLegacyMaterialError = false;
|
||||
public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
|
||||
private static void loggerSettings() {
|
||||
@@ -1,85 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 4 Aug 2020 21:11:03 -0500
|
||||
Subject: [PATCH] Dispensers place anvils option
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java
|
||||
index 703bdefeb615ef8d15b428a893b5e4939d726f13..1a765ece1ad6d691c509a018469aa9ecf4f2f8f3 100644
|
||||
--- a/src/main/java/net/minecraft/core/EnumDirection.java
|
||||
+++ b/src/main/java/net/minecraft/core/EnumDirection.java
|
||||
@@ -116,6 +116,7 @@ public enum EnumDirection implements INamable {
|
||||
return fromType1(this.h);
|
||||
}
|
||||
|
||||
+ public EnumDirection rotateCW() { return g(); } // Purpur - OBFHELPER
|
||||
public EnumDirection g() {
|
||||
switch (this) {
|
||||
case NORTH:
|
||||
@@ -131,6 +132,7 @@ public enum EnumDirection implements INamable {
|
||||
}
|
||||
}
|
||||
|
||||
+ public EnumDirection rotateCCW() { return h(); } // Purpur - OBFHELPER
|
||||
public EnumDirection h() {
|
||||
switch (this) {
|
||||
case NORTH:
|
||||
@@ -162,6 +164,7 @@ public enum EnumDirection implements INamable {
|
||||
return this.j;
|
||||
}
|
||||
|
||||
+ public EnumDirection.EnumAxis getAxis() { return n(); } // Purpur - OBFHELPER
|
||||
public EnumDirection.EnumAxis n() {
|
||||
return this.k;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
|
||||
index 0055a96b51a1d38d31e129c417c97bcfc9d0b745..31237773907341ee64c71507b5e1bf247ef2c524 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
|
||||
@@ -52,6 +52,7 @@ import net.minecraft.world.level.IMaterial;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
+import net.minecraft.world.level.block.BlockAnvil;
|
||||
import net.minecraft.world.level.block.BlockBeehive;
|
||||
import net.minecraft.world.level.block.BlockCampfire;
|
||||
import net.minecraft.world.level.block.BlockDispenser;
|
||||
@@ -995,6 +996,23 @@ public interface IDispenseBehavior {
|
||||
}
|
||||
}));
|
||||
BlockDispenser.a((IMaterial) Items.SHEARS.getItem(), (IDispenseBehavior) (new DispenseBehaviorShears()));
|
||||
+ // Purpur start
|
||||
+ BlockDispenser.a(Blocks.ANVIL, new DispenseBehaviorMaybe() {
|
||||
+ @Override
|
||||
+ protected ItemStack a(ISourceBlock dispenser, ItemStack itemstack) {
|
||||
+ World world = dispenser.getWorld();
|
||||
+ if (!world.purpurConfig.dispenserPlaceAnvils) return super.a(dispenser, itemstack);
|
||||
+ EnumDirection facing = dispenser.getBlockData().get(BlockDispenser.FACING);
|
||||
+ BlockPosition blockposition = dispenser.getBlockPosition().shift(facing);
|
||||
+ IBlockData iblockdata = world.getType(blockposition);
|
||||
+ if (iblockdata.isAir()) {
|
||||
+ world.setTypeUpdate(blockposition, Blocks.ANVIL.getBlockData().set(BlockAnvil.FACING, facing.getAxis() == EnumDirection.EnumAxis.Y ? EnumDirection.NORTH : facing.rotateCW()));
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return itemstack;
|
||||
+ }
|
||||
+ });
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
static void a(ISourceBlock isourceblock, Entity entity, EnumDirection enumdirection) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index b328c9f69fd43ca7ed57ee7f5b46ca998f2cb672..54b8021bfac69800d4cec996a94c2fea53249130 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -297,8 +297,10 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
|
||||
public boolean dispenserApplyCursedArmor = true;
|
||||
+ public boolean dispenserPlaceAnvils = false;
|
||||
private void dispenserSettings() {
|
||||
dispenserApplyCursedArmor = getBoolean("blocks.dispenser.apply-cursed-to-armor-slots", dispenserApplyCursedArmor);
|
||||
+ dispenserPlaceAnvils = getBoolean("blocks.dispenser.place-anvils", dispenserPlaceAnvils);
|
||||
}
|
||||
|
||||
public boolean farmlandGetsMoistFromBelow = false;
|
||||
Reference in New Issue
Block a user