mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
6 more
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 24 Aug 2019 14:42:54 -0500
|
||||
Subject: [PATCH] Ender dragon always drop full exp
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||
index c296fcf80c2f3f210fa020416973ec8d5db541ba..58b9ace88793d1f661b16db1b43433484a697936 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||
@@ -613,7 +613,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||
boolean flag = this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT);
|
||||
short short0 = 500;
|
||||
|
||||
- if (this.bF != null && !this.bF.isPreviouslyKilled()) {
|
||||
+ if (getEnderDragonBattle() != null && (world.purpurConfig.enderDragonAlwaysDropsFullExp || !getEnderDragonBattle().isPreviouslyKilled())) { // Purpur
|
||||
short0 = 12000;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index fa01ef3c0cc723acaaf348066cddf91f1deb3c72..bab91f0416f31a8273593bb7725658674eb41621 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -142,6 +142,11 @@ public class PurpurWorldConfig {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
}
|
||||
|
||||
+ public boolean enderDragonAlwaysDropsFullExp = false;
|
||||
+ private void enderDragonSettings() {
|
||||
+ enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender_dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
|
||||
+ }
|
||||
+
|
||||
public boolean foxTypeChangesWithTulips = false;
|
||||
private void foxSettings() {
|
||||
foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
@@ -1,64 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 24 May 2019 02:39:25 -0500
|
||||
Subject: [PATCH] Signs editable on right click
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockSign.java b/src/main/java/net/minecraft/world/level/block/BlockSign.java
|
||||
index 6b461080439dd9ce5b8d34b79d446558bbd5c1f1..19f4403b9f1142c71e7b2c7c0fd5a78027d4ffe4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockSign.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockSign.java
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.world.EnumHand;
|
||||
import net.minecraft.world.EnumInteractionResult;
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
import net.minecraft.world.item.ItemDye;
|
||||
+import net.minecraft.world.item.ItemSign;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.GeneratorAccess;
|
||||
import net.minecraft.world.level.IBlockAccess;
|
||||
@@ -80,6 +81,17 @@ public abstract class BlockSign extends BlockTileEntity implements IBlockWaterlo
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start - right click to open sign editor
|
||||
+ if (world.purpurConfig.signRightClickEdit && itemstack.getItem() instanceof ItemSign &&
|
||||
+ !entityhuman.isSneaking() && entityhuman.abilities.mayBuild &&
|
||||
+ entityhuman.getBukkitEntity().hasPermission("purpur.sign.edit")) {
|
||||
+ tileentitysign.isEditable = true;
|
||||
+ tileentitysign.a(entityhuman);
|
||||
+ entityhuman.openSign(tileentitysign);
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
return tileentitysign.b(entityhuman) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS;
|
||||
} else {
|
||||
return EnumInteractionResult.PASS;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java
|
||||
index 7f78f388584899b13ff983f0dc37c679bfb1507e..96d0524482281f8570464962c0fd5319199440d7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java
|
||||
@@ -132,6 +132,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
return this.isEditable;
|
||||
}
|
||||
|
||||
+ public void setEditor(EntityHuman entityhuman) { a(entityhuman); } // Purpur - OBFHELPER
|
||||
public void a(EntityHuman entityhuman) {
|
||||
// Paper start
|
||||
//this.c = entityhuman;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index bab91f0416f31a8273593bb7725658674eb41621..ea95a4116371d58eb36be51093af7f0fa28e3dfd 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -109,6 +109,11 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ public boolean signRightClickEdit = false;
|
||||
+ private void signSettings() {
|
||||
+ signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
+ }
|
||||
+
|
||||
public boolean turtleEggsBreakFromExpOrbs = true;
|
||||
public boolean turtleEggsBreakFromItems = true;
|
||||
public boolean turtleEggsBreakFromMinecarts = true;
|
||||
@@ -1,84 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 6 Jun 2019 17:40:30 -0500
|
||||
Subject: [PATCH] Signs allow color codes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
index e06c324d38f1be72a90aa75b96d471b96123ba56..615d4d43b8112a7b101792aebf952b0361be70d5 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
@@ -1425,6 +1425,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
@Override
|
||||
public void openSign(TileEntitySign tileentitysign) {
|
||||
+ if (world.purpurConfig.signAllowColors) this.playerConnection.sendPacket(tileentitysign.getTranslatedUpdatePacket()); // Purpur
|
||||
tileentitysign.a((EntityHuman) this);
|
||||
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
||||
index 293b2c187b813c2cf7204f12eec768fd2e92a233..0bfd2c062afcfc73ff21c69a30f63529502817f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
||||
@@ -3005,6 +3005,15 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
+ // Purpur start
|
||||
+ if (worldserver.purpurConfig.signAllowColors) {
|
||||
+ final org.bukkit.entity.Player bukkitPlayer = player.getBukkitEntity();
|
||||
+ if (bukkitPlayer.hasPermission("purpur.sign.color")) currentLine = currentLine.replaceAll("(?i)&([0-9a-fr])", "\u00a7$1");
|
||||
+ if (bukkitPlayer.hasPermission("purpur.sign.style")) currentLine = currentLine.replaceAll("(?i)&([l-or])", "\u00a7$1");
|
||||
+ if (bukkitPlayer.hasPermission("purpur.sign.magic")) currentLine = currentLine.replaceAll("(?i)&([kr])", "\u00a7$1");
|
||||
+ lines.add(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(currentLine));
|
||||
+ } else
|
||||
+ // Purpur end
|
||||
lines.add(net.kyori.adventure.text.Component.text(SharedConstants.filterAllowedChatCharacters(currentLine))); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
|
||||
}
|
||||
SignChangeEvent event = new SignChangeEvent(org.bukkit.craftbukkit.block.CraftBlock.at(worldserver, blockposition), this.getPlayer(), lines);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java
|
||||
index 96d0524482281f8570464962c0fd5319199440d7..a87a2fa507dc3bd6d9979db5868e7ef6ea1eddbd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.world.level.block.entity;
|
||||
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
+import io.papermc.paper.adventure.PaperAdventure; // Purpur
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.commands.CommandListenerWrapper;
|
||||
import net.minecraft.commands.ICommandListener;
|
||||
@@ -112,6 +113,18 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
this.g[i] = null;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public PacketPlayOutTileEntityData getTranslatedUpdatePacket() {
|
||||
+ NBTTagCompound nbt = save(new NBTTagCompound());
|
||||
+ for (int i = 0; i < 4; ++i) {
|
||||
+ String line = PaperAdventure.LEGACY_AMPERSAND.serialize(PaperAdventure.asAdventure(lines[i]));
|
||||
+ nbt.setString("Text" + (i + 1), net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.gson().serialize(net.kyori.adventure.text.Component.text(line)));
|
||||
+ }
|
||||
+ nbt.setString("PurpurEditor", "true");
|
||||
+ return new PacketPlayOutTileEntityData(position, 9, nbt);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Nullable
|
||||
@Override
|
||||
public PacketPlayOutTileEntityData getUpdatePacket() {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index ea95a4116371d58eb36be51093af7f0fa28e3dfd..b67f87f38d0ff99ff62d2103ecc737317a435102 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -109,8 +109,10 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ public boolean signAllowColors = false;
|
||||
public boolean signRightClickEdit = false;
|
||||
private void signSettings() {
|
||||
+ signAllowColors = getBoolean("blocks.sign.allow-colors", signAllowColors);
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 21 Jun 2019 14:37:10 -0500
|
||||
Subject: [PATCH] Allow soil to moisten from water directly under it
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockSoil.java b/src/main/java/net/minecraft/world/level/block/BlockSoil.java
|
||||
index 3bedb1c6a0f221c7b40ee0a50f676e8b05bd37a7..2bbaa2fb426869223a9b2f07406496c1b0daff3f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockSoil.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockSoil.java
|
||||
@@ -139,19 +139,14 @@ public class BlockSoil extends Block {
|
||||
}
|
||||
|
||||
private static boolean a(IWorldReader iworldreader, BlockPosition blockposition) {
|
||||
- Iterator iterator = BlockPosition.a(blockposition.b(-4, 0, -4), blockposition.b(4, 1, 4)).iterator();
|
||||
-
|
||||
- BlockPosition blockposition1;
|
||||
-
|
||||
- do {
|
||||
- if (!iterator.hasNext()) {
|
||||
- return false;
|
||||
+ // Purpur start
|
||||
+ for (BlockPosition position : BlockPosition.a(blockposition.b(-4, 0, -4), blockposition.b(4, 1, 4))) {
|
||||
+ if (iworldreader.getFluid(position).a(TagsFluid.WATER)) {
|
||||
+ return true;
|
||||
}
|
||||
-
|
||||
- blockposition1 = (BlockPosition) iterator.next();
|
||||
- } while (!iworldreader.getFluid(blockposition1).a((Tag) TagsFluid.WATER));
|
||||
-
|
||||
- return true;
|
||||
+ }
|
||||
+ return ((WorldServer) iworldreader).purpurConfig.farmlandGetsMoistFromBelow && iworldreader.getFluid(blockposition.shift(EnumDirection.DOWN)).a(TagsFluid.WATER);
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index b67f87f38d0ff99ff62d2103ecc737317a435102..2e4a928a3e88fb3d961d9530695cd7154321c79b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -109,6 +109,11 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ public boolean farmlandGetsMoistFromBelow = false;
|
||||
+ private void farmlandSettings() {
|
||||
+ farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
+ }
|
||||
+
|
||||
public boolean signAllowColors = false;
|
||||
public boolean signRightClickEdit = false;
|
||||
private void signSettings() {
|
||||
@@ -1,275 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 29 Jun 2019 02:32:40 -0500
|
||||
Subject: [PATCH] Minecart settings and WASD controls
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java
|
||||
index 4abc87b7e737bc652e84f76a508ab85501d1556f..85b3515feb67a1232d65c0421bb8a08a25090e07 100644
|
||||
--- a/src/main/java/net/minecraft/core/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/core/BlockPosition.java
|
||||
@@ -42,6 +42,12 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
private static final int m = 38;
|
||||
// Paper end
|
||||
|
||||
+ // Purpur start
|
||||
+ public BlockPosition(net.minecraft.world.entity.Entity entity) {
|
||||
+ super(entity.locX(), entity.locY(), entity.locZ());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public BlockPosition(int i, int j, int k) {
|
||||
super(i, j, k);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
index 615d4d43b8112a7b101792aebf952b0361be70d5..e209133b8ae35324c51ed7c8b2703bc1adfd5bf8 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
@@ -963,6 +963,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
if (this.isInvulnerable(damagesource)) {
|
||||
return false;
|
||||
} else {
|
||||
+ if (damagesource == DamageSource.FALL && getRootVehicle() instanceof net.minecraft.world.entity.vehicle.EntityMinecartAbstract && world.purpurConfig.minecartControllable && !world.purpurConfig.minecartControllableFallDamage) return false; // Purpur
|
||||
boolean flag = this.server.j() && this.canPvP() && "fall".equals(damagesource.translationIndex);
|
||||
|
||||
if (!flag && isSpawnInvulnerable() && damagesource != DamageSource.OUT_OF_WORLD) { // Purpur
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index 0a948395a3ef9d472925175b36a6b66082002909..14be521b1019b58508268c21cb1d3cc806e75d17 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -193,9 +193,9 @@ public abstract class EntityLiving extends Entity {
|
||||
protected int aO;protected int getKillCount() { return this.aO; } // Paper - OBFHELPER
|
||||
public float lastDamage;
|
||||
public boolean jumping; // Paper protected -> public
|
||||
- public float aR;
|
||||
- public float aS;
|
||||
- public float aT;
|
||||
+ public float aR; public float getStrafe() { return aR; } public void setStrafe(float strafe) { aR = strafe; } // Purpur - OBFHELPER
|
||||
+ public float aS; public float getVertical() { return aS; } public void setVertical(float vertical) { aS = vertical; } // Purpur - OBFHELPER
|
||||
+ public float aT; public float getForward() { return aT; } public void setForward(float forward) { aT = forward; } // Purpur - OBFHELPER
|
||||
protected int aU;
|
||||
protected double aV;
|
||||
protected double aW;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||
index 75a88ab5d5b0fdb98ea8d61bb6b82049b21101f3..7b49544210d087f5006a83c2a0d5c47c785c567f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||
@@ -105,11 +105,13 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
private double flyingY = 0.949999988079071D; // Paper - restore vanilla precision
|
||||
private double flyingZ = 0.949999988079071D; // Paper - restore vanilla precision
|
||||
public double maxSpeed = 0.4D;
|
||||
+ public double storedMaxSpeed; // Purpur
|
||||
// CraftBukkit end
|
||||
|
||||
protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
this.i = true;
|
||||
+ if (world != null) maxSpeed = storedMaxSpeed = world.purpurConfig.minecartMaxSpeed; // Purpur
|
||||
}
|
||||
|
||||
protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world, double d0, double d1, double d2) {
|
||||
@@ -315,6 +317,12 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ // Purpur start
|
||||
+ if (storedMaxSpeed != world.purpurConfig.minecartMaxSpeed) {
|
||||
+ maxSpeed = storedMaxSpeed = world.purpurConfig.minecartMaxSpeed;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
// CraftBukkit start
|
||||
double prevX = this.locX();
|
||||
double prevY = this.locY();
|
||||
@@ -484,16 +492,62 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
public void a(int i, int j, int k, boolean flag) {}
|
||||
|
||||
+ // Purpur start
|
||||
+ private Double lastSpeed;
|
||||
+
|
||||
+ public double getControllableSpeed() {
|
||||
+ BlockPosition position = new BlockPosition(this);
|
||||
+ Block block = world.getType(position).getBlock();
|
||||
+ if (!block.getMaterial().isSolid()) {
|
||||
+ block = world.getType(position.shift(EnumDirection.DOWN)).getBlock();
|
||||
+ }
|
||||
+ Double speed = world.purpurConfig.minecartControllableBlockSpeeds.get(block);
|
||||
+ if (!block.getMaterial().isSolid()) {
|
||||
+ speed = lastSpeed;
|
||||
+ } else if (speed == null) {
|
||||
+ speed = world.purpurConfig.minecartControllableBaseSpeed;
|
||||
+ }
|
||||
+ return lastSpeed = speed;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
protected void h() {
|
||||
double d0 = this.getMaxSpeed();
|
||||
Vec3D vec3d = this.getMot();
|
||||
|
||||
this.setMot(MathHelper.a(vec3d.x, -d0, d0), vec3d.y, MathHelper.a(vec3d.z, -d0, d0));
|
||||
+
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.minecartControllable && !isInWater() && !isInLava() && !passengers.isEmpty()) {
|
||||
+ Entity passenger = passengers.get(0);
|
||||
+ if (passenger instanceof EntityHuman) {
|
||||
+ EntityHuman entityhuman = (EntityHuman) passenger;
|
||||
+ if (entityhuman.jumping && this.onGround) {
|
||||
+ setMot(new Vec3D(getMot().x, world.purpurConfig.minecartControllableHopBoost, getMot().z));
|
||||
+ }
|
||||
+ if (entityhuman.getForward() != 0.0F) {
|
||||
+ Vector velocity = entityhuman.getBukkitEntity().getEyeLocation().getDirection().normalize().multiply(getControllableSpeed());
|
||||
+ if (entityhuman.getForward() < 0.0) {
|
||||
+ velocity.multiply(-0.5);
|
||||
+ }
|
||||
+ setMot(new Vec3D(velocity.getX(), getMot().y, velocity.getZ()));
|
||||
+ }
|
||||
+ this.yaw = passenger.yaw - 90;
|
||||
+ setStepHeight(world.purpurConfig.minecartControllableStepHeight);
|
||||
+ } else {
|
||||
+ setStepHeight(0.0F);
|
||||
+ }
|
||||
+ } else {
|
||||
+ setStepHeight(0.0F);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
if (this.onGround) {
|
||||
// CraftBukkit start - replace magic numbers with our variables
|
||||
this.setMot(new Vec3D(this.getMot().x * this.derailedX, this.getMot().y * this.derailedY, this.getMot().z * this.derailedZ));
|
||||
// CraftBukkit end
|
||||
}
|
||||
+ else if (world.purpurConfig.minecartControllable) setMot(new Vec3D(getMot().x * derailedX, getMot().y, getMot().z * derailedZ)); // Purpur
|
||||
|
||||
this.move(EnumMoveType.SELF, this.getMot());
|
||||
if (!this.onGround) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemMinecart.java b/src/main/java/net/minecraft/world/item/ItemMinecart.java
|
||||
index 527f3ed664854cdd938c34f00a064bc2f77148cc..1a1de9491a50e9e746e714fcb35633c22674f042 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemMinecart.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemMinecart.java
|
||||
@@ -121,8 +121,10 @@ public class ItemMinecart extends Item {
|
||||
IBlockData iblockdata = world.getType(blockposition);
|
||||
|
||||
if (!iblockdata.a((Tag) TagsBlock.RAILS)) {
|
||||
- return EnumInteractionResult.FAIL;
|
||||
- } else {
|
||||
+ // Purpur start - place minecarts anywhere
|
||||
+ if (!world.purpurConfig.minecartPlaceAnywhere) return EnumInteractionResult.FAIL;
|
||||
+ if (iblockdata.getMaterial().isSolid()) blockposition = blockposition.shift(itemactioncontext.getClickedFace());
|
||||
+ } //else { // Purpur end - place minecarts anywhere
|
||||
ItemStack itemstack = itemactioncontext.getItemStack();
|
||||
|
||||
if (!world.isClientSide) {
|
||||
@@ -149,6 +151,6 @@ public class ItemMinecart extends Item {
|
||||
|
||||
itemstack.subtract(1);
|
||||
return EnumInteractionResult.a(world.isClientSide);
|
||||
- }
|
||||
+ //} // Purpur - place minecarts anywhere
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index 7279893d599351785652279c8827fe0efbd72f12..cfdc602947548970b3fde00dd9fddf4e82c28841 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -83,6 +83,7 @@ public class Block extends BlockBase implements IMaterial {
|
||||
return timing;
|
||||
}
|
||||
// Paper end
|
||||
+ public net.minecraft.world.level.material.Material getMaterial() { return material; } // Purpur - OBFHELPER
|
||||
@Nullable
|
||||
private String name;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 2e4a928a3e88fb3d961d9530695cd7154321c79b..ee4b36f1aad78bcd7e9cc45acb4ca5b957d0d5c5 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1,13 +1,18 @@
|
||||
package net.pl3x.purpur;
|
||||
|
||||
import net.minecraft.core.IRegistry;
|
||||
+import net.minecraft.world.level.block.Block;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
+import java.util.HashMap;
|
||||
import java.util.List;
|
||||
+import java.util.Map;
|
||||
+
|
||||
import static net.pl3x.purpur.PurpurConfig.log;
|
||||
|
||||
public class PurpurWorldConfig {
|
||||
@@ -68,6 +73,68 @@ public class PurpurWorldConfig {
|
||||
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
||||
}
|
||||
|
||||
+ public double minecartMaxSpeed = 0.4D;
|
||||
+ public boolean minecartPlaceAnywhere = false;
|
||||
+ public boolean minecartControllable = false;
|
||||
+ public float minecartControllableStepHeight = 1.0F;
|
||||
+ public double minecartControllableHopBoost = 0.5D;
|
||||
+ public boolean minecartControllableFallDamage = true;
|
||||
+ public double minecartControllableBaseSpeed = 0.1D;
|
||||
+ public Map<Block, Double> minecartControllableBlockSpeeds = new HashMap<>();
|
||||
+ private void minecartSettings() {
|
||||
+ if (PurpurConfig.version < 12) {
|
||||
+ boolean oldBool = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", minecartPlaceAnywhere);
|
||||
+ set("gameplay-mechanics.controllable-minecarts.place-anywhere", null);
|
||||
+ set("gameplay-mechanics.minecart.place-anywhere", oldBool);
|
||||
+ oldBool = getBoolean("gameplay-mechanics.controllable-minecarts.enabled", minecartControllable);
|
||||
+ set("gameplay-mechanics.controllable-minecarts.enabled", null);
|
||||
+ set("gameplay-mechanics.minecart.controllable.enabled", oldBool);
|
||||
+ double oldDouble = getDouble("gameplay-mechanics.controllable-minecarts.step-height", minecartControllableStepHeight);
|
||||
+ set("gameplay-mechanics.controllable-minecarts.step-height", null);
|
||||
+ set("gameplay-mechanics.minecart.controllable.step-height", oldDouble);
|
||||
+ oldDouble = getDouble("gameplay-mechanics.controllable-minecarts.hop-boost", minecartControllableHopBoost);
|
||||
+ set("gameplay-mechanics.controllable-minecarts.hop-boost", null);
|
||||
+ set("gameplay-mechanics.minecart.controllable.hop-boost", oldDouble);
|
||||
+ oldBool = getBoolean("gameplay-mechanics.controllable-minecarts.fall-damage", minecartControllableFallDamage);
|
||||
+ set("gameplay-mechanics.controllable-minecarts.fall-damage", null);
|
||||
+ set("gameplay-mechanics.minecart.controllable.fall-damage", oldBool);
|
||||
+ oldDouble = getDouble("gameplay-mechanics.controllable-minecarts.base-speed", minecartControllableBaseSpeed);
|
||||
+ set("gameplay-mechanics.controllable-minecarts.base-speed", null);
|
||||
+ set("gameplay-mechanics.minecart.controllable.base-speed", oldDouble);
|
||||
+ ConfigurationSection section = getConfigurationSection("gameplay-mechanics.controllable-minecarts.block-speed");
|
||||
+ if (section != null) {
|
||||
+ for (String key : section.getKeys(false)) {
|
||||
+ if ("grass-block".equals(key)) key = "grass_block"; // oopsie
|
||||
+ oldDouble = section.getDouble(key, minecartControllableBaseSpeed);
|
||||
+ set("gameplay-mechanics.controllable-minecarts.block-speed." + key, null);
|
||||
+ set("gameplay-mechanics.minecart.controllable.block-speed." + key, oldDouble);
|
||||
+ }
|
||||
+ set("gameplay-mechanics.controllable-minecarts.block-speed", null);
|
||||
+ }
|
||||
+ set("gameplay-mechanics.controllable-minecarts", null);
|
||||
+ }
|
||||
+
|
||||
+ minecartMaxSpeed = getDouble("gameplay-mechanics.minecart.max-speed", minecartMaxSpeed);
|
||||
+ minecartPlaceAnywhere = getBoolean("gameplay-mechanics.minecart.place-anywhere", minecartPlaceAnywhere);
|
||||
+ minecartControllable = getBoolean("gameplay-mechanics.minecart.controllable.enabled", minecartControllable);
|
||||
+ minecartControllableStepHeight = (float) getDouble("gameplay-mechanics.minecart.controllable.step-height", minecartControllableStepHeight);
|
||||
+ minecartControllableHopBoost = getDouble("gameplay-mechanics.minecart.controllable.hop-boost", minecartControllableHopBoost);
|
||||
+ minecartControllableFallDamage = getBoolean("gameplay-mechanics.minecart.controllable.fall-damage", minecartControllableFallDamage);
|
||||
+ minecartControllableBaseSpeed = getDouble("gameplay-mechanics.minecart.controllable.base-speed", minecartControllableBaseSpeed);
|
||||
+ ConfigurationSection section = getConfigurationSection("gameplay-mechanics.minecart.controllable.block-speed");
|
||||
+ if (section != null) {
|
||||
+ for (String key : section.getKeys(false)) {
|
||||
+ Block block = IRegistry.BLOCK.get(new MinecraftKey(key));
|
||||
+ if (block != Blocks.AIR) {
|
||||
+ minecartControllableBlockSpeeds.put(block, section.getDouble(key, minecartControllableBaseSpeed));
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ set("gameplay-mechanics.minecart.controllable.block-speed.grass_block", 0.3D);
|
||||
+ set("gameplay-mechanics.minecart.controllable.block-speed.stone", 0.5D);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public boolean idleTimeoutKick = true;
|
||||
public boolean idleTimeoutTickNearbyEntities = true;
|
||||
public boolean idleTimeoutCountAsSleeping = false;
|
||||
@@ -1,37 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 3 Jul 2019 23:58:31 -0500
|
||||
Subject: [PATCH] Disable loot drops on death by cramming
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index 14be521b1019b58508268c21cb1d3cc806e75d17..a108c2fa6c4146eba0784f912c3cfa498b86a1e7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -1595,8 +1595,10 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
this.dropInventory(); // CraftBukkit - from below
|
||||
if (this.cW() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
|
||||
+ if (!(damagesource == DamageSource.CRAMMING && world.purpurConfig.disableDropsOnCrammingDeath)) { // Purpur
|
||||
this.a(damagesource, flag);
|
||||
this.dropDeathLoot(damagesource, i, flag);
|
||||
+ } // Purpur
|
||||
}
|
||||
// CraftBukkit start - Call death event
|
||||
org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index ee4b36f1aad78bcd7e9cc45acb4ca5b957d0d5c5..e2f49196642a325ac24f9245d5576547f20a044f 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -146,6 +146,11 @@ public class PurpurWorldConfig {
|
||||
idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
|
||||
}
|
||||
|
||||
+ public boolean disableDropsOnCrammingDeath = false;
|
||||
+ private void miscGameplayMechanicsSettings() {
|
||||
+ disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
+ }
|
||||
+
|
||||
public int playerSpawnInvulnerableTicks = 60;
|
||||
public boolean playerInvulnerableWhileAcceptingResourcePack = false;
|
||||
private void playerInvulnerabilities() {
|
||||
Reference in New Issue
Block a user