10208 lines
562 KiB
Diff
10208 lines
562 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: AlphaKR93 <dev@alpha93.kr>
|
|
Date: Sun, 23 Feb 2025 15:30:22 +0900
|
|
Subject: [PATCH] Remove unused client-side features
|
|
|
|
|
|
diff --git a/ca/spottedleaf/moonrise/patches/starlight/light/BlockStarLightEngine.java b/ca/spottedleaf/moonrise/patches/starlight/light/BlockStarLightEngine.java
|
|
index fa7b784a89626e8528c249d7889a598bd7ee3d49..4a14e9f297915f4e73c75358a69cc736ff7c80c3 100644
|
|
--- a/ca/spottedleaf/moonrise/patches/starlight/light/BlockStarLightEngine.java
|
|
+++ b/ca/spottedleaf/moonrise/patches/starlight/light/BlockStarLightEngine.java
|
|
@@ -46,7 +46,7 @@ public final class BlockStarLightEngine extends StarLightEngine {
|
|
|
|
@Override
|
|
protected boolean canUseChunk(final ChunkAccess chunk) {
|
|
- return chunk.getPersistedStatus().isOrAfter(ChunkStatus.LIGHT) && (this.isClientSide || chunk.isLightCorrect());
|
|
+ return chunk.getPersistedStatus().isOrAfter(ChunkStatus.LIGHT) && (/*this.isClientSide = false ||*/ chunk.isLightCorrect()); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/ca/spottedleaf/moonrise/patches/starlight/light/SkyStarLightEngine.java b/ca/spottedleaf/moonrise/patches/starlight/light/SkyStarLightEngine.java
|
|
index f9aef289e9a2d6f63c98c72c56ef32b8793f57f4..d3b2f74348b3b8327d8d4adf37930faad7dbb981 100644
|
|
--- a/ca/spottedleaf/moonrise/patches/starlight/light/SkyStarLightEngine.java
|
|
+++ b/ca/spottedleaf/moonrise/patches/starlight/light/SkyStarLightEngine.java
|
|
@@ -229,7 +229,7 @@ public final class SkyStarLightEngine extends StarLightEngine {
|
|
@Override
|
|
protected boolean canUseChunk(final ChunkAccess chunk) {
|
|
// can only use chunks for sky stuff if their sections have been init'd
|
|
- return chunk.getPersistedStatus().isOrAfter(ChunkStatus.LIGHT) && (this.isClientSide || chunk.isLightCorrect());
|
|
+ return chunk.getPersistedStatus().isOrAfter(ChunkStatus.LIGHT) && (/*this.isClientSide = false ||*/ chunk.isLightCorrect()); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/ca/spottedleaf/moonrise/patches/starlight/light/StarLightEngine.java b/ca/spottedleaf/moonrise/patches/starlight/light/StarLightEngine.java
|
|
index 035cffcc9026bc0a531e70429d79ca6be72d3442..12850506777f009f2528d74ee04905a10f2809e2 100644
|
|
--- a/ca/spottedleaf/moonrise/patches/starlight/light/StarLightEngine.java
|
|
+++ b/ca/spottedleaf/moonrise/patches/starlight/light/StarLightEngine.java
|
|
@@ -124,7 +124,7 @@ public abstract class StarLightEngine {
|
|
|
|
protected final boolean skylightPropagator;
|
|
protected final int emittedLightMask;
|
|
- protected final boolean isClientSide;
|
|
+ //protected final boolean isClientSide; // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
protected final Level world;
|
|
protected final int minLightSection;
|
|
@@ -135,7 +135,7 @@ public abstract class StarLightEngine {
|
|
protected StarLightEngine(final boolean skylightPropagator, final Level world) {
|
|
this.skylightPropagator = skylightPropagator;
|
|
this.emittedLightMask = skylightPropagator ? 0 : 0xF;
|
|
- this.isClientSide = world.isClientSide;
|
|
+ //this.isClientSide = world.isClientSide; // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.world = world;
|
|
this.minLightSection = WorldUtil.getMinLightSection(world);
|
|
this.maxLightSection = WorldUtil.getMaxLightSection(world);
|
|
@@ -275,9 +275,10 @@ public abstract class StarLightEngine {
|
|
Arrays.fill(this.nibbleCache, null);
|
|
Arrays.fill(this.chunkCache, null);
|
|
Arrays.fill(this.emptinessMapCache, null);
|
|
- if (this.isClientSide) {
|
|
+ /* if (this.isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
Arrays.fill(this.notifyUpdateCache, false);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
protected final BlockState getBlockState(final int worldX, final int worldY, final int worldZ) {
|
|
@@ -318,7 +319,7 @@ public abstract class StarLightEngine {
|
|
|
|
if (nibble != null) {
|
|
nibble.set((worldX & 15) | ((worldZ & 15) << 4) | ((worldY & 15) << 8), level);
|
|
- if (this.isClientSide) {
|
|
+ /* if (this.isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
int cx1 = (worldX - 1) >> 4;
|
|
int cx2 = (worldX + 1) >> 4;
|
|
int cy1 = (worldY - 1) >> 4;
|
|
@@ -333,11 +334,13 @@ public abstract class StarLightEngine {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer; Unused codes
|
|
protected final void postLightUpdate(final int worldX, final int worldY, final int worldZ) {
|
|
- if (this.isClientSide) {
|
|
+ if (this.isClientSide) { // == false // Plazma - marking
|
|
int cx1 = (worldX - 1) >> 4;
|
|
int cx2 = (worldX + 1) >> 4;
|
|
int cy1 = (worldY - 1) >> 4;
|
|
@@ -359,7 +362,7 @@ public abstract class StarLightEngine {
|
|
|
|
if (nibble != null) {
|
|
nibble.set(localIndex, level);
|
|
- if (this.isClientSide) {
|
|
+ if (this.isClientSide) { // == false // Plazma - marking
|
|
int cx1 = (worldX - 1) >> 4;
|
|
int cx2 = (worldX + 1) >> 4;
|
|
int cy1 = (worldY - 1) >> 4;
|
|
@@ -376,6 +379,7 @@ public abstract class StarLightEngine {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer; Unused functions
|
|
|
|
protected final boolean[] getEmptinessMap(final int chunkX, final int chunkZ) {
|
|
return this.emptinessMapCache[chunkX + 5*chunkZ + this.chunkIndexOffset];
|
|
@@ -1166,7 +1170,7 @@ public abstract class StarLightEngine {
|
|
}
|
|
|
|
currentNibble.set(localIndex, targetLevel);
|
|
- this.postLightUpdate(offX, offY, offZ);
|
|
+ //this.postLightUpdate(offX, offY, offZ); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (targetLevel > 1) {
|
|
if (queueLength >= queue.length) {
|
|
@@ -1225,7 +1229,7 @@ public abstract class StarLightEngine {
|
|
}
|
|
|
|
currentNibble.set(localIndex, targetLevel);
|
|
- this.postLightUpdate(offX, offY, offZ);
|
|
+ //this.postLightUpdate(offX, offY, offZ); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (targetLevel > 1) {
|
|
if (queueLength >= queue.length) {
|
|
@@ -1331,7 +1335,7 @@ public abstract class StarLightEngine {
|
|
}
|
|
|
|
currentNibble.set(localIndex, 0);
|
|
- this.postLightUpdate(offX, offY, offZ);
|
|
+ //this.postLightUpdate(offX, offY, offZ); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (targetLevel > 0) {
|
|
if (queueLength >= queue.length) {
|
|
@@ -1414,7 +1418,7 @@ public abstract class StarLightEngine {
|
|
}
|
|
|
|
currentNibble.set(localIndex, 0);
|
|
- this.postLightUpdate(offX, offY, offZ);
|
|
+ //this.postLightUpdate(offX, offY, offZ); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (targetLevel > 0) { // we actually need to propagate 0 just in case we find a neighbour...
|
|
if (queueLength >= queue.length) {
|
|
diff --git a/net/minecraft/core/cauldron/CauldronInteraction.java b/net/minecraft/core/cauldron/CauldronInteraction.java
|
|
index 7dd21a31c4ba37cb804684bd73bea7fcfb7f3cf3..2ac4354917b373e3639a323820b8f0b6edabd715 100644
|
|
--- a/net/minecraft/core/cauldron/CauldronInteraction.java
|
|
+++ b/net/minecraft/core/cauldron/CauldronInteraction.java
|
|
@@ -56,7 +56,7 @@ public interface CauldronInteraction {
|
|
map.put(Items.POTION, (state, level, pos, player, hand, stack, hitDirection) -> { // Paper - add hitDirection
|
|
PotionContents potionContents = stack.get(DataComponents.POTION_CONTENTS);
|
|
if (potionContents != null && potionContents.is(Potions.WATER)) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
if (!LayeredCauldronBlock.changeLevel(level, pos, Blocks.WATER_CAULDRON.defaultBlockState(), player, org.bukkit.event.block.CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY, false)) { // Paper - Call CauldronLevelChangeEvent
|
|
return InteractionResult.SUCCESS;
|
|
@@ -69,7 +69,7 @@ public interface CauldronInteraction {
|
|
// level.setBlockAndUpdate(pos, Blocks.WATER_CAULDRON.defaultBlockState()); // CraftBukkit
|
|
level.playSound(null, pos, SoundEvents.BOTTLE_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
level.gameEvent(null, GameEvent.FLUID_PLACE, pos);
|
|
- }
|
|
+ // // Plazma - Remove isClientSide on DedicatedServer}
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
@@ -93,7 +93,7 @@ public interface CauldronInteraction {
|
|
)
|
|
);
|
|
map1.put(Items.GLASS_BOTTLE, (state, level, pos, player, hand, stack, hitDirection) -> { // Paper - add hitDirection
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
if (!LayeredCauldronBlock.lowerFillLevel(state, level, pos, player, org.bukkit.event.block.CauldronLevelChangeEvent.ChangeReason.BOTTLE_FILL)) {
|
|
return InteractionResult.SUCCESS;
|
|
@@ -106,7 +106,7 @@ public interface CauldronInteraction {
|
|
// LayeredCauldronBlock.lowerFillLevel(state, level, pos); // CraftBukkit
|
|
level.playSound(null, pos, SoundEvents.BOTTLE_FILL, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
level.gameEvent(null, GameEvent.FLUID_PICKUP, pos);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
});
|
|
@@ -116,7 +116,7 @@ public interface CauldronInteraction {
|
|
} else {
|
|
PotionContents potionContents = stack.get(DataComponents.POTION_CONTENTS);
|
|
if (potionContents != null && potionContents.is(Potions.WATER)) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
if (!LayeredCauldronBlock.changeLevel(level, pos, state.cycle(LayeredCauldronBlock.LEVEL), player, org.bukkit.event.block.CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY, false)) { // Paper - Call CauldronLevelChangeEvent
|
|
return InteractionResult.SUCCESS;
|
|
@@ -128,7 +128,7 @@ public interface CauldronInteraction {
|
|
// level.setBlockAndUpdate(pos, state.cycle(LayeredCauldronBlock.LEVEL)); // CraftBukkit
|
|
level.playSound(null, pos, SoundEvents.BOTTLE_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
level.gameEvent(null, GameEvent.FLUID_PLACE, pos);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
@@ -225,7 +225,7 @@ public interface CauldronInteraction {
|
|
if (!statePredicate.test(state)) {
|
|
return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
} else {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// Paper start - fire PlayerBucketFillEvent
|
|
if (hitDirection != null) {
|
|
org.bukkit.event.player.PlayerBucketEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerBucketFillEvent((net.minecraft.server.level.ServerLevel) level, player, pos, pos, hitDirection, emptyStack, filledStack.getItem(), hand);
|
|
@@ -247,7 +247,7 @@ public interface CauldronInteraction {
|
|
// level.setBlockAndUpdate(pos, Blocks.CAULDRON.defaultBlockState()); // CraftBukkit
|
|
level.playSound(null, pos, fillSound, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
level.gameEvent(null, GameEvent.FLUID_PICKUP, pos);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
@@ -261,7 +261,7 @@ public interface CauldronInteraction {
|
|
}
|
|
static InteractionResult emptyBucket(Level level, BlockPos pos, Player player, InteractionHand hand, ItemStack filledStackl, BlockState state, SoundEvent emptySound, @javax.annotation.Nullable net.minecraft.core.Direction hitDirection) {
|
|
// Paper end - add hitDirection
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// Paper start - fire PlayerBucketEmptyEvent
|
|
ItemStack output = new ItemStack(Items.BUCKET);
|
|
if (hitDirection != null) {
|
|
@@ -284,7 +284,7 @@ public interface CauldronInteraction {
|
|
// level.setBlockAndUpdate(pos, state); // CraftBukkit
|
|
level.playSound(null, pos, emptySound, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
level.gameEvent(null, GameEvent.FLUID_PLACE, pos);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
@@ -332,7 +332,7 @@ public interface CauldronInteraction {
|
|
if (!(block instanceof ShulkerBoxBlock)) {
|
|
return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
} else {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
if (!LayeredCauldronBlock.lowerFillLevel(state, level, pos, player, org.bukkit.event.block.CauldronLevelChangeEvent.ChangeReason.SHULKER_WASH)) {
|
|
return InteractionResult.SUCCESS;
|
|
@@ -342,7 +342,7 @@ public interface CauldronInteraction {
|
|
player.setItemInHand(hand, ItemUtils.createFilledResult(stack, player, itemStack, false));
|
|
player.awardStat(Stats.CLEAN_SHULKER_BOX);
|
|
// LayeredCauldronBlock.lowerFillLevel(state, level, pos); // CraftBukkit
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
@@ -353,7 +353,7 @@ public interface CauldronInteraction {
|
|
if (bannerPatternLayers.layers().isEmpty()) {
|
|
return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
} else {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
if (!LayeredCauldronBlock.lowerFillLevel(state, level, pos, player, org.bukkit.event.block.CauldronLevelChangeEvent.ChangeReason.BANNER_WASH)) {
|
|
return InteractionResult.SUCCESS;
|
|
@@ -364,7 +364,7 @@ public interface CauldronInteraction {
|
|
player.setItemInHand(hand, ItemUtils.createFilledResult(stack, player, itemStack, false));
|
|
player.awardStat(Stats.CLEAN_BANNER);
|
|
// LayeredCauldronBlock.lowerFillLevel(state, level, pos); // CraftBukkit
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
@@ -376,7 +376,7 @@ public interface CauldronInteraction {
|
|
} else if (!stack.has(DataComponents.DYED_COLOR)) {
|
|
return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
} else {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
if (!LayeredCauldronBlock.lowerFillLevel(state, level, pos, player, org.bukkit.event.block.CauldronLevelChangeEvent.ChangeReason.ARMOR_WASH)) {
|
|
return InteractionResult.SUCCESS;
|
|
@@ -385,7 +385,7 @@ public interface CauldronInteraction {
|
|
stack.remove(DataComponents.DYED_COLOR);
|
|
player.awardStat(Stats.CLEAN_ARMOR);
|
|
// LayeredCauldronBlock.lowerFillLevel(state, level, pos); // CraftBukkit
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/core/dispenser/DispenseItemBehavior.java b/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
|
index 5fe6e2fbab0feb90c7a3965add8e8b9c1e3f83a1..f5d079d854cad7a9d5f53475f6df1c7ded0391ba 100644
|
|
--- a/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
|
+++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
|
@@ -504,7 +504,7 @@ public interface DispenseItemBehavior {
|
|
// CraftBukkit end
|
|
if (!BoneMealItem.growCrop(item, level, blockPos) && !BoneMealItem.growWaterPlant(item, level, blockPos, null)) {
|
|
this.setSuccess(false);
|
|
- } else if (!level.isClientSide) {
|
|
+ } else /*if (!level.isClientSide)*/ { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
level.levelEvent(1505, blockPos, 15);
|
|
}
|
|
// CraftBukkit start
|
|
@@ -663,10 +663,10 @@ public interface DispenseItemBehavior {
|
|
}
|
|
// CraftBukkit end
|
|
if (level.isEmptyBlock(blockPos) && carvedPumpkinBlock.canSpawnGolem(level, blockPos)) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
level.setBlock(blockPos, carvedPumpkinBlock.defaultBlockState(), 3);
|
|
level.gameEvent(null, GameEvent.BLOCK_PLACE, blockPos);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
item.shrink(1);
|
|
this.setSuccess(true);
|
|
@@ -861,7 +861,7 @@ public interface DispenseItemBehavior {
|
|
return result;
|
|
}
|
|
// Paper end - Call missing BlockDispenseEvent
|
|
- if (!serverLevel.isClientSide) {
|
|
+ //if (!serverLevel.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
for (int i = 0; i < 5; i++) {
|
|
serverLevel.sendParticles(
|
|
ParticleTypes.SPLASH,
|
|
@@ -875,7 +875,7 @@ public interface DispenseItemBehavior {
|
|
1.0
|
|
);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
serverLevel.playSound(null, blockPos, SoundEvents.BOTTLE_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
serverLevel.gameEvent(null, GameEvent.FLUID_PLACE, blockPos);
|
|
diff --git a/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
|
index 626e9feb6a6e7a2cbc7c63e30ba4fb6b923e85c7..22050e61506e1f3c2f4998ac1e3de4a3117bd63b 100644
|
|
--- a/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
|
+++ b/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
|
@@ -43,13 +43,13 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
|
|
}
|
|
}
|
|
// CraftBukkit end
|
|
- if (!serverLevel.isClientSide()) {
|
|
+ //if (!serverLevel.isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockPos blockPos = blockSource.pos().relative(blockSource.state().getValue(DispenserBlock.FACING));
|
|
this.setSuccess(tryShearBeehive(serverLevel, blockPos) || tryShearLivingEntity(serverLevel, blockPos, item, bukkitBlock, craftItem)); // CraftBukkit
|
|
if (this.isSuccess()) {
|
|
item.hurtAndBreak(1, serverLevel, null, item1 -> {});
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return item;
|
|
}
|
|
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
|
index 97a70f372756e283810921ad39f4d0a7ba840afc..eb2316e5915e973675c75b4358d20f5ef4124503 100644
|
|
--- a/net/minecraft/server/Main.java
|
|
+++ b/net/minecraft/server/Main.java
|
|
@@ -41,7 +41,7 @@ import net.minecraft.server.packs.repository.PackRepository;
|
|
import net.minecraft.server.packs.repository.ServerPacksSource;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.datafix.DataFixers;
|
|
-import net.minecraft.util.profiling.jfr.Environment;
|
|
+//import net.minecraft.util.profiling.jfr.Environment; // Plazma - Remove isClientSide on DedicatedServer
|
|
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
|
import net.minecraft.util.worldupdate.WorldUpgrader;
|
|
import net.minecraft.world.flag.FeatureFlags;
|
|
@@ -102,7 +102,7 @@ public class Main {
|
|
|
|
CrashReport.preload();
|
|
if (optionSet.has("jfrProfile")) { // CraftBukkit
|
|
- JvmProfiler.INSTANCE.start(Environment.SERVER);
|
|
+ JvmProfiler.INSTANCE.start(/*Environment.SERVER*/); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
// Purpur start - Add toggle for enchant level clamping - load config files early
|
|
diff --git a/net/minecraft/server/commands/JfrCommand.java b/net/minecraft/server/commands/JfrCommand.java
|
|
index 5b32584379d946dc424c9d716fd0d9be5ddfdd64..cda646e0487087bd78a9bae64a2baa297e8f6094 100644
|
|
--- a/net/minecraft/server/commands/JfrCommand.java
|
|
+++ b/net/minecraft/server/commands/JfrCommand.java
|
|
@@ -13,7 +13,7 @@ import net.minecraft.commands.Commands;
|
|
import net.minecraft.network.chat.ClickEvent;
|
|
import net.minecraft.network.chat.Component;
|
|
import net.minecraft.network.chat.HoverEvent;
|
|
-import net.minecraft.util.profiling.jfr.Environment;
|
|
+//import net.minecraft.util.profiling.jfr.Environment; // Plazma - Remove isClientSide on DedicatedServer
|
|
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
|
|
|
public class JfrCommand {
|
|
@@ -35,8 +35,7 @@ public class JfrCommand {
|
|
}
|
|
|
|
private static int startJfr(CommandSourceStack source) throws CommandSyntaxException {
|
|
- Environment environment = Environment.from(source.getServer());
|
|
- if (!JvmProfiler.INSTANCE.start(environment)) {
|
|
+ if (!JvmProfiler.INSTANCE.start()) { // Plazma - Remove isClientSide on DedicatedServer
|
|
throw START_FAILED.create();
|
|
} else {
|
|
source.sendSuccess(() -> Component.translatable("commands.jfr.started"), false);
|
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
|
index 1b983393fcb170829f981cf0ab1620d92c80ab1d..be4e3533590cd36bbed6f17f3be5941e70f40b8a 100644
|
|
--- a/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
|
@@ -597,7 +597,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
dimension,
|
|
server.registryAccess(),
|
|
levelStem.type(),
|
|
- false,
|
|
+ //false, // Plazma - Remove isClientSide on DedicatedServer
|
|
isDebug,
|
|
biomeZoomSeed,
|
|
server.getMaxChainedNeighborUpdates(),
|
|
diff --git a/net/minecraft/server/level/WorldGenRegion.java b/net/minecraft/server/level/WorldGenRegion.java
|
|
index 3ba4b970c3781ab89a60687ec41ffb1e6297c9f9..c3f9c65052713c177169a6367d2b5e306af2209c 100644
|
|
--- a/net/minecraft/server/level/WorldGenRegion.java
|
|
+++ b/net/minecraft/server/level/WorldGenRegion.java
|
|
@@ -414,10 +414,12 @@ public class WorldGenRegion implements WorldGenLevel {
|
|
return this.level.getWorldBorder();
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public boolean isClientSide() {
|
|
return false;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Deprecated
|
|
@Override
|
|
diff --git a/net/minecraft/util/profiling/jfr/Environment.java b/net/minecraft/util/profiling/jfr/Environment.java
|
|
deleted file mode 100644
|
|
index 2b27173c700dbd9f418d470ca5ce81eadf0bb8ce..0000000000000000000000000000000000000000
|
|
--- a/net/minecraft/util/profiling/jfr/Environment.java
|
|
+++ /dev/null
|
|
@@ -1,22 +0,0 @@
|
|
-package net.minecraft.util.profiling.jfr;
|
|
-
|
|
-import net.minecraft.server.MinecraftServer;
|
|
-
|
|
-public enum Environment {
|
|
- CLIENT("client"),
|
|
- SERVER("server");
|
|
-
|
|
- private final String description;
|
|
-
|
|
- private Environment(final String description) {
|
|
- this.description = description;
|
|
- }
|
|
-
|
|
- public static Environment from(MinecraftServer server) {
|
|
- return server.isDedicatedServer() ? SERVER : CLIENT;
|
|
- }
|
|
-
|
|
- public String getDescription() {
|
|
- return this.description;
|
|
- }
|
|
-}
|
|
diff --git a/net/minecraft/util/profiling/jfr/JfrProfiler.java b/net/minecraft/util/profiling/jfr/JfrProfiler.java
|
|
index 5dfddd59f8f9ce4c5991e8e3ff14d6fdbdbbf6cb..29468480d9a0edf661bbfecfea7b8c3265b3f5ab 100644
|
|
--- a/net/minecraft/util/profiling/jfr/JfrProfiler.java
|
|
+++ b/net/minecraft/util/profiling/jfr/JfrProfiler.java
|
|
@@ -97,7 +97,7 @@ public class JfrProfiler implements JvmProfiler {
|
|
}
|
|
|
|
@Override
|
|
- public boolean start(Environment environment) {
|
|
+ public boolean start(/*Environment environment*/) { // Plazma - Remove isClientSide on DedicatedServer
|
|
URL resource = JfrProfiler.class.getResource("/flightrecorder-config.jfc");
|
|
if (resource == null) {
|
|
LOGGER.warn("Could not find default flight recorder config at {}", "/flightrecorder-config.jfc");
|
|
@@ -106,7 +106,7 @@ public class JfrProfiler implements JvmProfiler {
|
|
try {
|
|
boolean var4;
|
|
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(resource.openStream()))) {
|
|
- var4 = this.start(bufferedReader, environment);
|
|
+ var4 = this.start(bufferedReader/*, environment*/); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
return var4;
|
|
@@ -139,7 +139,7 @@ public class JfrProfiler implements JvmProfiler {
|
|
return FlightRecorder.isAvailable();
|
|
}
|
|
|
|
- private boolean start(Reader reader, Environment environment) {
|
|
+ private boolean start(final Reader reader/*, Environment environment*/) { // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.isRunning()) {
|
|
LOGGER.warn("Profiling already in progress");
|
|
return false;
|
|
@@ -154,11 +154,11 @@ public class JfrProfiler implements JvmProfiler {
|
|
recording.setDumpOnExit(true);
|
|
recording.setToDisk(true);
|
|
recording.setName(
|
|
- String.format(Locale.ROOT, "%s-%s-%s", environment.getDescription(), SharedConstants.getCurrentVersion().getName(), string)
|
|
+ String.format(Locale.ROOT, "server-%s-%s", SharedConstants.getCurrentVersion().getName(), string) // Plazma - Remove isClientSide on DedicatedServer
|
|
);
|
|
}
|
|
);
|
|
- Path path = Paths.get(String.format(Locale.ROOT, "debug/%s-%s.jfr", environment.getDescription(), string));
|
|
+ Path path = Paths.get(String.format(Locale.ROOT, "debug/server-%s.jfr", string)); // Plazma - Remove isClientSide on DedicatedServer
|
|
FileUtil.createDirectoriesSafe(path.getParent());
|
|
this.recording.setDestination(path);
|
|
this.recording.start();
|
|
diff --git a/net/minecraft/util/profiling/jfr/JvmProfiler.java b/net/minecraft/util/profiling/jfr/JvmProfiler.java
|
|
index 607e176893bbbf2d98f35c413d5d2de82fbe529d..85ca32441df08ac6f404cce6e549e4e1c46b065a 100644
|
|
--- a/net/minecraft/util/profiling/jfr/JvmProfiler.java
|
|
+++ b/net/minecraft/util/profiling/jfr/JvmProfiler.java
|
|
@@ -21,7 +21,7 @@ public interface JvmProfiler {
|
|
? JfrProfiler.getInstance()
|
|
: new JvmProfiler.NoOpProfiler());
|
|
|
|
- boolean start(Environment environment);
|
|
+ boolean start(/*Environment environment*/); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
Path stop();
|
|
|
|
@@ -53,7 +53,7 @@ public interface JvmProfiler {
|
|
static final ProfiledDuration noOpCommit = success -> {};
|
|
|
|
@Override
|
|
- public boolean start(Environment environment) {
|
|
+ public boolean start(/*Environment environment*/) { // Plazma - Remove isClientSide on DedicatedServer
|
|
LOGGER.warn("Attempted to start Flight Recorder, but it's not supported on this JVM");
|
|
return false;
|
|
}
|
|
diff --git a/net/minecraft/world/entity/AgeableMob.java b/net/minecraft/world/entity/AgeableMob.java
|
|
index 179f4e4b9b1eb57f78bbb2f9fa34b11ea79b7a88..1c8c2e246b48c2e76e5805eb7ba4132e8699191c 100644
|
|
--- a/net/minecraft/world/entity/AgeableMob.java
|
|
+++ b/net/minecraft/world/entity/AgeableMob.java
|
|
@@ -59,11 +59,7 @@ public abstract class AgeableMob extends PathfinderMob {
|
|
}
|
|
|
|
public int getAge() {
|
|
- if (this.level().isClientSide) {
|
|
- return this.entityData.get(DATA_BABY_ID) ? -1 : 1;
|
|
- } else {
|
|
- return this.age;
|
|
- }
|
|
+ return this.age; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public void ageUp(int amount, boolean forced) {
|
|
@@ -130,7 +126,7 @@ public abstract class AgeableMob extends PathfinderMob {
|
|
@Override
|
|
public void inactiveTick() {
|
|
super.inactiveTick();
|
|
- if (this.level().isClientSide || this.ageLocked) { // CraftBukkit
|
|
+ if (/*this.level().isClientSide == false ||*/ this.ageLocked) { // CraftBukkit // Plazma - Remove isClientSide on DedicatedServer
|
|
this.refreshDimensions();
|
|
} else {
|
|
int age = this.getAge();
|
|
@@ -146,7 +142,7 @@ public abstract class AgeableMob extends PathfinderMob {
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- if (this.level().isClientSide || this.ageLocked) { // CraftBukkit
|
|
+ if (/*this.level().isClientSide == false ||*/ this.ageLocked) { // CraftBukkit // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.forcedAgeTimer > 0) {
|
|
if (this.forcedAgeTimer % 4 == 0) {
|
|
this.level().addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0), this.getRandomY() + 0.5, this.getRandomZ(1.0), 0.0, 0.0, 0.0);
|
|
diff --git a/net/minecraft/world/entity/AreaEffectCloud.java b/net/minecraft/world/entity/AreaEffectCloud.java
|
|
index 23b342cc31c7e72ade0e1ccad86a9ccf34380f13..d42967b93a0c9a76db4a585348e481d23859e3e2 100644
|
|
--- a/net/minecraft/world/entity/AreaEffectCloud.java
|
|
+++ b/net/minecraft/world/entity/AreaEffectCloud.java
|
|
@@ -69,9 +69,9 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
|
}
|
|
|
|
public void setRadius(float radius) {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.getEntityData().set(DATA_RADIUS, Mth.clamp(radius, 0.0F, 32.0F));
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/Display.java b/net/minecraft/world/entity/Display.java
|
|
index ff49fdcddb43ee479a377aa219eb18fcaefeffca..b62f4bd8d2cd61a3bad7169cc7ed476de581b962 100644
|
|
--- a/net/minecraft/world/entity/Display.java
|
|
+++ b/net/minecraft/world/entity/Display.java
|
|
@@ -147,6 +147,7 @@ public abstract class Display extends Entity {
|
|
this.stopRiding();
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.level().isClientSide) {
|
|
if (this.updateStartTick) {
|
|
this.updateStartTick = false;
|
|
@@ -185,9 +186,10 @@ public abstract class Display extends Entity {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
- protected abstract void updateRenderSubState(boolean interpolate, float partialTick);
|
|
+ //protected abstract void updateRenderSubState(boolean interpolate, float partialTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
|
@@ -550,8 +552,8 @@ public abstract class Display extends Entity {
|
|
private static final EntityDataAccessor<BlockState> DATA_BLOCK_STATE_ID = SynchedEntityData.defineId(
|
|
Display.BlockDisplay.class, EntityDataSerializers.BLOCK_STATE
|
|
);
|
|
- @Nullable
|
|
- private Display.BlockDisplay.BlockRenderState blockRenderState;
|
|
+ //@Nullable // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private Display.BlockDisplay.BlockRenderState blockRenderState; // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public BlockDisplay(EntityType<?> entityType, Level level) {
|
|
super(entityType, level);
|
|
@@ -591,6 +593,7 @@ public abstract class Display extends Entity {
|
|
tag.put("block_state", NbtUtils.writeBlockState(this.getBlockState()));
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Nullable
|
|
public Display.BlockDisplay.BlockRenderState blockRenderState() {
|
|
return this.blockRenderState;
|
|
@@ -603,6 +606,7 @@ public abstract class Display extends Entity {
|
|
|
|
public record BlockRenderState(BlockState blockState) {
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
record ColorInterpolator(int previous, int current) implements Display.IntInterpolator {
|
|
@@ -647,8 +651,8 @@ public abstract class Display extends Entity {
|
|
);
|
|
private static final EntityDataAccessor<Byte> DATA_ITEM_DISPLAY_ID = SynchedEntityData.defineId(Display.ItemDisplay.class, EntityDataSerializers.BYTE);
|
|
private final SlotAccess slot = SlotAccess.of(this::getItemStack, this::setItemStack);
|
|
- @Nullable
|
|
- private Display.ItemDisplay.ItemRenderState itemRenderState;
|
|
+ //@Nullable // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private Display.ItemDisplay.ItemRenderState itemRenderState; // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public ItemDisplay(EntityType<?> entityType, Level level) {
|
|
super(entityType, level);
|
|
@@ -717,6 +721,7 @@ public abstract class Display extends Entity {
|
|
return slot == 0 ? this.slot : SlotAccess.NULL;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Nullable
|
|
public Display.ItemDisplay.ItemRenderState itemRenderState() {
|
|
return this.itemRenderState;
|
|
@@ -731,6 +736,7 @@ public abstract class Display extends Entity {
|
|
|
|
public record ItemRenderState(ItemStack itemStack, ItemDisplayContext itemTransform) {
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
record LinearFloatInterpolator(float previous, float current) implements Display.FloatInterpolator {
|
|
@@ -810,10 +816,10 @@ public abstract class Display extends Entity {
|
|
private static final IntSet TEXT_RENDER_STATE_IDS = IntSet.of(
|
|
DATA_TEXT_ID.id(), DATA_LINE_WIDTH_ID.id(), DATA_BACKGROUND_COLOR_ID.id(), DATA_TEXT_OPACITY_ID.id(), DATA_STYLE_FLAGS_ID.id()
|
|
);
|
|
- @Nullable
|
|
- private Display.TextDisplay.CachedInfo clientDisplayCache;
|
|
- @Nullable
|
|
- private Display.TextDisplay.TextRenderState textRenderState;
|
|
+ //@Nullable // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private Display.TextDisplay.CachedInfo clientDisplayCache; // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //@Nullable // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private Display.TextDisplay.TextRenderState textRenderState; // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public TextDisplay(EntityType<?> entityType, Level level) {
|
|
super(entityType, level);
|
|
@@ -948,6 +954,7 @@ public abstract class Display extends Entity {
|
|
Display.TextDisplay.Align.CODEC.encodeStart(NbtOps.INSTANCE, getAlign(flags)).ifSuccess(tag1 -> tag.put("alignment", tag1));
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
protected void updateRenderSubState(boolean interpolate, float partialTick) {
|
|
if (interpolate && this.textRenderState != null) {
|
|
@@ -997,6 +1004,7 @@ public abstract class Display extends Entity {
|
|
|
|
return this.clientDisplayCache;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static Display.TextDisplay.Align getAlign(byte flags) {
|
|
if ((flags & 8) != 0) {
|
|
@@ -1024,6 +1032,7 @@ public abstract class Display extends Entity {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public record CachedInfo(List<Display.TextDisplay.CachedLine> lines, int width) {
|
|
}
|
|
|
|
@@ -1037,6 +1046,7 @@ public abstract class Display extends Entity {
|
|
|
|
public record TextRenderState(Component text, int lineWidth, Display.IntInterpolator textOpacity, Display.IntInterpolator backgroundColor, byte flags) {
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
record TransformationInterpolator(Transformation previous, Transformation current) implements Display.GenericInterpolator<Transformation> {
|
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
|
index ef32cca12f11c4a25bdf852f756e2e5a92e532a1..bd24ef83f9366806961b185ceb15703734a8b2ff 100644
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
|
@@ -533,7 +533,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
|
|
// Purpur start - copied from Mob - API for any mob to burn daylight
|
|
public boolean isSunBurnTick() {
|
|
- if (this.level().isDay() && !this.level().isClientSide) {
|
|
+ if (this.level().isDay() /*&& !this.level().isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue();
|
|
BlockPos blockPos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
|
boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
|
|
@@ -913,9 +913,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
this.checkBelowWorld();
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setSharedFlagOnFire(this.remainingFireTicks > 0);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.firstTick = false;
|
|
if (this.level() instanceof ServerLevel serverLevelx && this instanceof Leashable) {
|
|
@@ -1192,7 +1192,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
|
|
BlockPos onPosLegacy = this.getOnPosLegacy();
|
|
BlockState blockState = this.level().getBlockState(onPosLegacy);
|
|
- if ((!this.level().isClientSide() || this.isControlledByLocalInstance()) && !this.isControlledByClient()) {
|
|
+ if (/*(!this.level().isClientSide() || this.isControlledByLocalInstance()) &&*/ !this.isControlledByClient()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.checkFallDamage(vec3.y, this.onGround(), blockState, onPosLegacy);
|
|
}
|
|
|
|
@@ -1233,12 +1233,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
// CraftBukkit end
|
|
|
|
- if (!this.level().isClientSide() || this.isControlledByLocalInstance()) {
|
|
+ //if (!this.level().isClientSide() || this.isControlledByLocalInstance()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Entity.MovementEmission movementEmission = this.getMovementEmission();
|
|
if (movementEmission.emitsAnything() && !this.isPassenger()) {
|
|
this.applyMovementEmissionAndPlaySound(movementEmission, vec3, onPosLegacy, blockState);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
float blockSpeedFactor = this.getBlockSpeedFactor();
|
|
this.setDeltaMovement(this.getDeltaMovement().multiply(blockSpeedFactor, 1.0, blockSpeedFactor));
|
|
@@ -1359,7 +1359,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
public void extinguishFire() {
|
|
- if (!this.level().isClientSide && this.wasOnFire) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.wasOnFire) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.playEntityOnFireExtinguishedSound();
|
|
}
|
|
|
|
@@ -2962,7 +2962,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
public InteractionResult interact(Player player, InteractionHand hand) {
|
|
if (this.isAlive() && this instanceof Leashable leashable) {
|
|
if (leashable.getLeashHolder() == player) {
|
|
- if (!this.level().isClientSide()) {
|
|
+ //if (!this.level().isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (hand == InteractionHand.OFF_HAND && (level().purpurConfig.villagerCanBeLeashed || level().purpurConfig.wanderingTraderCanBeLeashed) && this instanceof net.minecraft.world.entity.npc.AbstractVillager) return InteractionResult.CONSUME; // Purpur - Allow leashing villagers
|
|
// CraftBukkit start - fire PlayerUnleashEntityEvent
|
|
// Paper start - Expand EntityUnleashEvent
|
|
@@ -2980,14 +2980,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
this.gameEvent(GameEvent.ENTITY_INTERACT, player);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS.withoutItem();
|
|
}
|
|
|
|
ItemStack itemInHand = player.getItemInHand(hand);
|
|
if (itemInHand.is(Items.LEAD) && leashable.canHaveALeashAttachedToIt()) {
|
|
- if (!this.level().isClientSide()) {
|
|
+ //if (!this.level().isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start - fire PlayerLeashEntityEvent
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerLeashEntityEvent(this, player, player, hand).isCancelled()) {
|
|
((ServerPlayer) player).connection.send(new net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket(this, leashable.getLeashHolder()));
|
|
@@ -2996,7 +2996,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
// CraftBukkit end
|
|
leashable.setLeashedTo(player, true);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
itemInHand.shrink(1);
|
|
return InteractionResult.SUCCESS;
|
|
@@ -3072,7 +3072,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
return false;
|
|
} else if (!vehicle.couldAcceptPassenger()) {
|
|
return false;
|
|
- } else if (!force && !this.level().isClientSide() && !vehicle.type.canSerialize()) { // SPIGOT-7947: Allow force riding all entities
|
|
+ } else if (!force /*&& !this.level().isClientSide()*/ && !vehicle.type.canSerialize()) { // SPIGOT-7947: Allow force riding all entities // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
return false;
|
|
} else {
|
|
for (Entity entity = vehicle; entity.vehicle != null; entity = entity.vehicle) {
|
|
@@ -3161,7 +3161,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
this.passengers = ImmutableList.of(passenger);
|
|
} else {
|
|
List<Entity> list = Lists.newArrayList(this.passengers);
|
|
- if (!this.level().isClientSide && passenger instanceof Player && !(this.getFirstPassenger() instanceof Player)) {
|
|
+ if (/*!this.level().isClientSide &&*/ passenger instanceof Player && !(this.getFirstPassenger() instanceof Player)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
list.add(0, passenger);
|
|
} else {
|
|
list.add(passenger);
|
|
@@ -3358,18 +3358,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
public void handleEntityEvent(byte id) {
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
switch (id) {
|
|
case 53:
|
|
HoneyBlock.showSlideParticles(this);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public void animateHurt(float yaw) {
|
|
}
|
|
|
|
public boolean isOnFire() {
|
|
- boolean flag = this.level() != null && this.level().isClientSide;
|
|
- return !this.fireImmune() && (this.remainingFireTicks > 0 || flag && this.getSharedFlag(0));
|
|
+ return !this.fireImmune() && (this.remainingFireTicks > 0 || this.level() != null && this.getSharedFlag(0)); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public boolean isPassenger() {
|
|
@@ -3457,7 +3458,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
public boolean isCurrentlyGlowing() {
|
|
- return this.level().isClientSide() ? this.getSharedFlag(6) : this.hasGlowingTag;
|
|
+ return this.hasGlowingTag; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public boolean isInvisible() {
|
|
@@ -4192,8 +4193,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
this.eyeHeight = dimensions.eyeHeight();
|
|
this.reapplyPosition();
|
|
boolean flag = dimensions.width() <= 4.0F && dimensions.height() <= 4.0F;
|
|
- if (!this.level.isClientSide
|
|
- && !this.firstTick
|
|
+ if (!this.firstTick // Plazma - Remove isClientSide on DedicatedServer
|
|
&& !this.noPhysics
|
|
&& flag
|
|
&& (dimensions.width() > entityDimensions.width() || dimensions.height() > entityDimensions.height())
|
|
@@ -4458,7 +4458,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
public boolean isEffectiveAi() {
|
|
- return !this.level().isClientSide;
|
|
+ return true; //!this.level().isClientSide; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
protected static Vec3 getCollisionHorizontalEscapeVector(double vehicleWidth, double passengerWidth, float yRot) {
|
|
diff --git a/net/minecraft/world/entity/EntitySelector.java b/net/minecraft/world/entity/EntitySelector.java
|
|
index d23aad063990fff5e7b1442ac38f4355b541a13e..410311e4e8b21cd9a6646718e674f35690963029 100644
|
|
--- a/net/minecraft/world/entity/EntitySelector.java
|
|
+++ b/net/minecraft/world/entity/EntitySelector.java
|
|
@@ -56,7 +56,7 @@ public final class EntitySelector {
|
|
return collisionRule == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : NO_SPECTATORS.and(pushedEntity -> {
|
|
if (!pushedEntity.isCollidable(ignoreClimbing) || !pushedEntity.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(pushedEntity)) { // CraftBukkit - collidable API // Paper - Climbing should not bypass cramming gamerule
|
|
return false;
|
|
- } else if (!entity.level().isClientSide || pushedEntity instanceof Player && ((Player)pushedEntity).isLocalPlayer()) {
|
|
+ } else /*if (!entity.level().isClientSide || pushedEntity instanceof Player && ((Player)pushedEntity).isLocalPlayer())*/ { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Team team1 = pushedEntity.getTeam();
|
|
Team.CollisionRule collisionRule1 = team1 == null ? Team.CollisionRule.ALWAYS : team1.getCollisionRule();
|
|
if (collisionRule1 == Team.CollisionRule.NEVER || (pushedEntity instanceof Player && !io.papermc.paper.configuration.GlobalConfiguration.get().collisions.enablePlayerCollisions)) { // Paper - Configurable player collision
|
|
@@ -66,10 +66,10 @@ public final class EntitySelector {
|
|
return (collisionRule != Team.CollisionRule.PUSH_OWN_TEAM && collisionRule1 != Team.CollisionRule.PUSH_OWN_TEAM || !flag)
|
|
&& (collisionRule != Team.CollisionRule.PUSH_OTHER_TEAMS && collisionRule1 != Team.CollisionRule.PUSH_OTHER_TEAMS || flag);
|
|
}
|
|
- } else {
|
|
+ } /*else { // Plazma - Remove isClientSide on DedicatedServer
|
|
return false;
|
|
}
|
|
-
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
});
|
|
// Plazma end
|
|
}
|
|
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
|
|
index 4186db5cb8d2cd29ebc230d704dd125ae0dfa358..333ab1cf3f32386a8912463d8dffd14ecbeae536 100644
|
|
--- a/net/minecraft/world/entity/EntityType.java
|
|
+++ b/net/minecraft/world/entity/EntityType.java
|
|
@@ -1286,7 +1286,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
|
if (server != null && entity != null) {
|
|
EntityType<?> entityType = customData.parseEntityType(server.registryAccess(), Registries.ENTITY_TYPE);
|
|
if (entity.getType() == entityType) {
|
|
- if (level.isClientSide || !entity.getType().onlyOpCanSetNbt() || player != null && server.getPlayerList().isOp(player.getGameProfile())) {
|
|
+ if (/*level.isClientSide ||*/ !entity.getType().onlyOpCanSetNbt() || player != null && server.getPlayerList().isOp(player.getGameProfile())) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
// Paper start - filter out protected tags
|
|
if (player == null || !player.getBukkitEntity().hasPermission("minecraft.nbt.place")) {
|
|
customData = customData.update((compound) -> {
|
|
diff --git a/net/minecraft/world/entity/Interaction.java b/net/minecraft/world/entity/Interaction.java
|
|
index 17949459c71aa5409570a62f290dcf8ae6ee3f94..1fcc2dcb6140bafd0a6ab5b876cd029301bd99bf 100644
|
|
--- a/net/minecraft/world/entity/Interaction.java
|
|
+++ b/net/minecraft/world/entity/Interaction.java
|
|
@@ -155,12 +155,10 @@ public class Interaction extends Entity implements Attackable, Targeting {
|
|
|
|
@Override
|
|
public InteractionResult interact(Player player, InteractionHand hand) {
|
|
- if (this.level().isClientSide) {
|
|
- return this.getResponse() ? InteractionResult.SUCCESS : InteractionResult.CONSUME;
|
|
- } else {
|
|
- this.interaction = new Interaction.PlayerAction(player.getUUID(), this.level().getGameTime());
|
|
- return InteractionResult.CONSUME;
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ this.interaction = new Interaction.PlayerAction(player.getUUID(), this.level().getGameTime());
|
|
+ return InteractionResult.CONSUME;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/Leashable.java b/net/minecraft/world/entity/Leashable.java
|
|
index 8e115fa3039be5ce6917728cda2a7e756af88a13..a3c98d9acdab97754b11c4e636f97e64dbe1021f 100644
|
|
--- a/net/minecraft/world/entity/Leashable.java
|
|
+++ b/net/minecraft/world/entity/Leashable.java
|
|
@@ -266,12 +266,13 @@ public interface Leashable {
|
|
if (leashData == null) {
|
|
return null;
|
|
} else {
|
|
- if (leashData.delayedLeashHolderId != 0 && entity.level().isClientSide) {
|
|
+ /*if (leashData.delayedLeashHolderId != 0 && entity.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
Entity var3 = entity.level().getEntity(leashData.delayedLeashHolderId);
|
|
if (var3 instanceof Entity) {
|
|
leashData.setLeashHolder(var3);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return leashData.leashHolder;
|
|
}
|
|
diff --git a/net/minecraft/world/entity/LightningBolt.java b/net/minecraft/world/entity/LightningBolt.java
|
|
index f003a65b34027dff14455860815c7d719c5289fa..89a360c1121418d650b2749621f945958f9df152 100644
|
|
--- a/net/minecraft/world/entity/LightningBolt.java
|
|
+++ b/net/minecraft/world/entity/LightningBolt.java
|
|
@@ -78,39 +78,16 @@ public class LightningBolt extends Entity {
|
|
public void tick() {
|
|
super.tick();
|
|
if (!this.isEffect && this.life == 2) { // Paper - Properly handle lightning effects api
|
|
- if (this.level().isClientSide()) {
|
|
- this.level()
|
|
- .playLocalSound(
|
|
- this.getX(),
|
|
- this.getY(),
|
|
- this.getZ(),
|
|
- SoundEvents.LIGHTNING_BOLT_THUNDER,
|
|
- SoundSource.WEATHER,
|
|
- 10000.0F,
|
|
- 0.8F + this.random.nextFloat() * 0.2F,
|
|
- false
|
|
- );
|
|
- this.level()
|
|
- .playLocalSound(
|
|
- this.getX(),
|
|
- this.getY(),
|
|
- this.getZ(),
|
|
- SoundEvents.LIGHTNING_BOLT_IMPACT,
|
|
- SoundSource.WEATHER,
|
|
- 2.0F,
|
|
- 0.5F + this.random.nextFloat() * 0.2F,
|
|
- false
|
|
- );
|
|
- } else {
|
|
- Difficulty difficulty = this.level().getDifficulty();
|
|
- if (difficulty == Difficulty.NORMAL || difficulty == Difficulty.HARD) {
|
|
- this.spawnFire(4);
|
|
- }
|
|
-
|
|
- this.powerLightningRod();
|
|
- clearCopperOnLightningStrike(this.level(), this.getStrikePosition(), this); // Paper - Call EntityChangeBlockEvent
|
|
- this.gameEvent(GameEvent.LIGHTNING_STRIKE);
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ Difficulty difficulty = this.level().getDifficulty();
|
|
+ if (difficulty == Difficulty.NORMAL || difficulty == Difficulty.HARD) {
|
|
+ this.spawnFire(4);
|
|
}
|
|
+
|
|
+ this.powerLightningRod();
|
|
+ clearCopperOnLightningStrike(this.level(), this.getStrikePosition(), this); // Paper - Call EntityChangeBlockEvent
|
|
+ this.gameEvent(GameEvent.LIGHTNING_STRIKE);
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
this.life--;
|
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
|
index f37d77c98f6bc0a6113ff5896c7ee6e401df6e30..70f848346a13b3aedb4c0787b7bdc62b8733f885 100644
|
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -450,7 +450,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
super.baseTick();
|
|
ProfilerFiller profilerFiller = Profiler.get();
|
|
profilerFiller.push("livingEntityBaseTick");
|
|
- if (this.fireImmune() || this.level().isClientSide) {
|
|
+ if (this.fireImmune() /*|| this.level().isClientSide*/) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.clearFire();
|
|
}
|
|
|
|
@@ -509,7 +509,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
|
|
}
|
|
|
|
- if (!this.level().isClientSide && this.isPassenger() && this.getVehicle() != null && this.getVehicle().dismountsUnderwater()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isPassenger() && this.getVehicle() != null && this.getVehicle().dismountsUnderwater()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.stopRiding();
|
|
}
|
|
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
|
|
@@ -624,7 +624,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
protected void tickDeath() {
|
|
this.deathTime++;
|
|
- if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved()) {
|
|
+ if (this.deathTime >= 20 /*&& !this.level().isClientSide()*/ && !this.isRemoved()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level().broadcastEntityEvent(this, (byte)60);
|
|
this.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause
|
|
}
|
|
@@ -735,7 +735,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
public void onEquipItem(EquipmentSlot slot, ItemStack oldItem, ItemStack newItem, boolean silent) {
|
|
// CraftBukkit end
|
|
- if (!this.level().isClientSide() && !this.isSpectator()) {
|
|
+ if (/*!this.level().isClientSide() &&*/ !this.isSpectator()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean flag = newItem.isEmpty() && oldItem.isEmpty();
|
|
if (!flag && !ItemStack.isSameItemSameComponents(oldItem, newItem) && !this.firstTick) {
|
|
Equippable equippable = newItem.get(DataComponents.EQUIPPABLE);
|
|
@@ -832,7 +832,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
}
|
|
// Paper end - Friction API
|
|
- if (compound.contains("attributes", 9) && this.level() != null && !this.level().isClientSide) {
|
|
+ if (compound.contains("attributes", 9) && this.level() != null /*&& !this.level().isClientSide*/) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.getAttributes().load(compound.getList("attributes", 10));
|
|
}
|
|
|
|
@@ -933,7 +933,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
Holder<MobEffect> holder = iterator.next();
|
|
MobEffectInstance mobEffectInstance = this.activeEffects.get(holder);
|
|
if (!mobEffectInstance.tick(this, () -> this.onEffectUpdated(mobEffectInstance, true, null))) {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, mobEffectInstance, null, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.EXPIRATION);
|
|
if (event.isCancelled()) {
|
|
@@ -942,7 +942,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
// CraftBukkit end
|
|
iterator.remove();
|
|
this.onEffectsRemoved(List.of(mobEffectInstance));
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
} else if (mobEffectInstance.getDuration() % 600 == 0) {
|
|
this.onEffectUpdated(mobEffectInstance, false, null);
|
|
}
|
|
@@ -962,10 +962,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.effectsToProcess.clear();
|
|
// CraftBukkit end
|
|
if (this.effectsDirty) {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.updateInvisibilityStatus();
|
|
this.updateGlowingStatus();
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.effectsDirty = false;
|
|
}
|
|
@@ -1089,9 +1089,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
public boolean removeAllEffects(EntityPotionEffectEvent.Cause cause) {
|
|
// CraftBukkit end
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
return false;
|
|
- } else if (this.activeEffects.isEmpty()) {
|
|
+ } else*/ if (this.activeEffects.isEmpty()) { // Plazma - Remove isClientSide on DedicatedServer
|
|
return false;
|
|
} else {
|
|
// CraftBukkit start
|
|
@@ -1263,10 +1263,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
protected void onEffectAdded(MobEffectInstance effectInstance, @Nullable Entity entity) {
|
|
this.effectsDirty = true;
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
effectInstance.getEffect().value().addAttributeModifiers(this.getAttributes(), effectInstance.getAmplifier());
|
|
this.sendEffectToPassengers(effectInstance);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public void sendEffectToPassengers(MobEffectInstance effectInstance) {
|
|
@@ -1279,21 +1279,21 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
protected void onEffectUpdated(MobEffectInstance effectInstance, boolean forced, @Nullable Entity entity) {
|
|
this.effectsDirty = true;
|
|
- if (forced && !this.level().isClientSide) {
|
|
+ if (forced /*&& !this.level().isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
MobEffect mobEffect = effectInstance.getEffect().value();
|
|
mobEffect.removeAttributeModifiers(this.getAttributes());
|
|
mobEffect.addAttributeModifiers(this.getAttributes(), effectInstance.getAmplifier());
|
|
this.refreshDirtyAttributes();
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.sendEffectToPassengers(effectInstance);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
protected void onEffectsRemoved(Collection<MobEffectInstance> effects) {
|
|
this.effectsDirty = true;
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
for (MobEffectInstance mobEffectInstance : effects) {
|
|
mobEffectInstance.getEffect().value().removeAttributeModifiers(this.getAttributes());
|
|
|
|
@@ -1305,7 +1305,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
|
|
this.refreshDirtyAttributes();
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private void refreshDirtyAttributes() {
|
|
@@ -1736,6 +1736,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
private void breakItem(ItemStack stack) {
|
|
if (!stack.isEmpty()) {
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
if (!this.isSilent()) {
|
|
this.level()
|
|
.playLocalSound(
|
|
@@ -1749,6 +1750,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
false
|
|
);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.spawnItemParticles(stack, 5);
|
|
}
|
|
@@ -1795,7 +1797,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.stopSleeping();
|
|
}
|
|
|
|
- if (!this.level().isClientSide && this.hasCustomName()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.hasCustomName()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
|
|
}
|
|
|
|
@@ -2626,9 +2628,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
case 52:
|
|
this.breakItem(this.getItemBySlot(EquipmentSlot.FEET));
|
|
break;
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
case 54:
|
|
HoneyBlock.showJumpParticles(this);
|
|
break;
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
case 55:
|
|
this.swapHandItems();
|
|
break;
|
|
@@ -2945,13 +2949,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
MobEffectInstance effect = this.getEffect(MobEffects.LEVITATION);
|
|
if (effect != null) {
|
|
d += (0.05 * (effect.getAmplifier() + 1) - vec3.y) * 0.2;
|
|
- } else if (!this.level().isClientSide || this.level().hasChunkAt(blockPosBelowThatAffectsMyMovement)) {
|
|
+ } else //if (!this.level().isClientSide || this.level().hasChunkAt(blockPosBelowThatAffectsMyMovement)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
d -= this.getEffectiveGravity();
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
} else if (this.getY() > this.level().getMinY()) {
|
|
d = -0.1;
|
|
} else {
|
|
d = 0.0;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.shouldDiscardFriction()) {
|
|
this.setDeltaMovement(vec3.x, d, vec3.z);
|
|
@@ -3019,10 +3025,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
double d = deltaMovement.horizontalDistance();
|
|
this.setDeltaMovement(this.updateFallFlyingMovement(deltaMovement));
|
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
double d1 = this.getDeltaMovement().horizontalDistance();
|
|
this.handleFallFlyingCollisions(d, d1);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private Vec3 updateFallFlyingMovement(Vec3 deltaMovement) {
|
|
@@ -3179,41 +3185,41 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
super.tick();
|
|
this.updatingUsingItem();
|
|
this.updateSwimAmount();
|
|
- if (!this.level().isClientSide) {
|
|
- int arrowCount = this.getArrowCount();
|
|
- if (arrowCount > 0) {
|
|
- if (this.removeArrowTime <= 0) {
|
|
- this.removeArrowTime = 20 * (30 - arrowCount);
|
|
- }
|
|
-
|
|
- this.removeArrowTime--;
|
|
- if (this.removeArrowTime <= 0) {
|
|
- this.setArrowCount(arrowCount - 1);
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ int arrowCount = this.getArrowCount();
|
|
+ if (arrowCount > 0) {
|
|
+ if (this.removeArrowTime <= 0) {
|
|
+ this.removeArrowTime = 20 * (30 - arrowCount);
|
|
}
|
|
|
|
- int stingerCount = this.getStingerCount();
|
|
- if (stingerCount > 0) {
|
|
- if (this.removeStingerTime <= 0) {
|
|
- this.removeStingerTime = 20 * (30 - stingerCount);
|
|
- }
|
|
-
|
|
- this.removeStingerTime--;
|
|
- if (this.removeStingerTime <= 0) {
|
|
- this.setStingerCount(stingerCount - 1);
|
|
- }
|
|
+ this.removeArrowTime--;
|
|
+ if (this.removeArrowTime <= 0) {
|
|
+ this.setArrowCount(arrowCount - 1);
|
|
}
|
|
+ }
|
|
|
|
- this.detectEquipmentUpdatesPublic(); // CraftBukkit
|
|
- if (this.tickCount % 20 == 0) {
|
|
- this.getCombatTracker().recheckStatus();
|
|
+ int stingerCount = this.getStingerCount();
|
|
+ if (stingerCount > 0) {
|
|
+ if (this.removeStingerTime <= 0) {
|
|
+ this.removeStingerTime = 20 * (30 - stingerCount);
|
|
}
|
|
|
|
- if (this.isSleeping() && !this.checkBedExists()) {
|
|
- this.stopSleeping();
|
|
+ this.removeStingerTime--;
|
|
+ if (this.removeStingerTime <= 0) {
|
|
+ this.setStingerCount(stingerCount - 1);
|
|
}
|
|
}
|
|
|
|
+ this.detectEquipmentUpdatesPublic(); // CraftBukkit
|
|
+ if (this.tickCount % 20 == 0) {
|
|
+ this.getCombatTracker().recheckStatus();
|
|
+ }
|
|
+
|
|
+ if (this.isSleeping() && !this.checkBedExists()) {
|
|
+ this.stopSleeping();
|
|
+ }
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
+
|
|
if (!this.isRemoved()) {
|
|
this.aiStep();
|
|
}
|
|
@@ -3535,14 +3541,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.travel(vec3);
|
|
}
|
|
|
|
- if (!this.level().isClientSide() || this.isControlledByLocalInstance()) {
|
|
- this.applyEffectsFromBlocks();
|
|
- }
|
|
+ this.applyEffectsFromBlocks(); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.calculateEntityAnimation(this instanceof FlyingAnimal);
|
|
profilerFiller.pop();
|
|
profilerFiller.push("freezing");
|
|
- if (!this.level().isClientSide && !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API
|
|
+ if (/*!this.level().isClientSide &&*/ !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
int ticksFrozen = this.getTicksFrozen();
|
|
if (this.isInPowderSnow && this.canFreeze()) {
|
|
this.setTicksFrozen(Math.min(this.getTicksRequiredToFreeze(), ticksFrozen + 1));
|
|
@@ -3634,36 +3638,40 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
protected void updateFallFlying() {
|
|
this.checkSlowFallDistance();
|
|
- if (!this.level().isClientSide) {
|
|
- if (!this.canGlide()) {
|
|
- if (this.getSharedFlag(7) != false && !CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) // CraftBukkit
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (!this.canGlide()) {
|
|
+ if (this.getSharedFlag(7) != false && !CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) // CraftBukkit
|
|
this.setSharedFlag(7, false);
|
|
- return;
|
|
- }
|
|
|
|
- int i = this.fallFlyTicks + 1;
|
|
- if (i % 10 == 0) {
|
|
- int i1 = i / 10;
|
|
- if (i1 % 2 == 0) {
|
|
- List<EquipmentSlot> list = EquipmentSlot.VALUES.stream().filter(slot -> canGlideUsing(this.getItemBySlot(slot), slot)).toList();
|
|
- EquipmentSlot equipmentSlot = Util.getRandom(list, this.random);
|
|
+ return;
|
|
+ }
|
|
|
|
- // Purpur start - Implement elytra settings
|
|
- int damage = level().purpurConfig.elytraDamagePerSecond;
|
|
- if (level().purpurConfig.elytraDamageMultiplyBySpeed > 0) {
|
|
- double speed = getDeltaMovement().lengthSqr();
|
|
- if (speed > level().purpurConfig.elytraDamageMultiplyBySpeed) {
|
|
- damage *= (int) speed;
|
|
- }
|
|
- }
|
|
+ int i = this.fallFlyTicks + 1;
|
|
+ if (i % 10 != 0) return;
|
|
|
|
- this.getItemBySlot(equipmentSlot).hurtAndBreak(damage, this, equipmentSlot);
|
|
- // Purpur end - Implement elytra settings
|
|
- }
|
|
+ int j = i / 10;
|
|
+ if (j % 2 != 0) {
|
|
+ this.gameEvent(GameEvent.ELYTRA_GLIDE);
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ List<EquipmentSlot> list = EquipmentSlot.VALUES.stream().filter(slot -> canGlideUsing(this.getItemBySlot(slot), slot)).toList();
|
|
+ EquipmentSlot equipmentSlot = Util.getRandom(list, this.random);
|
|
|
|
- this.gameEvent(GameEvent.ELYTRA_GLIDE);
|
|
+ // Purpur start - Implement elytra settings
|
|
+ int damage = level().purpurConfig.elytraDamagePerSecond;
|
|
+ if (level().purpurConfig.elytraDamageMultiplyBySpeed > 0) {
|
|
+ double speed = getDeltaMovement().lengthSqr();
|
|
+ if (speed > level().purpurConfig.elytraDamageMultiplyBySpeed) {
|
|
+ damage *= (int) speed;
|
|
}
|
|
}
|
|
+
|
|
+ this.getItemBySlot(equipmentSlot).hurtAndBreak(damage, this, equipmentSlot);
|
|
+ // Purpur end - Implement elytra settings
|
|
+
|
|
+ this.gameEvent(GameEvent.ELYTRA_GLIDE);
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public boolean canGlide() {
|
|
@@ -3751,7 +3759,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.autoSpinAttackTicks = 0;
|
|
}
|
|
|
|
- if (!this.level().isClientSide && this.autoSpinAttackTicks <= 0) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.autoSpinAttackTicks <= 0) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setLivingEntityFlag(4, false);
|
|
this.autoSpinAttackDmg = 0.0F;
|
|
this.autoSpinAttackItemStack = null;
|
|
@@ -3780,7 +3788,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
// Paper end - Force entity dismount during teleportation
|
|
Entity vehicle = this.getVehicle();
|
|
super.stopRiding(suppressCancellation); // Paper - Force entity dismount during teleportation
|
|
- if (vehicle != null && vehicle != this.getVehicle() && !this.level().isClientSide && vehicle.valid) { // Paper - don't process on world gen
|
|
+ if (vehicle != null && vehicle != this.getVehicle() /*&& !this.level().isClientSide*/ && vehicle.valid) { // Paper - don't process on world gen // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.dismountVehicle(vehicle);
|
|
}
|
|
}
|
|
@@ -3852,7 +3860,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
public void take(Entity entity, int amount) {
|
|
if (!entity.isRemoved()
|
|
- && !this.level().isClientSide
|
|
+ //&& !this.level().isClientSide // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
&& (entity instanceof ItemEntity || entity instanceof AbstractArrow || entity instanceof ExperienceOrb)) {
|
|
((ServerLevel)this.level()).getChunkSource().broadcastAndSend(this, new ClientboundTakeItemEntityPacket(entity.getId(), this.getId(), amount)); // Paper - broadcast with collector as source
|
|
}
|
|
@@ -3992,7 +4000,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
// Paper start - lag compensate eating
|
|
// we add 1 to the expected time to avoid lag compensating when we should not
|
|
final boolean shouldLagCompensate = this.useItem.has(DataComponents.FOOD) && this.eatStartTime != -1 && (System.nanoTime() - this.eatStartTime) > ((1L + this.totalEatTimeTicks) * 50L * (1000L * 1000L));
|
|
- if ((--this.useItemRemaining == 0 || shouldLagCompensate) && !this.level().isClientSide && !usingItem.useOnRelease()) {
|
|
+ if ((--this.useItemRemaining == 0 || shouldLagCompensate) /*&& !this.level().isClientSide*/ && !usingItem.useOnRelease()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.useItemRemaining = 0;
|
|
// Paper end - lag compensate eating
|
|
this.completeUsingItem();
|
|
@@ -4032,22 +4040,23 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.useItemRemaining = this.totalEatTimeTicks = itemInHand.getUseDuration(this);
|
|
this.eatStartTime = System.nanoTime();
|
|
// Paper end - lag compensate eating
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setLivingEntityFlag(1, true);
|
|
this.setLivingEntityFlag(2, hand == InteractionHand.OFF_HAND);
|
|
this.gameEvent(GameEvent.ITEM_INTERACT_START);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onSyncedDataUpdated(EntityDataAccessor<?> key) {
|
|
super.onSyncedDataUpdated(key);
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
if (SLEEPING_POS_ID.equals(key)) {
|
|
- if (this.level().isClientSide) {
|
|
+ if (this.level().isClientSide) { // == false // Plazma - marking
|
|
this.getSleepingPos().ifPresent(this::setPosToBed);
|
|
}
|
|
- } else if (DATA_LIVING_ENTITY_FLAGS.equals(key) && this.level().isClientSide) {
|
|
+ } else if (DATA_LIVING_ENTITY_FLAGS.equals(key) && this.level().isClientSide) { // == false // Plazma - marking
|
|
if (this.isUsingItem() && this.useItem.isEmpty()) {
|
|
this.useItem = this.getItemInHand(this.getUsedItemHand());
|
|
if (!this.useItem.isEmpty()) {
|
|
@@ -4061,6 +4070,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
// Paper end - lag compensate eating
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -4091,58 +4101,66 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
|
|
public void completeUsingItem() {
|
|
- if (!this.level().isClientSide || this.isUsingItem()) {
|
|
- InteractionHand usedItemHand = this.getUsedItemHand();
|
|
- if (!this.useItem.equals(this.getItemInHand(usedItemHand))) {
|
|
- this.releaseUsingItem();
|
|
- } else {
|
|
- if (!this.useItem.isEmpty() && this.isUsingItem()) {
|
|
- this.startUsingItem(this.getUsedItemHand(), true); // Paper - Prevent consuming the wrong itemstack
|
|
- // CraftBukkit start - fire PlayerItemConsumeEvent
|
|
- ItemStack itemStack;
|
|
- PlayerItemConsumeEvent event = null; // Paper
|
|
- if (this instanceof ServerPlayer serverPlayer) {
|
|
- org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.useItem);
|
|
- org.bukkit.inventory.EquipmentSlot hand = org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(usedItemHand);
|
|
- event = new PlayerItemConsumeEvent((org.bukkit.entity.Player) this.getBukkitEntity(), craftItem, hand); // Paper
|
|
- this.level().getCraftServer().getPluginManager().callEvent(event);
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ final InteractionHand usedItemHand = this.getUsedItemHand();
|
|
+ if (!this.useItem.equals(this.getItemInHand(usedItemHand))) {
|
|
+ this.releaseUsingItem();
|
|
+ return;
|
|
+ }
|
|
|
|
- if (event.isCancelled()) {
|
|
- // Update client
|
|
- Consumable consumable = this.useItem.get(DataComponents.CONSUMABLE);
|
|
- if (consumable != null) {
|
|
- consumable.cancelUsingItem(serverPlayer, this.useItem);
|
|
- }
|
|
- serverPlayer.getBukkitEntity().updateInventory();
|
|
- serverPlayer.getBukkitEntity().updateScaledHealth();
|
|
- this.stopUsingItem(); // Paper - event is using an item, clear active item to reset its use
|
|
- return;
|
|
- }
|
|
+ if (this.useItem.isEmpty() || !this.isUsingItem()) {
|
|
+ return;
|
|
+ }
|
|
|
|
- itemStack = (craftItem.equals(event.getItem())) ? this.useItem.finishUsingItem(this.level(), this) : CraftItemStack.asNMSCopy(event.getItem()).finishUsingItem(this.level(), this);
|
|
- } else {
|
|
- itemStack = this.useItem.finishUsingItem(this.level(), this);
|
|
- }
|
|
- // Paper start - save the default replacement item and change it if necessary
|
|
- final ItemStack defaultReplacement = itemStack;
|
|
- if (event != null && event.getReplacement() != null) {
|
|
- itemStack = CraftItemStack.asNMSCopy(event.getReplacement());
|
|
- }
|
|
- // Paper end
|
|
- // CraftBukkit end
|
|
- if (itemStack != this.useItem) {
|
|
- this.setItemInHand(usedItemHand, itemStack);
|
|
- }
|
|
+ this.startUsingItem(this.getUsedItemHand(), true); // Paper - Prevent consuming the wrong itemstack
|
|
|
|
- this.stopUsingItem();
|
|
- // Paper start
|
|
- if (this instanceof ServerPlayer) {
|
|
- ((ServerPlayer) this).getBukkitEntity().updateInventory();
|
|
- }
|
|
- // Paper end
|
|
+ // CraftBukkit start - fire PlayerItemConsumeEvent
|
|
+ ItemStack itemStack;
|
|
+ PlayerItemConsumeEvent event = null; // Paper
|
|
+ if (this instanceof ServerPlayer serverPlayer) {
|
|
+ org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.useItem);
|
|
+ org.bukkit.inventory.EquipmentSlot hand = org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(usedItemHand);
|
|
+ event = new PlayerItemConsumeEvent((org.bukkit.entity.Player) this.getBukkitEntity(), craftItem, hand); // Paper
|
|
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
|
+
|
|
+ if (event.isCancelled()) {
|
|
+ // Update client
|
|
+ Consumable consumable = this.useItem.get(DataComponents.CONSUMABLE);
|
|
+ if (consumable != null) {
|
|
+ consumable.cancelUsingItem(serverPlayer, this.useItem);
|
|
}
|
|
+ serverPlayer.getBukkitEntity().updateInventory();
|
|
+ serverPlayer.getBukkitEntity().updateScaledHealth();
|
|
+ this.stopUsingItem(); // Paper - event is using an item, clear active item to reset its use
|
|
+ return;
|
|
}
|
|
+
|
|
+ itemStack = (craftItem.equals(event.getItem())) ? this.useItem.finishUsingItem(this.level(), this) : CraftItemStack.asNMSCopy(event.getItem()).finishUsingItem(this.level(), this);
|
|
+ } else {
|
|
+ itemStack = this.useItem.finishUsingItem(this.level(), this);
|
|
+ }
|
|
+
|
|
+ // Paper start - save the default replacement item and change it if necessary
|
|
+ final ItemStack defaultReplacement = itemStack;
|
|
+ if (event != null && event.getReplacement() != null) {
|
|
+ itemStack = CraftItemStack.asNMSCopy(event.getReplacement());
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
+ // CraftBukkit end
|
|
+ if (itemStack != this.useItem) {
|
|
+ this.setItemInHand(usedItemHand, itemStack);
|
|
}
|
|
+
|
|
+ this.stopUsingItem();
|
|
+
|
|
+ // Paper start
|
|
+ if (this instanceof ServerPlayer) {
|
|
+ ((ServerPlayer) this).getBukkitEntity().updateInventory();
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public void handleExtraItemsCreatedOnUse(ItemStack stack) {
|
|
@@ -4173,13 +4191,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
|
|
public void stopUsingItem() {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean isUsingItem = this.isUsingItem();
|
|
this.setLivingEntityFlag(1, false);
|
|
if (isUsingItem) {
|
|
this.gameEvent(GameEvent.ITEM_INTERACT_FINISH);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.useItem = ItemStack.EMPTY;
|
|
// Paper start - lag compensate eating
|
|
@@ -4594,7 +4612,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
@Override
|
|
public boolean isCurrentlyGlowing() {
|
|
- return !this.level().isClientSide() && this.hasEffect(MobEffects.GLOWING) || super.isCurrentlyGlowing();
|
|
+ return /*!this.level().isClientSide() &&*/ this.hasEffect(MobEffects.GLOWING) || super.isCurrentlyGlowing(); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
|
index 70ee86993d381445855ac7e7290da384d6675987..b786fef4c0e8c1c4ec043904a574b445deae695a 100644
|
|
--- a/net/minecraft/world/entity/Mob.java
|
|
+++ b/net/minecraft/world/entity/Mob.java
|
|
@@ -399,11 +399,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
}
|
|
|
|
public void spawnAnim() {
|
|
- if (this.level().isClientSide) {
|
|
- this.makePoofParticles();
|
|
- } else {
|
|
- this.level().broadcastEntityEvent(this, (byte)20);
|
|
- }
|
|
+ this.level().broadcastEntityEvent(this, (byte)20); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -418,7 +414,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (!this.level().isClientSide && this.tickCount % 5 == 0) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.tickCount % 5 == 0) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.updateControlFlags();
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
|
|
index 95fa516910a3834bbd4db6d11279e13a1f0dac41..916a41add6ef45e8a80336c3a1f93b264aa87cb5 100644
|
|
--- a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
|
|
+++ b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
|
|
@@ -78,21 +78,19 @@ public class RemoveBlockGoal extends MoveToBlockGoal {
|
|
if (this.ticksSinceReachedGoal > 0) {
|
|
Vec3 deltaMovement = this.removerMob.getDeltaMovement();
|
|
this.removerMob.setDeltaMovement(deltaMovement.x, 0.3, deltaMovement.z);
|
|
- if (!level.isClientSide) {
|
|
- double d = 0.08;
|
|
- ((ServerLevel)level)
|
|
- .sendParticles(
|
|
- new ItemParticleOption(ParticleTypes.ITEM, new ItemStack(Items.EGG)),
|
|
- posWithBlock.getX() + 0.5,
|
|
- posWithBlock.getY() + 0.7,
|
|
- posWithBlock.getZ() + 0.5,
|
|
- 3,
|
|
- (random.nextFloat() - 0.5) * 0.08,
|
|
- (random.nextFloat() - 0.5) * 0.08,
|
|
- (random.nextFloat() - 0.5) * 0.08,
|
|
- 0.15F
|
|
- );
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ ((ServerLevel) level).sendParticles(
|
|
+ new ItemParticleOption(ParticleTypes.ITEM, new ItemStack(Items.EGG)),
|
|
+ posWithBlock.getX() + 0.5,
|
|
+ posWithBlock.getY() + 0.7,
|
|
+ posWithBlock.getZ() + 0.5,
|
|
+ 3,
|
|
+ (random.nextFloat() - 0.5) * 0.08,
|
|
+ (random.nextFloat() - 0.5) * 0.08,
|
|
+ (random.nextFloat() - 0.5) * 0.08,
|
|
+ 0.15F
|
|
+ );
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
if (this.ticksSinceReachedGoal % 2 == 0) {
|
|
@@ -110,7 +108,7 @@ public class RemoveBlockGoal extends MoveToBlockGoal {
|
|
}
|
|
// CraftBukkit end
|
|
level.removeBlock(posWithBlock, false);
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
for (int i = 0; i < 20; i++) {
|
|
double d = random.nextGaussian() * 0.02;
|
|
double d1 = random.nextGaussian() * 0.02;
|
|
@@ -120,7 +118,7 @@ public class RemoveBlockGoal extends MoveToBlockGoal {
|
|
}
|
|
|
|
this.playBreakSound(level, posWithBlock);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
this.ticksSinceReachedGoal++;
|
|
diff --git a/net/minecraft/world/entity/ambient/Bat.java b/net/minecraft/world/entity/ambient/Bat.java
|
|
index 4ac052a78841939a53dac2afb575cb115581e249..0d818552610575494d5592f7813855e8330634f5 100644
|
|
--- a/net/minecraft/world/entity/ambient/Bat.java
|
|
+++ b/net/minecraft/world/entity/ambient/Bat.java
|
|
@@ -43,9 +43,7 @@ public class Bat extends AmbientCreature {
|
|
public Bat(EntityType<? extends Bat> entityType, Level level) {
|
|
super(entityType, level);
|
|
this.moveControl = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.075F); // Purpur - Ridables
|
|
- if (!level.isClientSide) {
|
|
- this.setResting(true);
|
|
- }
|
|
+ this.setResting(true); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
// Purpur start - Ridables
|
|
diff --git a/net/minecraft/world/entity/animal/Animal.java b/net/minecraft/world/entity/animal/Animal.java
|
|
index 452270f7f1c54ca98c34dcf9a9d29acae77737c8..3d37195aaa8aba08b19d91edc99cfd5f1580b4c5 100644
|
|
--- a/net/minecraft/world/entity/animal/Animal.java
|
|
+++ b/net/minecraft/world/entity/animal/Animal.java
|
|
@@ -143,7 +143,7 @@ public abstract class Animal extends AgeableMob {
|
|
ItemStack itemInHand = player.getItemInHand(hand);
|
|
if (this.isFood(itemInHand)) {
|
|
int age = this.getAge();
|
|
- if (!this.level().isClientSide && age == 0 && this.canFallInLove() && (this.level().purpurConfig.animalBreedingCooldownSeconds <= 0 || !this.level().hasBreedingCooldown(player.getUUID(), this.getClass()))) { // Purpur - Add adjustable breeding cooldown to config
|
|
+ if (/*!this.level().isClientSide &&*/ age == 0 && this.canFallInLove() && (this.level().purpurConfig.animalBreedingCooldownSeconds <= 0 || !this.level().hasBreedingCooldown(player.getUUID(), this.getClass()))) { // Purpur - Add adjustable breeding cooldown to config // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
final ItemStack breedCopy = itemInHand.copy(); // Paper - Fix EntityBreedEvent copying
|
|
this.usePlayerItem(player, hand, itemInHand);
|
|
this.setInLove(player, breedCopy); // Paper - Fix EntityBreedEvent copying
|
|
@@ -158,9 +158,10 @@ public abstract class Animal extends AgeableMob {
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
return InteractionResult.CONSUME;
|
|
}
|
|
+ */
|
|
}
|
|
|
|
return super.mobInteract(player, hand);
|
|
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
|
|
index 497e8bd6e1e547daf7c09f2f1bc6ae69e559ebc2..5f8273621be03ed1d955683d38d3231ac09bf8cc 100644
|
|
--- a/net/minecraft/world/entity/animal/Bee.java
|
|
+++ b/net/minecraft/world/entity/animal/Bee.java
|
|
@@ -569,7 +569,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.stayOutOfHiveCountdown > 0) {
|
|
this.stayOutOfHiveCountdown--;
|
|
}
|
|
@@ -587,7 +587,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
|
if (this.tickCount % 20 == 0 && !this.isHiveValid()) {
|
|
this.hivePos = null;
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Nullable
|
|
@@ -688,9 +688,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
|
MobEffectInstance beeInteractionEffect = flowerBlock.getBeeInteractionEffect();
|
|
if (beeInteractionEffect != null) {
|
|
this.usePlayerItem(player, hand, itemInHand);
|
|
- if (!this.level().isClientSide) {
|
|
- this.addEffect(beeInteractionEffect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // Paper - Add missing effect cause
|
|
- }
|
|
+ this.addEffect(beeInteractionEffect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // Paper - Add missing effect cause // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/Bucketable.java b/net/minecraft/world/entity/animal/Bucketable.java
|
|
index 23db9b64f1a791fdcfe46a4027dde2e0170acaf8..5cbba5577483ab68a24720528f2f3ef43818003d 100644
|
|
--- a/net/minecraft/world/entity/animal/Bucketable.java
|
|
+++ b/net/minecraft/world/entity/animal/Bucketable.java
|
|
@@ -104,9 +104,7 @@ public interface Bucketable {
|
|
ItemStack itemStack = ItemUtils.createFilledResult(itemInHand, player, bucketItemStack, false);
|
|
player.setItemInHand(hand, itemStack);
|
|
Level level = entity.level();
|
|
- if (!level.isClientSide) {
|
|
- CriteriaTriggers.FILLED_BUCKET.trigger((ServerPlayer)player, bucketItemStack);
|
|
- }
|
|
+ CriteriaTriggers.FILLED_BUCKET.trigger((ServerPlayer)player, bucketItemStack); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause
|
|
return Optional.of(InteractionResult.SUCCESS);
|
|
diff --git a/net/minecraft/world/entity/animal/Cat.java b/net/minecraft/world/entity/animal/Cat.java
|
|
index edd796fd34e43d66a48104201d885756fdd968c3..bd579657e333f79d0c05d0ede4e93d12178b621b 100644
|
|
--- a/net/minecraft/world/entity/animal/Cat.java
|
|
+++ b/net/minecraft/world/entity/animal/Cat.java
|
|
@@ -429,21 +429,21 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
|
if (!event.callEvent()) return InteractionResult.FAIL;
|
|
dyeColor = DyeColor.byId(event.getColor().getWoolData());
|
|
// Paper end - Add EntityDyeEvent and CollarColorable interface
|
|
- if (!this.level().isClientSide()) {
|
|
+ //if (!this.level().isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setCollarColor(dyeColor);
|
|
itemInHand.consume(1, player);
|
|
this.setPersistenceRequired();
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
} else if (this.isFood(itemInHand) && this.getHealth() < this.getMaxHealth()) {
|
|
- if (!this.level().isClientSide()) {
|
|
+ //if (!this.level().isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.usePlayerItem(player, hand, itemInHand);
|
|
FoodProperties foodProperties = itemInHand.get(DataComponents.FOOD);
|
|
this.heal(foodProperties != null ? foodProperties.nutrition() : 1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason
|
|
this.playEatingSound();
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
@@ -457,12 +457,12 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
|
return interactionResult;
|
|
}
|
|
} else if (this.isFood(itemInHand)) {
|
|
- if (!this.level().isClientSide()) {
|
|
+ //if (!this.level().isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.usePlayerItem(player, hand, itemInHand);
|
|
this.tryToTame(player);
|
|
this.setPersistenceRequired();
|
|
this.playEatingSound();
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/Dolphin.java b/net/minecraft/world/entity/animal/Dolphin.java
|
|
index 7003b532182737a745491e397a967b72e6b308aa..f69ea161f3a98f73a493f6a5c384cbb66182b220 100644
|
|
--- a/net/minecraft/world/entity/animal/Dolphin.java
|
|
+++ b/net/minecraft/world/entity/animal/Dolphin.java
|
|
@@ -374,7 +374,7 @@ public class Dolphin extends AgeableWaterCreature {
|
|
}
|
|
}
|
|
|
|
- if (this.level().isClientSide && this.isInWater() && this.getDeltaMovement().lengthSqr() > 0.03) {
|
|
+ /*if (this.level().isClientSide && this.isInWater() && this.getDeltaMovement().lengthSqr() > 0.03) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
Vec3 viewVector = this.getViewVector(0.0F);
|
|
float f = Mth.cos(this.getYRot() * (float) (Math.PI / 180.0)) * 0.3F;
|
|
float f1 = Mth.sin(this.getYRot() * (float) (Math.PI / 180.0)) * 0.3F;
|
|
@@ -403,6 +403,7 @@ public class Dolphin extends AgeableWaterCreature {
|
|
);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
|
|
@@ -428,9 +429,7 @@ public class Dolphin extends AgeableWaterCreature {
|
|
protected InteractionResult mobInteract(Player player, InteractionHand hand) {
|
|
ItemStack itemInHand = player.getItemInHand(hand);
|
|
if (!itemInHand.isEmpty() && itemInHand.is(ItemTags.FISHES)) {
|
|
- if (!this.level().isClientSide) {
|
|
- this.playSound(SoundEvents.DOLPHIN_EAT, 1.0F, 1.0F);
|
|
- }
|
|
+ this.playSound(SoundEvents.DOLPHIN_EAT, 1.0F, 1.0F); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.isBaby()) {
|
|
itemInHand.consume(1, player);
|
|
diff --git a/net/minecraft/world/entity/animal/Fox.java b/net/minecraft/world/entity/animal/Fox.java
|
|
index f5f5eea330f36fd036d1c2750c424b02161579a9..b9d8f3b3d419a13bd1b888a2bce4dd33fe0c24b4 100644
|
|
--- a/net/minecraft/world/entity/animal/Fox.java
|
|
+++ b/net/minecraft/world/entity/animal/Fox.java
|
|
@@ -255,7 +255,7 @@ public class Fox extends Animal implements VariantHolder<Fox.Variant> {
|
|
|
|
@Override
|
|
public void aiStep() {
|
|
- if (!this.level().isClientSide && this.isAlive() && this.isEffectiveAi()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isAlive() && this.isEffectiveAi()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.ticksSinceEaten++;
|
|
ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.MAINHAND);
|
|
if (this.canEat(itemBySlot)) {
|
|
@@ -558,7 +558,7 @@ public class Fox extends Animal implements VariantHolder<Fox.Variant> {
|
|
}
|
|
|
|
private void spitOutItem(ItemStack stack) {
|
|
- if (!stack.isEmpty() && !this.level().isClientSide) {
|
|
+ if (!stack.isEmpty() /*&& !this.level().isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ItemEntity itemEntity = new ItemEntity(
|
|
this.level(), this.getX() + this.getLookAngle().x, this.getY() + 1.0, this.getZ() + this.getLookAngle().z, stack
|
|
);
|
|
diff --git a/net/minecraft/world/entity/animal/IronGolem.java b/net/minecraft/world/entity/animal/IronGolem.java
|
|
index ccadc9a151e258ff2c74c65c374b1f09d56d10ec..1e816a4842eec321968e662412f8cd3bae1ca259 100644
|
|
--- a/net/minecraft/world/entity/animal/IronGolem.java
|
|
+++ b/net/minecraft/world/entity/animal/IronGolem.java
|
|
@@ -176,9 +176,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
|
this.offerFlowerTick--;
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
- this.updatePersistentAnger((ServerLevel)this.level(), true);
|
|
- }
|
|
+ this.updatePersistentAnger((ServerLevel) this.level(), true); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/animal/Ocelot.java b/net/minecraft/world/entity/animal/Ocelot.java
|
|
index 681f1256d8bbedc7731fd2906a7f439da4333552..a99f78da91690971b64c3f4fac08b1103579113c 100644
|
|
--- a/net/minecraft/world/entity/animal/Ocelot.java
|
|
+++ b/net/minecraft/world/entity/animal/Ocelot.java
|
|
@@ -206,7 +206,7 @@ public class Ocelot extends Animal {
|
|
ItemStack itemInHand = player.getItemInHand(hand);
|
|
if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemInHand) && player.distanceToSqr(this) < 9.0) {
|
|
this.usePlayerItem(player, hand, itemInHand);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit - added event call and isCancelled check
|
|
this.setTrusting(true);
|
|
this.spawnTrustingParticles(true);
|
|
@@ -215,7 +215,7 @@ public class Ocelot extends Animal {
|
|
this.spawnTrustingParticles(false);
|
|
this.level().broadcastEntityEvent(this, (byte)40);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/entity/animal/Panda.java b/net/minecraft/world/entity/animal/Panda.java
|
|
index 0a6a3060f3690ab2d8439d66e6fd6f0c5dc20688..532dec52c5f1d6a7f9d05c7e61ef071e150ee193 100644
|
|
--- a/net/minecraft/world/entity/animal/Panda.java
|
|
+++ b/net/minecraft/world/entity/animal/Panda.java
|
|
@@ -455,12 +455,12 @@ public class Panda extends Animal {
|
|
|
|
if (this.isEating()) {
|
|
this.addEatingParticles();
|
|
- if (!this.level().isClientSide && this.getEatCounter() > 80 && this.random.nextInt(20) == 1) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.getEatCounter() > 80 && this.random.nextInt(20) == 1) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.getEatCounter() > 100 && this.getItemBySlot(EquipmentSlot.MAINHAND).is(ItemTags.PANDA_EATS_FROM_GROUND)) {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY);
|
|
this.gameEvent(GameEvent.EAT);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.sit(false);
|
|
}
|
|
@@ -543,7 +543,7 @@ public class Panda extends Animal {
|
|
if (this.rollCounter > 32) {
|
|
this.roll(false);
|
|
} else {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Vec3 deltaMovement = this.getDeltaMovement();
|
|
if (this.rollCounter == 1) {
|
|
float f = this.getYRot() * (float) (Math.PI / 180.0);
|
|
@@ -555,7 +555,7 @@ public class Panda extends Animal {
|
|
} else {
|
|
this.setDeltaMovement(0.0, this.onGround() ? 0.27 : deltaMovement.y, 0.0);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
|
|
@@ -690,7 +690,7 @@ public class Panda extends Animal {
|
|
if (this.isBaby()) {
|
|
this.usePlayerItem(player, hand, itemInHand);
|
|
this.ageUp((int)(-this.getAge() / 20 * 0.1F), true);
|
|
- } else if (!this.level().isClientSide && this.getAge() == 0 && this.canFallInLove()) {
|
|
+ } else if (/*!this.level().isClientSide &&*/ this.getAge() == 0 && this.canFallInLove()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
final ItemStack breedCopy = itemInHand.copy(); // Paper - Fix EntityBreedEvent copying
|
|
this.usePlayerItem(player, hand, itemInHand);
|
|
this.setInLove(player, breedCopy); // Paper - Fix EntityBreedEvent copying
|
|
diff --git a/net/minecraft/world/entity/animal/Parrot.java b/net/minecraft/world/entity/animal/Parrot.java
|
|
index d2c3bfcdafe7ae1937f8bd8f12f9ac4170445e9a..c1c2854cf7657c5c4eb96aaba35960de5ee5e734 100644
|
|
--- a/net/minecraft/world/entity/animal/Parrot.java
|
|
+++ b/net/minecraft/world/entity/animal/Parrot.java
|
|
@@ -344,22 +344,20 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
|
|
);
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.level().purpurConfig.alwaysTameInCreative && player.hasInfiniteMaterials() || (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled())) { // CraftBukkit // Purpur - Config to always tame in Creative
|
|
this.tame(player);
|
|
this.level().broadcastEntityEvent(this, (byte)7);
|
|
} else {
|
|
this.level().broadcastEntityEvent(this, (byte)6);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.level().purpurConfig.parrotBreedable) return super.mobInteract(player, hand); // Purpur - Breedable parrots
|
|
return InteractionResult.SUCCESS;
|
|
} else if (!itemInHand.is(ItemTags.PARROT_POISONOUS_FOOD)) {
|
|
if (!this.isFlying() && this.isTame() && this.isOwnedBy(player)) {
|
|
- if (!this.level().isClientSide) {
|
|
- this.setOrderedToSit(!this.isOrderedToSit());
|
|
- }
|
|
+ this.setOrderedToSit(!this.isOrderedToSit()); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/entity/animal/Pig.java b/net/minecraft/world/entity/animal/Pig.java
|
|
index 1a504a3d887f5294c5a2fec3f4bc6654d380996e..c797483e6acbaddce540461158b34113c16341d5 100644
|
|
--- a/net/minecraft/world/entity/animal/Pig.java
|
|
+++ b/net/minecraft/world/entity/animal/Pig.java
|
|
@@ -130,9 +130,10 @@ public class Pig extends Animal implements ItemSteerable, Saddleable {
|
|
|
|
@Override
|
|
public void onSyncedDataUpdated(EntityDataAccessor<?> key) {
|
|
- if (DATA_BOOST_TIME.equals(key) && this.level().isClientSide) {
|
|
+ /*if (DATA_BOOST_TIME.equals(key) && this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.steering.onSynced();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.onSyncedDataUpdated(key);
|
|
}
|
|
@@ -193,9 +194,7 @@ public class Pig extends Animal implements ItemSteerable, Saddleable {
|
|
// Purpur end - Pigs give saddle back
|
|
|
|
if (!isFood && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) {
|
|
- if (!this.level().isClientSide) {
|
|
- player.startRiding(this);
|
|
- }
|
|
+ player.startRiding(this); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/entity/animal/PolarBear.java b/net/minecraft/world/entity/animal/PolarBear.java
|
|
index 026e64bf743aa79ba6409fa5cd4374b368f98caa..30792fb779104c87d2affbc8f24e3190ea25b070 100644
|
|
--- a/net/minecraft/world/entity/animal/PolarBear.java
|
|
+++ b/net/minecraft/world/entity/animal/PolarBear.java
|
|
@@ -272,7 +272,7 @@ public class PolarBear extends Animal implements NeutralMob {
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.clientSideStandAnimation != this.clientSideStandAnimationO) {
|
|
this.refreshDimensions();
|
|
}
|
|
@@ -284,14 +284,13 @@ public class PolarBear extends Animal implements NeutralMob {
|
|
this.clientSideStandAnimation = Mth.clamp(this.clientSideStandAnimation - 1.0F, 0.0F, 6.0F);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.warningSoundTicks > 0) {
|
|
this.warningSoundTicks--;
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
- this.updatePersistentAnger((ServerLevel)this.level(), true);
|
|
- }
|
|
+ this.updatePersistentAnger((ServerLevel) this.level(), true); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
// Purpur start - Ridables
|
|
if (isStanding() && --standTimer <= 0) {
|
|
diff --git a/net/minecraft/world/entity/animal/Pufferfish.java b/net/minecraft/world/entity/animal/Pufferfish.java
|
|
index 5889a9ceb54a354a79f33c9e4fc338cbf912ddda..83e176156124472b0dd571fd7624326d68b309f3 100644
|
|
--- a/net/minecraft/world/entity/animal/Pufferfish.java
|
|
+++ b/net/minecraft/world/entity/animal/Pufferfish.java
|
|
@@ -126,7 +126,7 @@ public class Pufferfish extends AbstractFish {
|
|
|
|
@Override
|
|
public void tick() {
|
|
- if (!this.level().isClientSide && this.isAlive() && this.isEffectiveAi()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isAlive() && this.isEffectiveAi()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.inflateCounter > 0) {
|
|
boolean increase = true; // Paper - Add PufferFishStateChangeEvent
|
|
if (this.getPuffState() == 0) {
|
|
diff --git a/net/minecraft/world/entity/animal/Rabbit.java b/net/minecraft/world/entity/animal/Rabbit.java
|
|
index 02958fe7f39009a58b93e78f18c10308b8c2f815..41449917bc35fda39467405b751e802c86bc42b7 100644
|
|
--- a/net/minecraft/world/entity/animal/Rabbit.java
|
|
+++ b/net/minecraft/world/entity/animal/Rabbit.java
|
|
@@ -223,9 +223,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
|
|
}
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
- this.level().broadcastEntityEvent(this, (byte)1);
|
|
- }
|
|
+ this.level().broadcastEntityEvent(this, (byte) 1); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public float getJumpCompletion(float partialTick) {
|
|
diff --git a/net/minecraft/world/entity/animal/Sheep.java b/net/minecraft/world/entity/animal/Sheep.java
|
|
index c1760dda7b42471982e4ad78b6150b54a654ebf7..bf21e860c230f8f333ea978efb073dc019c43ad5 100644
|
|
--- a/net/minecraft/world/entity/animal/Sheep.java
|
|
+++ b/net/minecraft/world/entity/animal/Sheep.java
|
|
@@ -155,9 +155,10 @@ public class Sheep extends Animal implements Shearable {
|
|
|
|
@Override
|
|
public void aiStep() {
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.eatAnimationTick = Math.max(0, this.eatAnimationTick - 1);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.aiStep();
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/Squid.java b/net/minecraft/world/entity/animal/Squid.java
|
|
index 0a103e6f3f6b0ec05c5d22b1258eb6e2f776e7dd..3bb01bdb8dc8fe28954669c6ebe31f447c7ca9d4 100644
|
|
--- a/net/minecraft/world/entity/animal/Squid.java
|
|
+++ b/net/minecraft/world/entity/animal/Squid.java
|
|
@@ -178,16 +178,17 @@ public class Squid extends AgeableWaterCreature {
|
|
this.oldTentacleAngle = this.tentacleAngle;
|
|
this.tentacleMovement = this.tentacleMovement + this.tentacleSpeed;
|
|
if (this.tentacleMovement > Math.PI * 2) {
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.tentacleMovement = (float) (Math.PI * 2);
|
|
} else {
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
this.tentacleMovement -= (float) (Math.PI * 2);
|
|
if (this.random.nextInt(10) == 0) {
|
|
this.tentacleSpeed = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
|
}
|
|
|
|
this.level().broadcastEntityEvent(this, (byte)19);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
if (this.isInWaterOrBubble()) {
|
|
@@ -221,7 +222,7 @@ public class Squid extends AgeableWaterCreature {
|
|
this.xBodyRot = this.xBodyRot + (-((float)Mth.atan2(d, deltaMovement.y)) * (180.0F / (float)Math.PI) - this.xBodyRot) * 0.1F;
|
|
} else {
|
|
this.tentacleAngle = Mth.abs(Mth.sin(this.tentacleMovement)) * (float) Math.PI * 0.25F;
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
double d1 = this.getDeltaMovement().y;
|
|
if (this.hasEffect(MobEffects.LEVITATION)) {
|
|
d1 = 0.05 * (this.getEffect(MobEffects.LEVITATION).getAmplifier() + 1);
|
|
@@ -230,7 +231,7 @@ public class Squid extends AgeableWaterCreature {
|
|
}
|
|
|
|
this.setDeltaMovement(0.0, d1 * 0.98F, 0.0);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.xBodyRot = this.xBodyRot + (-90.0F - this.xBodyRot) * 0.02F;
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/Wolf.java b/net/minecraft/world/entity/animal/Wolf.java
|
|
index ef6c0bf20ad18c050cdeb02ddd6c007dfcf1d6b3..1d92e421daefa6f8ea9f4768c96d303b5c9ed39f 100644
|
|
--- a/net/minecraft/world/entity/animal/Wolf.java
|
|
+++ b/net/minecraft/world/entity/animal/Wolf.java
|
|
@@ -375,16 +375,14 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- if (!this.level().isClientSide && this.isWet && !this.isShaking && !this.isPathFinding() && this.onGround()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isWet && !this.isShaking && !this.isPathFinding() && this.onGround()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.isShaking = true;
|
|
this.shakeAnim = 0.0F;
|
|
this.shakeAnimO = 0.0F;
|
|
this.level().broadcastEntityEvent(this, (byte)8);
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
- this.updatePersistentAnger((ServerLevel)this.level(), true);
|
|
- }
|
|
+ this.updatePersistentAnger((ServerLevel) this.level(), true); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -405,7 +403,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
|
|
|
|
if (this.isInWaterRainOrBubble()) {
|
|
this.isWet = true;
|
|
- if (this.isShaking && !this.level().isClientSide) {
|
|
+ if (this.isShaking /*&& !this.level().isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level().broadcastEntityEvent(this, (byte)56);
|
|
this.cancelShake();
|
|
}
|
|
@@ -610,7 +608,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
|
|
itemInHand.consume(1, player);
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
- } else if (!this.level().isClientSide && itemInHand.is(Items.BONE) && !this.isAngry()) {
|
|
+ } else if (/*!this.level().isClientSide &&*/ itemInHand.is(Items.BONE) && !this.isAngry()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
itemInHand.consume(1, player);
|
|
this.tryToTame(player);
|
|
return InteractionResult.SUCCESS_SERVER;
|
|
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
|
|
index 22e0fad86da2e7b932863ef30182355aa41424a1..1259c94aee332be1979613d63ff510eb7f0b213c 100644
|
|
--- a/net/minecraft/world/entity/animal/allay/Allay.java
|
|
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
|
|
@@ -302,7 +302,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- if (!this.level().isClientSide && this.isAlive() && this.tickCount % 10 == 0) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isAlive() && this.tickCount % 10 == 0) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.REGEN); // CraftBukkit
|
|
}
|
|
|
|
@@ -317,7 +317,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.holdingItemAnimationTicks0 = this.holdingItemAnimationTicks;
|
|
if (this.hasItemInHand()) {
|
|
this.holdingItemAnimationTicks = Mth.clamp(this.holdingItemAnimationTicks + 1.0F, 0.0F, 5.0F);
|
|
@@ -341,11 +341,12 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
|
this.spinningAnimationTicks0 = 0.0F;
|
|
}
|
|
} else {
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
VibrationSystem.Ticker.tick(this.level(), this.vibrationData, this.vibrationUser);
|
|
if (this.isPanicking()) {
|
|
this.setDancing(false);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -475,7 +476,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
|
}
|
|
|
|
public void setDancing(boolean dancing) {
|
|
- if (!this.level().isClientSide && this.isEffectiveAi() && (!dancing || !this.isPanicking())) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isEffectiveAi() && (!dancing || !this.isPanicking())) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.entityData.set(DATA_DANCING, dancing);
|
|
}
|
|
}
|
|
@@ -560,7 +561,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
|
this.duplicationCooldown--;
|
|
}
|
|
|
|
- if (!this.level().isClientSide() && this.duplicationCooldown == 0L && !this.canDuplicate()) {
|
|
+ if (/*!this.level().isClientSide() &&*/ this.duplicationCooldown == 0L && !this.canDuplicate()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.entityData.set(DATA_CAN_DUPLICATE, true);
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/allay/AllayAi.java b/net/minecraft/world/entity/animal/allay/AllayAi.java
|
|
index 36a9887f8be04c5c3fda6d926d819a9e5b2a79f2..c9936ab8a67c0eb50898b49480b998af6f36446f 100644
|
|
--- a/net/minecraft/world/entity/animal/allay/AllayAi.java
|
|
+++ b/net/minecraft/world/entity/animal/allay/AllayAi.java
|
|
@@ -141,7 +141,7 @@ public class AllayAi {
|
|
|
|
public static Optional<ServerPlayer> getLikedPlayer(LivingEntity entity) {
|
|
Level level = entity.level();
|
|
- if (!level.isClientSide() && level instanceof ServerLevel serverLevel) {
|
|
+ if (/*!level.isClientSide() &&*/ level instanceof ServerLevel serverLevel) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Optional<UUID> memory = entity.getBrain().getMemory(MemoryModuleType.LIKED_PLAYER);
|
|
if (memory.isPresent()) {
|
|
if (serverLevel.getEntity(memory.get()) instanceof ServerPlayer serverPlayer
|
|
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
index 90bcd8c79cccbcbe7ff3fd2534e0c3450b970bd4..760f69b13e3f0fc4ea892c3310d5bb50cf0d99b4 100644
|
|
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
@@ -62,7 +62,7 @@ public class Armadillo extends Animal {
|
|
public final AnimationState rollUpAnimationState = new AnimationState();
|
|
public final AnimationState peekAnimationState = new AnimationState();
|
|
private int scuteTime;
|
|
- private boolean peekReceivedClient = false;
|
|
+ //private boolean peekReceivedClient = false; // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public Armadillo(EntityType<? extends Animal> entityType, Level level) {
|
|
super(entityType, level);
|
|
@@ -193,9 +193,10 @@ public class Armadillo extends Animal {
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (this.level().isClientSide()) {
|
|
+ /*if (this.level().isClientSide()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setupAnimationStates();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.isScared()) {
|
|
this.clampHeadRotationToBody();
|
|
@@ -209,6 +210,7 @@ public class Armadillo extends Animal {
|
|
return this.isBaby() ? 0.6F : 1.0F;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private void setupAnimationStates() {
|
|
switch (this.getState()) {
|
|
case IDLE:
|
|
@@ -242,7 +244,9 @@ public class Armadillo extends Animal {
|
|
this.peekAnimationState.stop();
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer; Same w/ parent
|
|
@Override
|
|
public void handleEntityEvent(byte id) {
|
|
if (id == 64 && this.level().isClientSide) {
|
|
@@ -252,6 +256,7 @@ public class Armadillo extends Animal {
|
|
super.handleEntityEvent(id);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer; Same w/ parent
|
|
|
|
@Override
|
|
public boolean isFood(ItemStack stack) {
|
|
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
index eb74d8313fd3cc15a33330fe7bafaca4f0a5a368..da98d3483ea3d81d84ff12e7726058fb6da437d0 100644
|
|
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
@@ -229,11 +229,13 @@ public class Axolotl extends Animal implements VariantHolder<Axolotl.Variant>, B
|
|
this.handleAirSupply(airSupply);
|
|
}
|
|
|
|
- if (this.level().isClientSide()) {
|
|
+ /*if (this.level().isClientSide()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.tickAnimations();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private void tickAnimations() {
|
|
Axolotl.AnimationState animationState;
|
|
if (this.isPlayingDead()) {
|
|
@@ -252,6 +254,7 @@ public class Axolotl extends Animal implements VariantHolder<Axolotl.Variant>, B
|
|
boolean flag = this.walkAnimation.isMoving() || this.getXRot() != this.xRotO || this.getYRot() != this.yRotO;
|
|
this.movingAnimator.tick(flag);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
protected void handleAirSupply(int airSupply) {
|
|
if (this.isAlive() && !this.isInWaterRainOrBubble()) {
|
|
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
index 1d7ae2a08968860636918e7c66b60139a9d761b4..e2f0b2e4a87072d4f938933cd10f20b65a51c27c 100644
|
|
--- a/net/minecraft/world/entity/animal/camel/Camel.java
|
|
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
@@ -184,9 +184,10 @@ public class Camel extends AbstractHorse {
|
|
}
|
|
}
|
|
|
|
- if (this.level().isClientSide()) {
|
|
+ /*if (this.level().isClientSide()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setupAnimationStates();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.refuseToMove()) {
|
|
this.clampHeadRotationToBody();
|
|
@@ -197,6 +198,7 @@ public class Camel extends AbstractHorse {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private void setupAnimationStates() {
|
|
if (this.idleAnimationTimeout <= 0) {
|
|
this.idleAnimationTimeout = this.random.nextInt(40) + 80;
|
|
@@ -222,6 +224,7 @@ public class Camel extends AbstractHorse {
|
|
this.sitUpAnimationState.animateWhen(this.isInPoseTransition() && this.getPoseTime() >= 0L, this.tickCount);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void updateWalkAnimation(float partialTick) {
|
|
@@ -428,9 +431,7 @@ public class Camel extends AbstractHorse {
|
|
boolean isBaby = this.isBaby();
|
|
if (isBaby) {
|
|
this.level().addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0), this.getRandomY() + 0.5, this.getRandomZ(1.0), 0.0, 0.0, 0.0);
|
|
- if (!this.level().isClientSide) {
|
|
- this.ageUp(10);
|
|
- }
|
|
+ this.ageUp(10); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
if (!flag && !flag1 && !isBaby) {
|
|
@@ -647,9 +648,7 @@ public class Camel extends AbstractHorse {
|
|
|
|
@Override
|
|
public void openCustomInventoryScreen(Player player) {
|
|
- if (!this.level().isClientSide) {
|
|
- player.openHorseInventory(this, this.inventory);
|
|
- }
|
|
+ player.openHorseInventory(this, this.inventory); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
|
|
index 143a740ce2e7f9d384b71b4d64e8b8218f60cba7..6ed4abd646f86961cbbb126d6637b4f333a8c8e0 100644
|
|
--- a/net/minecraft/world/entity/animal/frog/Frog.java
|
|
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
|
|
@@ -105,7 +105,7 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
|
public final AnimationState jumpAnimationState = new AnimationState();
|
|
public final AnimationState croakAnimationState = new AnimationState();
|
|
public final AnimationState tongueAnimationState = new AnimationState();
|
|
- public final AnimationState swimIdleAnimationState = new AnimationState();
|
|
+ //public final AnimationState swimIdleAnimationState = new AnimationState(); // Plazma - Remove isClientSide on DedicatedServer
|
|
private org.purpurmc.purpur.controller.MoveControllerWASD purpurLandController; // Purpur - Ridables
|
|
private org.purpurmc.purpur.controller.WaterMoveControllerWASD purpurWaterController; // Purpur - Ridables
|
|
|
|
@@ -256,9 +256,10 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
|
|
|
@Override
|
|
public void tick() {
|
|
- if (this.level().isClientSide()) {
|
|
+ /*if (this.level().isClientSide()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.swimIdleAnimationState.animateWhen(this.isInWaterOrBubble() && !this.walkAnimation.isMoving(), this.tickCount);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.tick();
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
|
index e888e606b4b14fa6485de7426bc146b6005962af..4dca4348a91e0c78ffab1b0ce540ebf4ecfe7d34 100644
|
|
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
|
|
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
|
@@ -152,7 +152,7 @@ public class Tadpole extends AbstractFish {
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- if (!this.level().isClientSide && !this.ageLocked) { // Paper
|
|
+ if (/*!this.level().isClientSide &&*/ !this.ageLocked) { // Paper // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setAge(this.age + 1);
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
|
index 56dc7011ed07f0bd5870fbadde2b5c0c630c5edd..59fda709f797021e6fdd1dbd4368333aabf03f50 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
|
@@ -466,9 +466,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
|
}
|
|
|
|
protected void syncSaddleToClients() {
|
|
- if (!this.level().isClientSide) {
|
|
- this.setFlag(4, !this.inventory.getItem(0).isEmpty());
|
|
- }
|
|
+ this.setFlag(4, !this.inventory.getItem(0).isEmpty()); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -571,7 +569,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
|
|
|
@Override
|
|
public void openCustomInventoryScreen(Player player) {
|
|
- if (!this.level().isClientSide && (!this.isVehicle() || this.hasPassenger(player)) && this.isTamed()) {
|
|
+ if (/*!this.level().isClientSide &&*/ (!this.isVehicle() || this.hasPassenger(player)) && this.isTamed()) { // Plazma - Remove isClientSide on DedicatedServer
|
|
player.openHorseInventory(this, this.inventory);
|
|
}
|
|
}
|
|
@@ -582,7 +580,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
|
stack.consume(1, player);
|
|
}
|
|
|
|
- return (InteractionResult)(!flag && !this.level().isClientSide ? InteractionResult.PASS : InteractionResult.SUCCESS_SERVER);
|
|
+ return !flag ? InteractionResult.PASS : InteractionResult.SUCCESS_SERVER; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
protected boolean handleEating(Player player, ItemStack stack) {
|
|
@@ -609,7 +607,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
|
f = 4.0F;
|
|
i = 60;
|
|
i1 = 5;
|
|
- if (!this.level().isClientSide && this.isTamed() && this.getAge() == 0 && !this.isInLove()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isTamed() && this.getAge() == 0 && !this.isInLove()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
flag = true;
|
|
this.setInLove(player, stack.copy()); // Paper - Fix EntityBreedEvent copying
|
|
}
|
|
@@ -617,7 +615,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
|
f = 10.0F;
|
|
i = 240;
|
|
i1 = 10;
|
|
- if (!this.level().isClientSide && this.isTamed() && this.getAge() == 0 && !this.isInLove()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isTamed() && this.getAge() == 0 && !this.isInLove()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
flag = true;
|
|
this.setInLove(player, stack.copy()); // Paper - Fix EntityBreedEvent copying
|
|
}
|
|
@@ -630,13 +628,13 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
|
|
|
if (this.isBaby() && i > 0) {
|
|
this.level().addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0), this.getRandomY() + 0.5, this.getRandomZ(1.0), 0.0, 0.0, 0.0);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.ageUp(i);
|
|
flag = true;
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
- if (i1 > 0 && (flag || !this.isTamed()) && this.getTemper() < this.getMaxTemper() && !this.level().isClientSide) {
|
|
+ if (i1 > 0 && (flag || !this.isTamed()) && this.getTemper() < this.getMaxTemper() /*&& !this.level().isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.modifyTemper(i1);
|
|
flag = true;
|
|
}
|
|
@@ -652,11 +650,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
|
protected void doPlayerRide(Player player) {
|
|
this.setEating(false);
|
|
this.setStanding(false);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
player.setYRot(this.getYRot());
|
|
player.setXRot(this.getXRot());
|
|
player.startRiding(this);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -835,10 +833,10 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
|
}
|
|
|
|
private void openMouth() {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.mouthCounter = 1;
|
|
this.setFlag(64, true);
|
|
- }
|
|
+ //}
|
|
}
|
|
|
|
public void setEating(boolean eating) {
|
|
diff --git a/net/minecraft/world/entity/animal/horse/Llama.java b/net/minecraft/world/entity/animal/horse/Llama.java
|
|
index c21d558a6a3a61d6c54b8163f8cb4963846b2c26..78309b1d7c0df01899e5aff1289671be5c727a91 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/Llama.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/Llama.java
|
|
@@ -272,18 +272,14 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
|
|
|
|
if (this.isBaby() && i > 0) {
|
|
this.level().addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0), this.getRandomY() + 0.5, this.getRandomZ(1.0), 0.0, 0.0, 0.0);
|
|
- if (!this.level().isClientSide) {
|
|
- this.ageUp(i);
|
|
- }
|
|
+ this.ageUp(i); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
flag = true;
|
|
}
|
|
|
|
if (i1 > 0 && (flag || !this.isTamed()) && this.getTemper() < this.getMaxTemper()) {
|
|
flag = true;
|
|
- if (!this.level().isClientSide) {
|
|
- this.modifyTemper(i1);
|
|
- }
|
|
+ this.modifyTemper(i1); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
if (flag && !this.isSilent()) {
|
|
diff --git a/net/minecraft/world/entity/animal/horse/TraderLlama.java b/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
|
index 8faeb84f1c48b6a713867a1b95fed6402654fabb..10817a127199635d9d7d342588b5e3d9ece83d63 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
|
@@ -139,9 +139,7 @@ public class TraderLlama extends Llama {
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- if (!this.level().isClientSide) {
|
|
- this.maybeDespawn();
|
|
- }
|
|
+ this.maybeDespawn(); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private void maybeDespawn() {
|
|
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
index 11a5da22149a61ca48bbb0a8ed10b71e91a5cc98..58ab17819e54c5ac209882f49e22a6af7494fc66 100644
|
|
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
@@ -323,12 +323,14 @@ public class Sniffer extends Animal {
|
|
this.level().addParticle(new BlockParticleOption(ParticleTypes.BLOCK, blockState), vec3.x, vec3.y, vec3.z, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.tickCount % 10 == 0) {
|
|
this.level()
|
|
.playLocalSound(
|
|
this.getX(), this.getY(), this.getZ(), blockState.getSoundType().getHitSound(), this.getSoundSource(), 0.5F, 0.5F, false
|
|
);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
|
|
@@ -387,7 +389,7 @@ public class Sniffer extends Animal {
|
|
public void tick() {
|
|
switch (this.getState()) {
|
|
case SEARCHING:
|
|
- this.playSearchingSound();
|
|
+ //this.playSearchingSound(); // Plazma - Remove isClientSide on DedicatedServer
|
|
break;
|
|
case DIGGING:
|
|
this.emitDiggingParticles(this.diggingAnimationState).dropSeed();
|
|
@@ -413,11 +415,13 @@ public class Sniffer extends Animal {
|
|
this.level().playSound(null, this, SoundEvents.SNIFFER_EAT, SoundSource.NEUTRAL, 1.0F, Mth.randomBetween(this.level().random, 0.8F, 1.2F));
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private void playSearchingSound() {
|
|
if (this.level().isClientSide() && this.tickCount % 20 == 0) {
|
|
this.level().playLocalSound(this.getX(), this.getY(), this.getZ(), SoundEvents.SNIFFER_SEARCHING, this.getSoundSource(), 1.0F, 1.0F, false);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void playStepSound(BlockPos pos, BlockState state) {
|
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
|
index b2a0ba6faa117ad781aaa3e6932482d4d9c8a789..2ba023bd7fede301fbe96e235fac73aecb46209f 100644
|
|
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
|
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
|
@@ -203,7 +203,7 @@ public class EnderDragon extends Mob implements Enemy {
|
|
|
|
@Override
|
|
public void onFlap() {
|
|
- if (this.level().isClientSide && !this.isSilent()) {
|
|
+ /*if (this.level().isClientSide && !this.isSilent()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level()
|
|
.playLocalSound(
|
|
this.getX(),
|
|
@@ -216,6 +216,7 @@ public class EnderDragon extends Mob implements Enemy {
|
|
false
|
|
);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -258,7 +259,7 @@ public class EnderDragon extends Mob implements Enemy {
|
|
// Purpur end - Ridables
|
|
|
|
this.processFlappingMovement();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setHealth(this.getHealth());
|
|
if (!this.isSilent() && !this.phaseManager.getCurrentPhase().isSitting() && --this.growlTime < 0) {
|
|
this.level()
|
|
@@ -275,6 +276,7 @@ public class EnderDragon extends Mob implements Enemy {
|
|
this.growlTime = 200 + this.random.nextInt(200);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.dragonFight == null && this.level() instanceof ServerLevel serverLevel) {
|
|
EndDragonFight dragonFight = serverLevel.getDragonFight();
|
|
@@ -365,12 +367,10 @@ public class EnderDragon extends Mob implements Enemy {
|
|
this.lerpSteps--;
|
|
}
|
|
|
|
- this.phaseManager.getCurrentPhase().doClientTick();
|
|
+ //this.phaseManager.getCurrentPhase().doClientTick(); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
- if (!this.level().isClientSide()) {
|
|
- this.applyEffectsFromBlocks();
|
|
- }
|
|
+ this.applyEffectsFromBlocks(); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.yBodyRot = this.getYRot();
|
|
Vec3[] vec3s = new Vec3[this.subEntities.length];
|
|
@@ -1041,9 +1041,10 @@ public class EnderDragon extends Mob implements Enemy {
|
|
|
|
@Override
|
|
public void onSyncedDataUpdated(EntityDataAccessor<?> key) {
|
|
- if (DATA_PHASE.equals(key) && this.level().isClientSide) {
|
|
+ /*if (DATA_PHASE.equals(key) && this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.phaseManager.setPhase(EnderDragonPhase.getById(this.getEntityData().get(DATA_PHASE)));
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.onSyncedDataUpdated(key);
|
|
}
|
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/phases/AbstractDragonPhaseInstance.java b/net/minecraft/world/entity/boss/enderdragon/phases/AbstractDragonPhaseInstance.java
|
|
index 7071554e60d290c6b96f473891e48768fcfa8391..22cc7950b86db13254d2afe6875195ca1ad49828 100644
|
|
--- a/net/minecraft/world/entity/boss/enderdragon/phases/AbstractDragonPhaseInstance.java
|
|
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/AbstractDragonPhaseInstance.java
|
|
@@ -21,9 +21,11 @@ public abstract class AbstractDragonPhaseInstance implements DragonPhaseInstance
|
|
return false;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void doClientTick() {
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void doServerTick(ServerLevel level) {
|
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/phases/DragonDeathPhase.java b/net/minecraft/world/entity/boss/enderdragon/phases/DragonDeathPhase.java
|
|
index 85e20366beb7c44c938aa1e9bc2a806ddfa173a0..a60fac78ea44e7f3d6dec1966c21c329dd4e2670 100644
|
|
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonDeathPhase.java
|
|
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonDeathPhase.java
|
|
@@ -18,6 +18,7 @@ public class DragonDeathPhase extends AbstractDragonPhaseInstance {
|
|
super(dragon);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void doClientTick() {
|
|
if (this.time++ % 10 == 0) {
|
|
@@ -29,6 +30,7 @@ public class DragonDeathPhase extends AbstractDragonPhaseInstance {
|
|
.addParticle(ParticleTypes.EXPLOSION_EMITTER, this.dragon.getX() + f, this.dragon.getY() + 2.0 + f1, this.dragon.getZ() + f2, 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void doServerTick(ServerLevel level) {
|
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/phases/DragonLandingPhase.java b/net/minecraft/world/entity/boss/enderdragon/phases/DragonLandingPhase.java
|
|
index 1ab3491a0be33ba9a0c2b4a09b766d94b106fbd5..00f2b117fb95899b287b45d5ad4beec8277cb79c 100644
|
|
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonLandingPhase.java
|
|
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonLandingPhase.java
|
|
@@ -17,6 +17,7 @@ public class DragonLandingPhase extends AbstractDragonPhaseInstance {
|
|
super(dragon);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void doClientTick() {
|
|
Vec3 vec3 = this.dragon.getHeadLookVector(1.0F).normalize();
|
|
@@ -45,6 +46,7 @@ public class DragonLandingPhase extends AbstractDragonPhaseInstance {
|
|
vec3.yRot((float) (Math.PI / 16));
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void doServerTick(ServerLevel level) {
|
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/phases/DragonPhaseInstance.java b/net/minecraft/world/entity/boss/enderdragon/phases/DragonPhaseInstance.java
|
|
index 93d2ca41c0bba01837436fd988ef3044dca4e80f..331e10a69bc39ad3217b146be7a5cd8b279b3708 100644
|
|
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonPhaseInstance.java
|
|
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonPhaseInstance.java
|
|
@@ -11,7 +11,7 @@ import net.minecraft.world.phys.Vec3;
|
|
public interface DragonPhaseInstance {
|
|
boolean isSitting();
|
|
|
|
- void doClientTick();
|
|
+ //void doClientTick(); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
void doServerTick(ServerLevel level);
|
|
|
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingAttackingPhase.java b/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingAttackingPhase.java
|
|
index 041428060b6ba1ff54a7cefc50199b9c427d6b5d..2e4d3cf71735bc02ae92d3ffe1d9fb060e4586d8 100644
|
|
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingAttackingPhase.java
|
|
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingAttackingPhase.java
|
|
@@ -12,6 +12,7 @@ public class DragonSittingAttackingPhase extends AbstractDragonSittingPhase {
|
|
super(dragon);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void doClientTick() {
|
|
this.dragon
|
|
@@ -27,6 +28,7 @@ public class DragonSittingAttackingPhase extends AbstractDragonSittingPhase {
|
|
false
|
|
);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void doServerTick(ServerLevel level) {
|
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java b/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java
|
|
index c55fcb4a2e641cfd11b9751861a646142da417a2..8c89e88e1df9b4c5b48e4356133307f5f5007f28 100644
|
|
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java
|
|
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonSittingFlamingPhase.java
|
|
@@ -24,6 +24,7 @@ public class DragonSittingFlamingPhase extends AbstractDragonSittingPhase {
|
|
super(dragon);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void doClientTick() {
|
|
this.flameTicks++;
|
|
@@ -47,6 +48,7 @@ public class DragonSittingFlamingPhase extends AbstractDragonSittingPhase {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void doServerTick(ServerLevel level) {
|
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhaseManager.java b/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhaseManager.java
|
|
index 720dbc5883cc7aaa336e5610209b8d693edb0ea6..effc1f28d872bab559b67d67d1ae0c47f264f309 100644
|
|
--- a/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhaseManager.java
|
|
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhaseManager.java
|
|
@@ -36,11 +36,9 @@ public class EnderDragonPhaseManager {
|
|
// CraftBukkit end
|
|
|
|
this.currentPhase = this.getPhase((EnderDragonPhase<DragonPhaseInstance>)phase);
|
|
- if (!this.dragon.level().isClientSide) {
|
|
- this.dragon.getEntityData().set(EnderDragon.DATA_PHASE, phase.getId());
|
|
- }
|
|
+ this.dragon.getEntityData().set(EnderDragon.DATA_PHASE, phase.getId()); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
- LOGGER.debug("Dragon is now in phase {} on the {}", phase, this.dragon.level().isClientSide ? "client" : "server");
|
|
+ LOGGER.debug("Dragon is now in phase {} on the server", phase); // Plazma - Remove isClientSide on DedicatedServer
|
|
this.currentPhase.begin();
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/entity/boss/wither/WitherBoss.java b/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
index 2d9f64cddbec782de1775ec6da67b16203e3fd90..97b3114ae9273c622f610d2fdb79a5808a17ee89 100644
|
|
--- a/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
+++ b/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
@@ -304,7 +304,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
|
@Override
|
|
public void aiStep() {
|
|
Vec3 vec3 = this.getDeltaMovement().multiply(1.0, 0.6, 1.0);
|
|
- if (!this.level().isClientSide && this.getAlternativeTarget(0) > 0) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.getAlternativeTarget(0) > 0) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Entity entity = this.level().getEntity(this.getAlternativeTarget(0));
|
|
if (entity != null) {
|
|
double d = vec3.y;
|
|
diff --git a/net/minecraft/world/entity/decoration/ArmorStand.java b/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
index 8c0ab32487c56e2caf42404184f86c9bcf5f8b41..dc573f61abb52d02526a477add5399ac11667965 100644
|
|
--- a/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
+++ b/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
@@ -333,8 +333,8 @@ public class ArmorStand extends LivingEntity {
|
|
return InteractionResult.PASS;
|
|
} else if (player.isSpectator()) {
|
|
return InteractionResult.SUCCESS;
|
|
- } else if (player.level().isClientSide) {
|
|
- return InteractionResult.SUCCESS_SERVER;
|
|
+ //} else if (player.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
+ // return InteractionResult.SUCCESS_SERVER; // Plazma - Remove isClientSide on DedicatedServer
|
|
} else {
|
|
EquipmentSlot equipmentSlotForItem = this.getEquipmentSlotForItem(itemInHand);
|
|
if (itemInHand.isEmpty()) {
|
|
@@ -507,6 +507,7 @@ public class ArmorStand extends LivingEntity {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer; Same as parent
|
|
@Override
|
|
public void handleEntityEvent(byte id) {
|
|
if (id == 32) {
|
|
@@ -518,6 +519,7 @@ public class ArmorStand extends LivingEntity {
|
|
super.handleEntityEvent(id);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer; Same as parent
|
|
|
|
@Override
|
|
public boolean shouldRenderAtSqrDistance(double distance) {
|
|
diff --git a/net/minecraft/world/entity/decoration/ItemFrame.java b/net/minecraft/world/entity/decoration/ItemFrame.java
|
|
index 3ee1d8798db666ee8d83556047e40ff217cda732..2d4c749aa4b00c915ad61851f86a6251caacf2b5 100644
|
|
--- a/net/minecraft/world/entity/decoration/ItemFrame.java
|
|
+++ b/net/minecraft/world/entity/decoration/ItemFrame.java
|
|
@@ -385,48 +385,46 @@ public class ItemFrame extends HangingEntity {
|
|
|
|
@Override
|
|
public InteractionResult interact(Player player, InteractionHand hand) {
|
|
- ItemStack itemInHand = player.getItemInHand(hand);
|
|
- boolean flag = !this.getItem().isEmpty();
|
|
- boolean flag1 = !itemInHand.isEmpty();
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
if (this.fixed) {
|
|
return InteractionResult.PASS;
|
|
- } else if (!player.level().isClientSide) {
|
|
- if (!flag) {
|
|
- if (flag1 && !this.isRemoved()) {
|
|
- MapItemSavedData savedData = MapItem.getSavedData(itemInHand, this.level());
|
|
- if (savedData != null && savedData.isTrackedCountOverLimit(256)) {
|
|
- return InteractionResult.FAIL;
|
|
- } else {
|
|
- // Paper start - Add PlayerItemFrameChangeEvent
|
|
- io.papermc.paper.event.player.PlayerItemFrameChangeEvent event = new io.papermc.paper.event.player.PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), itemInHand.asBukkitCopy(), io.papermc.paper.event.player.PlayerItemFrameChangeEvent.ItemFrameChangeAction.PLACE);
|
|
- if (!event.callEvent()) {
|
|
- return InteractionResult.FAIL;
|
|
- }
|
|
- this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()));
|
|
- // Paper end - Add PlayerItemFrameChangeEvent
|
|
- this.gameEvent(GameEvent.BLOCK_CHANGE, player);
|
|
- itemInHand.consume(1, player);
|
|
- return InteractionResult.SUCCESS;
|
|
- }
|
|
- } else {
|
|
- return InteractionResult.PASS;
|
|
- }
|
|
- } else {
|
|
- // Paper start - Add PlayerItemFrameChangeEvent
|
|
- io.papermc.paper.event.player.PlayerItemFrameChangeEvent event = new io.papermc.paper.event.player.PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), this.getItem().asBukkitCopy(), io.papermc.paper.event.player.PlayerItemFrameChangeEvent.ItemFrameChangeAction.ROTATE);
|
|
- if (!event.callEvent()) {
|
|
- return InteractionResult.FAIL;
|
|
- }
|
|
- setItem(ItemStack.fromBukkitCopy(event.getItemStack()), false, false);
|
|
- // Paper end - Add PlayerItemFrameChangeEvent
|
|
- this.playSound(this.getRotateItemSound(), 1.0F, 1.0F);
|
|
- this.setRotation(this.getRotation() + 1);
|
|
- this.gameEvent(GameEvent.BLOCK_CHANGE, player);
|
|
- return InteractionResult.SUCCESS;
|
|
+ }
|
|
+
|
|
+ if (!this.getItem().isEmpty()) {
|
|
+ // Paper start - Add PlayerItemFrameChangeEvent
|
|
+ io.papermc.paper.event.player.PlayerItemFrameChangeEvent event = new io.papermc.paper.event.player.PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), this.getItem().asBukkitCopy(), io.papermc.paper.event.player.PlayerItemFrameChangeEvent.ItemFrameChangeAction.ROTATE);
|
|
+ if (!event.callEvent()) {
|
|
+ return InteractionResult.FAIL;
|
|
}
|
|
- } else {
|
|
- return (InteractionResult)(!flag && !flag1 ? InteractionResult.PASS : InteractionResult.SUCCESS);
|
|
+ setItem(ItemStack.fromBukkitCopy(event.getItemStack()), false, false);
|
|
+ // Paper end - Add PlayerItemFrameChangeEvent
|
|
+ this.playSound(this.getRotateItemSound(), 1.0F, 1.0F);
|
|
+ this.setRotation(this.getRotation() + 1);
|
|
+ this.gameEvent(GameEvent.BLOCK_CHANGE, player);
|
|
+ return InteractionResult.SUCCESS;
|
|
+ }
|
|
+
|
|
+ final ItemStack itemInHand = player.getItemInHand(hand);
|
|
+ if (!itemInHand.isEmpty() && !this.isRemoved()) {
|
|
+ MapItemSavedData savedData = MapItem.getSavedData(itemInHand, this.level());
|
|
+ if (savedData != null && savedData.isTrackedCountOverLimit(256)) {
|
|
+ return InteractionResult.FAIL;
|
|
+ }
|
|
+
|
|
+ // Paper start - Add PlayerItemFrameChangeEvent
|
|
+ io.papermc.paper.event.player.PlayerItemFrameChangeEvent event = new io.papermc.paper.event.player.PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), itemInHand.asBukkitCopy(), io.papermc.paper.event.player.PlayerItemFrameChangeEvent.ItemFrameChangeAction.PLACE);
|
|
+ if (!event.callEvent()) {
|
|
+ return InteractionResult.FAIL;
|
|
+ }
|
|
+ this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()));
|
|
+ // Paper end - Add PlayerItemFrameChangeEvent
|
|
+ this.gameEvent(GameEvent.BLOCK_CHANGE, player);
|
|
+ itemInHand.consume(1, player);
|
|
+ return InteractionResult.SUCCESS;
|
|
}
|
|
+
|
|
+ return InteractionResult.PASS;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public SoundEvent getRotateItemSound() {
|
|
diff --git a/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java b/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
|
index 258696853e9f3539cb44c86343fbec81f6a3e770..e254b8a7bdfcecf026cf5e63d49912677afcfdd7 100644
|
|
--- a/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
|
+++ b/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
|
@@ -70,75 +70,73 @@ public class LeashFenceKnotEntity extends BlockAttachedEntity {
|
|
|
|
@Override
|
|
public InteractionResult interact(Player player, InteractionHand hand) {
|
|
- if (this.level().isClientSide) {
|
|
- return InteractionResult.SUCCESS;
|
|
- } else {
|
|
- boolean flag = false;
|
|
- List<Leashable> list = LeadItem.leashableInArea(this.level(), this.getPos(), leashable2 -> {
|
|
- Entity leashHolder = leashable2.getLeashHolder();
|
|
- return leashHolder == player || leashHolder == this;
|
|
- });
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ boolean flag = false;
|
|
+ List<Leashable> list = LeadItem.leashableInArea(this.level(), this.getPos(), leashable -> {
|
|
+ Entity leashHolder = leashable.getLeashHolder();
|
|
+ return leashHolder == player || leashHolder == this;
|
|
+ });
|
|
+
|
|
+ for (Leashable leashable : list) {
|
|
+ if (leashable.getLeashHolder() != player) {
|
|
+ continue;
|
|
+ }
|
|
|
|
- for (Leashable leashable : list) {
|
|
- if (leashable.getLeashHolder() == player) {
|
|
- // CraftBukkit start
|
|
- if (leashable instanceof Entity leashed) {
|
|
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerLeashEntityEvent(leashed, this, player, hand).isCancelled()) {
|
|
- ((net.minecraft.server.level.ServerPlayer) player).connection.send(new net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket(leashed, leashable.getLeashHolder()));
|
|
- flag = true; // Also set true when the event is cancelled otherwise it tries to unleash the entities
|
|
- continue;
|
|
- }
|
|
- }
|
|
- // CraftBukkit end
|
|
- leashable.setLeashedTo(this, true);
|
|
- flag = true;
|
|
+ // CraftBukkit start
|
|
+ if (leashable instanceof Entity leashed) {
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerLeashEntityEvent(leashed, this, player, hand).isCancelled()) {
|
|
+ ((net.minecraft.server.level.ServerPlayer) player).connection.send(new net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket(leashed, leashable.getLeashHolder()));
|
|
+ flag = true; // Also set true when the event is cancelled otherwise it tries to unleash the entities
|
|
+ continue;
|
|
}
|
|
}
|
|
+ // CraftBukkit end
|
|
+ leashable.setLeashedTo(this, true);
|
|
+ flag = true;
|
|
+ }
|
|
|
|
- boolean flag1 = false;
|
|
- if (!flag) {
|
|
- // CraftBukkit start - Move below
|
|
- // this.discard();
|
|
- boolean die = true;
|
|
- // CraftBukkit end
|
|
- if (true || player.getAbilities().instabuild) { // CraftBukkit - Process for non-creative as well
|
|
- for (Leashable leashable1 : list) {
|
|
- if (leashable1.isLeashed() && leashable1.getLeashHolder() == this) {
|
|
- // CraftBukkit start
|
|
- boolean dropLeash = !player.hasInfiniteMaterials();
|
|
- if (leashable1 instanceof Entity leashed) {
|
|
- // Paper start - Expand EntityUnleashEvent
|
|
- org.bukkit.event.player.PlayerUnleashEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerUnleashEntityEvent(leashed, player, hand, dropLeash);
|
|
- dropLeash = event.isDropLeash();
|
|
- if (event.isCancelled()) {
|
|
- // Paper end - Expand EntityUnleashEvent
|
|
- die = false;
|
|
- continue;
|
|
- }
|
|
- }
|
|
- if (!dropLeash) { // Paper - Expand EntityUnleashEvent
|
|
- leashable1.removeLeash();
|
|
- } else {
|
|
- leashable1.dropLeash();
|
|
- }
|
|
- // CraftBukkit end
|
|
- flag1 = true;
|
|
- }
|
|
- }
|
|
- // CraftBukkit start
|
|
- if (die) {
|
|
- this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DROP); // CraftBukkit - add Bukkit remove cause
|
|
+ boolean flag1 = false;
|
|
+ if (!flag) {
|
|
+ boolean die = true; // CraftBukkit - Move below
|
|
+ for (Leashable leashable : list) {
|
|
+ if (!leashable.isLeashed() || leashable.getLeashHolder() != this) {
|
|
+ continue;
|
|
+ }
|
|
+
|
|
+ // CraftBukkit start
|
|
+ boolean dropLeash = !player.hasInfiniteMaterials();
|
|
+ if (leashable instanceof Entity leashed) {
|
|
+ // Paper start - Expand EntityUnleashEvent
|
|
+ org.bukkit.event.player.PlayerUnleashEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerUnleashEntityEvent(leashed, player, hand, dropLeash);
|
|
+ dropLeash = event.isDropLeash();
|
|
+ if (event.isCancelled()) {
|
|
+ // Paper end - Expand EntityUnleashEvent
|
|
+ die = false;
|
|
+ continue;
|
|
}
|
|
- // CraftBukkit end
|
|
}
|
|
+ if (!dropLeash) { // Paper - Expand EntityUnleashEvent
|
|
+ leashable.removeLeash();
|
|
+ } else {
|
|
+ leashable.dropLeash();
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+ flag1 = true;
|
|
}
|
|
|
|
- if (flag || flag1) {
|
|
- this.gameEvent(GameEvent.BLOCK_ATTACH, player);
|
|
+ // CraftBukkit start
|
|
+ if (die) {
|
|
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DROP);
|
|
}
|
|
+ // CraftBukkit end
|
|
+ }
|
|
|
|
- return InteractionResult.SUCCESS;
|
|
+ if (flag || flag1) {
|
|
+ this.gameEvent(GameEvent.BLOCK_ATTACH, player);
|
|
}
|
|
+
|
|
+ return InteractionResult.SUCCESS;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
|
index 771b169fa360411bb313ae04c7dd55836875c611..ac4002f4771d2172fc3bbdc89b2c22e7cd23d28f 100644
|
|
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
|
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
|
@@ -141,7 +141,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
|
this.age++;
|
|
}
|
|
|
|
- if (!this.level().isClientSide && this.age >= this.despawnRate) {// Paper - Alternative item-despawn-rate
|
|
+ if (/*!this.level().isClientSide &&*/ this.age >= this.despawnRate) { // Paper - Alternative item-despawn-rate // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start - fire ItemDespawnEvent
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
|
|
this.age = 0;
|
|
@@ -175,14 +175,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
|
this.applyGravity();
|
|
}
|
|
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.noPhysics = false;
|
|
} else {
|
|
+ */
|
|
this.noPhysics = !this.level().noCollision(this, this.getBoundingBox().deflate(1.0E-7));
|
|
if (this.noPhysics) {
|
|
this.moveTowardsClosestSpace(this.getX(), (this.getBoundingBox().minY + this.getBoundingBox().maxY) / 2.0, this.getZ());
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (!this.onGround() || this.getDeltaMovement().horizontalDistanceSqr() > 1.0E-5F || (this.tickCount + this.getId()) % 4 == 0) { // Paper - Diff on change; ActivationRange immunity
|
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
|
@@ -209,7 +210,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
|
|| Mth.floor(this.yo) != Mth.floor(this.getY())
|
|
|| Mth.floor(this.zo) != Mth.floor(this.getZ());
|
|
int i = flag ? 2 : 40;
|
|
- if (this.tickCount % i == 0 && !this.level().isClientSide && this.isMergable()) {
|
|
+ if (this.tickCount % i == 0 /*&& !this.level().isClientSide*/ && this.isMergable()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.mergeWithNeighbours();
|
|
}
|
|
|
|
@@ -218,14 +219,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
|
}
|
|
|
|
this.hasImpulse = this.hasImpulse | this.updateInWaterStateAndDoFluidPushing();
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
double d = this.getDeltaMovement().subtract(deltaMovement).lengthSqr();
|
|
if (d > 0.01) {
|
|
this.hasImpulse = true;
|
|
}
|
|
- }
|
|
+ //}
|
|
+
|
|
+ if (/*!this.level().isClientSide &&*/ this.age >= this.despawnRate) { // Spigot // Paper - Alternative item-despawn-rate // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
- if (!this.level().isClientSide && this.age >= this.despawnRate) { // Spigot // Paper - Alternative item-despawn-rate
|
|
// CraftBukkit start - fire ItemDespawnEvent
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
|
|
this.age = 0;
|
|
@@ -445,84 +447,85 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
|
|
|
@Override
|
|
public void playerTouch(Player entity) {
|
|
- if (!this.level().isClientSide) {
|
|
- ItemStack item = this.getItem();
|
|
- Item item1 = item.getItem();
|
|
- int count = item.getCount();
|
|
- // CraftBukkit start - fire PlayerPickupItemEvent
|
|
- int canHold = entity.getInventory().canHold(item);
|
|
- int remaining = count - canHold;
|
|
- boolean flyAtPlayer = false; // Paper
|
|
-
|
|
- // Paper start - PlayerAttemptPickupItemEvent
|
|
- if (this.pickupDelay <= 0) {
|
|
- org.bukkit.event.player.PlayerAttemptPickupItemEvent attemptEvent = new org.bukkit.event.player.PlayerAttemptPickupItemEvent((org.bukkit.entity.Player) entity.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining);
|
|
- this.level().getCraftServer().getPluginManager().callEvent(attemptEvent);
|
|
-
|
|
- flyAtPlayer = attemptEvent.getFlyAtPlayer();
|
|
- if (attemptEvent.isCancelled()) {
|
|
- if (flyAtPlayer) {
|
|
- entity.take(this, count);
|
|
- }
|
|
-
|
|
- return;
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ ItemStack itemStack = this.getItem();
|
|
+ Item itemEntity = itemStack.getItem();
|
|
+ int count = itemStack.getCount();
|
|
+ // CraftBukkit start - fire PlayerPickupItemEvent
|
|
+ int canHold = entity.getInventory().canHold(itemStack);
|
|
+ int remains = count - canHold;
|
|
+ boolean flyAtPlayer = false; // Paper
|
|
+
|
|
+ // Paper start - PlayerAttemptPickupItemEvent
|
|
+ if (this.pickupDelay <= 0) {
|
|
+ org.bukkit.event.player.PlayerAttemptPickupItemEvent attemptEvent = new org.bukkit.event.player.PlayerAttemptPickupItemEvent((org.bukkit.entity.Player) entity.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remains);
|
|
+ this.level().getCraftServer().getPluginManager().callEvent(attemptEvent);
|
|
+
|
|
+ flyAtPlayer = attemptEvent.getFlyAtPlayer();
|
|
+ if (attemptEvent.isCancelled()) {
|
|
+ if (flyAtPlayer) {
|
|
+ entity.take(this, count);
|
|
}
|
|
- }
|
|
|
|
- if (this.pickupDelay <= 0 && canHold > 0) {
|
|
- item.setCount(canHold);
|
|
- // Call legacy event
|
|
- org.bukkit.event.player.PlayerPickupItemEvent playerEvent = new org.bukkit.event.player.PlayerPickupItemEvent((org.bukkit.entity.Player) entity.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining);
|
|
- playerEvent.setCancelled(!playerEvent.getPlayer().getCanPickupItems());
|
|
- this.level().getCraftServer().getPluginManager().callEvent(playerEvent);
|
|
- flyAtPlayer = playerEvent.getFlyAtPlayer(); // Paper
|
|
- if (playerEvent.isCancelled()) {
|
|
- item.setCount(count); // SPIGOT-5294 - restore count
|
|
- // Paper start
|
|
- if (flyAtPlayer) {
|
|
- entity.take(this, count);
|
|
- }
|
|
- // Paper end
|
|
- return;
|
|
- }
|
|
+ return;
|
|
+ }
|
|
+ }
|
|
|
|
- // Call newer event afterwards
|
|
- org.bukkit.event.entity.EntityPickupItemEvent entityEvent = new org.bukkit.event.entity.EntityPickupItemEvent(entity.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining);
|
|
- entityEvent.setCancelled(!entityEvent.getEntity().getCanPickupItems());
|
|
- this.level().getCraftServer().getPluginManager().callEvent(entityEvent);
|
|
- if (entityEvent.isCancelled()) {
|
|
- item.setCount(count); // SPIGOT-5294 - restore count
|
|
- return;
|
|
+ if (this.pickupDelay <= 0 && canHold > 0) {
|
|
+ itemStack.setCount(canHold);
|
|
+ // Call legacy event
|
|
+ org.bukkit.event.player.PlayerPickupItemEvent playerEvent = new org.bukkit.event.player.PlayerPickupItemEvent((org.bukkit.entity.Player) entity.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remains);
|
|
+ playerEvent.setCancelled(!playerEvent.getPlayer().getCanPickupItems());
|
|
+ this.level().getCraftServer().getPluginManager().callEvent(playerEvent);
|
|
+ flyAtPlayer = playerEvent.getFlyAtPlayer(); // Paper
|
|
+ if (playerEvent.isCancelled()) {
|
|
+ itemStack.setCount(count); // SPIGOT-5294 - restore count
|
|
+ // Paper start
|
|
+ if (flyAtPlayer) {
|
|
+ entity.take(this, count);
|
|
}
|
|
+ // Paper end
|
|
+ return;
|
|
+ }
|
|
|
|
- // Update the ItemStack if it was changed in the event
|
|
- ItemStack current = this.getItem();
|
|
- if (!item.equals(current)) {
|
|
- item = current;
|
|
- } else {
|
|
- item.setCount(canHold + remaining); // = i
|
|
- }
|
|
+ // Call newer event afterwards
|
|
+ org.bukkit.event.entity.EntityPickupItemEvent entityEvent = new org.bukkit.event.entity.EntityPickupItemEvent(entity.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remains);
|
|
+ entityEvent.setCancelled(!entityEvent.getEntity().getCanPickupItems());
|
|
+ this.level().getCraftServer().getPluginManager().callEvent(entityEvent);
|
|
+ if (entityEvent.isCancelled()) {
|
|
+ itemStack.setCount(count); // SPIGOT-5294 - restore count
|
|
+ return;
|
|
+ }
|
|
|
|
- // Possibly < 0; fix here so we do not have to modify code below
|
|
- this.pickupDelay = 0;
|
|
- } else if (this.pickupDelay == 0) {
|
|
- // ensure that the code below isn't triggered if canHold says we can't pick the items up
|
|
- this.pickupDelay = -1;
|
|
+ // Update the ItemStack if it was changed in the event
|
|
+ ItemStack current = this.getItem();
|
|
+ if (!itemStack.equals(current)) {
|
|
+ itemStack = current;
|
|
+ } else {
|
|
+ itemStack.setCount(canHold + remains); // = i
|
|
}
|
|
- // CraftBukkit end
|
|
- // Paper end - PlayerAttemptPickupItemEvent
|
|
- if (this.pickupDelay == 0 && (this.target == null || this.target.equals(entity.getUUID())) && entity.getInventory().add(item)) {
|
|
- if (flyAtPlayer) // Paper - PlayerPickupItemEvent
|
|
- entity.take(this, count);
|
|
- if (item.isEmpty()) {
|
|
- this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause
|
|
- item.setCount(count);
|
|
- }
|
|
|
|
- entity.awardStat(Stats.ITEM_PICKED_UP.get(item1), count);
|
|
- entity.onItemPickup(this);
|
|
+ // Possibly < 0; fix here so we do not have to modify code below
|
|
+ this.pickupDelay = 0;
|
|
+ } else if (this.pickupDelay == 0) {
|
|
+ // ensure that the code below isn't triggered if canHold says we can't pick the items up
|
|
+ this.pickupDelay = -1;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
+ // Paper end - PlayerAttemptPickupItemEvent
|
|
+ if (this.pickupDelay == 0 && (this.target == null || this.target.equals(entity.getUUID())) && entity.getInventory().add(itemStack)) {
|
|
+ if (flyAtPlayer) // Paper - PlayerPickupItemEvent
|
|
+ entity.take(this, count);
|
|
+ if (itemStack.isEmpty()) {
|
|
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause
|
|
+ itemStack.setCount(count);
|
|
}
|
|
+
|
|
+ entity.awardStat(Stats.ITEM_PICKED_UP.get(itemEntity), count);
|
|
+ entity.onItemPickup(this);
|
|
}
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -540,7 +543,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
|
@Override
|
|
public Entity teleport(TeleportTransition teleportTransition) {
|
|
Entity entity = super.teleport(teleportTransition);
|
|
- if (!this.level().isClientSide && entity instanceof ItemEntity itemEntity) {
|
|
+ if (/*!this.level().isClientSide &&*/ entity instanceof ItemEntity itemEntity) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
itemEntity.mergeWithNeighbours();
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
|
|
index 40f5534b425ef57c435b365f156d3b988b74f911..8b0325ea3ada24706b91ea9da80be72cb285348f 100644
|
|
--- a/net/minecraft/world/entity/item/PrimedTnt.java
|
|
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
|
|
@@ -118,17 +118,15 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
|
this.setFuse(i);
|
|
if (i <= 0) {
|
|
// CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event
|
|
- //this.discard();
|
|
- if (!this.level().isClientSide) {
|
|
- this.explode();
|
|
- }
|
|
+ this.explode(); // Plazma - Remove isClientSide on DedicatedServer
|
|
this.discard(EntityRemoveEvent.Cause.EXPLODE); // CraftBukkit - add Bukkit remove cause
|
|
// CraftBukkit end
|
|
} else {
|
|
this.updateInWaterStateAndDoFluidPushing();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level().addParticle(ParticleTypes.SMOKE, this.getX(), this.getY() + 0.5, this.getZ(), 0.0, 0.0, 0.0);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
// Paper start - Option to prevent TNT from moving in water
|
|
if (!this.isRemoved() && this.wasTouchingWater && this.level().paperConfig().fixes.preventTntFromMovingInWater) {
|
|
diff --git a/net/minecraft/world/entity/monster/AbstractSkeleton.java b/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
|
index 223739818e9ac6c9fe396b82bce53a3ab029610a..161df7620ae19144e35c33d2561472ccf469292c 100644
|
|
--- a/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
|
+++ b/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
|
@@ -151,22 +151,26 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
|
}
|
|
|
|
public void reassessWeaponGoal() {
|
|
- if (this.level() != null && !this.level().isClientSide) {
|
|
- this.goalSelector.removeGoal(this.meleeGoal);
|
|
- this.goalSelector.removeGoal(this.bowGoal);
|
|
- ItemStack itemInHand = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW));
|
|
- if (itemInHand.is(Items.BOW)) {
|
|
- int hardAttackInterval = this.getHardAttackInterval();
|
|
- if (this.level().getDifficulty() != Difficulty.HARD) {
|
|
- hardAttackInterval = this.getAttackInterval();
|
|
- }
|
|
-
|
|
- this.bowGoal.setMinAttackInterval(hardAttackInterval);
|
|
- this.goalSelector.addGoal(4, this.bowGoal);
|
|
- } else {
|
|
- this.goalSelector.addGoal(4, this.meleeGoal);
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (this.level() == null) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ this.goalSelector.removeGoal(this.meleeGoal);
|
|
+ this.goalSelector.removeGoal(this.bowGoal);
|
|
+ ItemStack itemInHand = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW));
|
|
+ if (itemInHand.is(Items.BOW)) {
|
|
+ int hardAttackInterval = this.getHardAttackInterval();
|
|
+ if (this.level().getDifficulty() != Difficulty.HARD) {
|
|
+ hardAttackInterval = this.getAttackInterval();
|
|
}
|
|
+
|
|
+ this.bowGoal.setMinAttackInterval(hardAttackInterval);
|
|
+ this.goalSelector.addGoal(4, this.bowGoal);
|
|
+ } else {
|
|
+ this.goalSelector.addGoal(4, this.meleeGoal);
|
|
}
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
protected int getHardAttackInterval() {
|
|
@@ -240,9 +244,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
|
@Override
|
|
public void setItemSlot(EquipmentSlot slot, ItemStack stack, boolean silent) { // Paper - Fix silent equipment change
|
|
super.setItemSlot(slot, stack, silent); // Paper - Fix silent equipment change
|
|
- if (!this.level().isClientSide) {
|
|
- this.reassessWeaponGoal();
|
|
- }
|
|
+ this.reassessWeaponGoal(); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public boolean isShaking() {
|
|
diff --git a/net/minecraft/world/entity/monster/Blaze.java b/net/minecraft/world/entity/monster/Blaze.java
|
|
index 79f5f0dbf95ed72dd031495c75675d7b6c7dfc34..b6833e0f3334c2c17679f88862e2f8ea039570c6 100644
|
|
--- a/net/minecraft/world/entity/monster/Blaze.java
|
|
+++ b/net/minecraft/world/entity/monster/Blaze.java
|
|
@@ -139,7 +139,7 @@ public class Blaze extends Monster {
|
|
this.setDeltaMovement(this.getDeltaMovement().multiply(1.0, 0.6, 1.0));
|
|
}
|
|
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.random.nextInt(24) == 0 && !this.isSilent()) {
|
|
this.level()
|
|
.playLocalSound(
|
|
@@ -158,6 +158,7 @@ public class Blaze extends Monster {
|
|
this.level().addParticle(ParticleTypes.LARGE_SMOKE, this.getRandomX(0.5), this.getRandomY(), this.getRandomZ(0.5), 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.aiStep();
|
|
}
|
|
diff --git a/net/minecraft/world/entity/monster/Creeper.java b/net/minecraft/world/entity/monster/Creeper.java
|
|
index a85b64799faa860367cded67a264b436cd46f049..ec71ceb0be8eaa98070298537581b9dbb68e5ef1 100644
|
|
--- a/net/minecraft/world/entity/monster/Creeper.java
|
|
+++ b/net/minecraft/world/entity/monster/Creeper.java
|
|
@@ -346,7 +346,7 @@ public class Creeper extends Monster {
|
|
SoundEvent soundEvent = itemInHand.is(Items.FIRE_CHARGE) ? SoundEvents.FIRECHARGE_USE : SoundEvents.FLINTANDSTEEL_USE;
|
|
this.level()
|
|
.playSound(player, this.getX(), this.getY(), this.getZ(), soundEvent, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.entityIgniter = player; // CraftBukkit
|
|
this.ignite();
|
|
if (itemInHand.getMaxDamage() == 0) { // CraftBukkit - fix MC-264285: unbreakable flint and steels are completely consumed when igniting a creeper
|
|
@@ -354,7 +354,7 @@ public class Creeper extends Monster {
|
|
} else {
|
|
itemInHand.hurtAndBreak(1, player, getSlotForHand(hand));
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/entity/monster/Drowned.java b/net/minecraft/world/entity/monster/Drowned.java
|
|
index 6c73245b8d04f194e72165aa0000ca79a95db59d..dd94aad3d7f6489c9bdf25106904f9f64490279f 100644
|
|
--- a/net/minecraft/world/entity/monster/Drowned.java
|
|
+++ b/net/minecraft/world/entity/monster/Drowned.java
|
|
@@ -295,7 +295,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
|
|
|
@Override
|
|
public void updateSwimming() {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.isEffectiveAi() && this.isUnderWater() && this.wantsToSwim()) {
|
|
this.navigation = this.waterNavigation;
|
|
this.setSwimming(true);
|
|
@@ -303,7 +303,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
|
this.navigation = this.groundNavigation;
|
|
this.setSwimming(false);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
|
|
index 78b1619afa2062638fbfe21b9978f634be1aaf62..e0fafc539905ae57771aad5e4716f9ea349a7fcc 100644
|
|
--- a/net/minecraft/world/entity/monster/EnderMan.java
|
|
+++ b/net/minecraft/world/entity/monster/EnderMan.java
|
|
@@ -78,7 +78,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
);
|
|
private static final EntityDataAccessor<Boolean> DATA_CREEPY = SynchedEntityData.defineId(EnderMan.class, EntityDataSerializers.BOOLEAN);
|
|
private static final EntityDataAccessor<Boolean> DATA_STARED_AT = SynchedEntityData.defineId(EnderMan.class, EntityDataSerializers.BOOLEAN);
|
|
- private int lastStareSound = Integer.MIN_VALUE;
|
|
+ //private int lastStareSound = Integer.MIN_VALUE; // Plazma - Remove isClientSide on DedicatedServer
|
|
private int targetChangeTime;
|
|
private static final UniformInt PERSISTENT_ANGER_TIME = TimeUtil.rangeOfSeconds(20, 39);
|
|
private int remainingPersistentAngerTime;
|
|
@@ -218,6 +218,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
return this.persistentAngerTarget;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public void playStareSound() {
|
|
if (this.tickCount >= this.lastStareSound + 400) {
|
|
this.lastStareSound = this.tickCount;
|
|
@@ -226,12 +227,14 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void onSyncedDataUpdated(EntityDataAccessor<?> key) {
|
|
- if (DATA_CREEPY.equals(key) && this.hasBeenStaredAt() && this.level().isClientSide) {
|
|
+ /*if (DATA_CREEPY.equals(key) && this.hasBeenStaredAt() && this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.playStareSound();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.onSyncedDataUpdated(key);
|
|
}
|
|
@@ -276,7 +279,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
|
|
@Override
|
|
public void aiStep() {
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
for (int i = 0; i < 2; i++) {
|
|
this.level()
|
|
.addParticle(
|
|
@@ -290,11 +293,10 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.jumping = false;
|
|
- if (!this.level().isClientSide) {
|
|
- this.updatePersistentAnger((ServerLevel)this.level(), true);
|
|
- }
|
|
+ this.updatePersistentAnger((ServerLevel) this.level(), true); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.aiStep();
|
|
}
|
|
@@ -320,7 +322,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
}
|
|
|
|
public boolean teleport() {
|
|
- if (!this.level().isClientSide() && this.isAlive()) {
|
|
+ if (/*!this.level().isClientSide() &&*/ this.isAlive()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
double d = this.getX() + (this.random.nextDouble() - 0.5) * 64.0;
|
|
double d1 = this.getY() + (this.random.nextInt(64) - 32);
|
|
double d2 = this.getZ() + (this.random.nextDouble() - 0.5) * 64.0;
|
|
diff --git a/net/minecraft/world/entity/monster/Endermite.java b/net/minecraft/world/entity/monster/Endermite.java
|
|
index 441f7d3cfa1e9896a065dae51d871901ac4330e3..fa393790f0bde1e262ddaacb8189a76cc82961eb 100644
|
|
--- a/net/minecraft/world/entity/monster/Endermite.java
|
|
+++ b/net/minecraft/world/entity/monster/Endermite.java
|
|
@@ -156,7 +156,7 @@ public class Endermite extends Monster {
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
for (int i = 0; i < 2; i++) {
|
|
this.level()
|
|
.addParticle(
|
|
@@ -170,6 +170,7 @@ public class Endermite extends Monster {
|
|
);
|
|
}
|
|
} else {
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
if (!this.isPersistenceRequired()) {
|
|
this.life++;
|
|
}
|
|
@@ -177,7 +178,7 @@ public class Endermite extends Monster {
|
|
if (this.life >= 2400) {
|
|
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public static boolean checkEndermiteSpawnRules(
|
|
diff --git a/net/minecraft/world/entity/monster/Guardian.java b/net/minecraft/world/entity/monster/Guardian.java
|
|
index 60278b2491f644b70ef96b2e14e1f07bb341a0f1..19711de5930f89a382d0cb255321b4b65a7a6a00 100644
|
|
--- a/net/minecraft/world/entity/monster/Guardian.java
|
|
+++ b/net/minecraft/world/entity/monster/Guardian.java
|
|
@@ -169,7 +169,7 @@ public class Guardian extends Monster {
|
|
public LivingEntity getActiveAttackTarget() {
|
|
if (!this.hasActiveAttackTarget()) {
|
|
return null;
|
|
- } else if (this.level().isClientSide) {
|
|
+ /*} else if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.clientSideCachedAttackTarget != null) {
|
|
return this.clientSideCachedAttackTarget;
|
|
} else {
|
|
@@ -181,6 +181,7 @@ public class Guardian extends Monster {
|
|
return null;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
} else {
|
|
return this.getTarget();
|
|
}
|
|
@@ -228,7 +229,7 @@ public class Guardian extends Monster {
|
|
@Override
|
|
public void aiStep() {
|
|
if (this.isAlive()) {
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.clientSideTailAnimationO = this.clientSideTailAnimation;
|
|
if (!this.isInWater()) {
|
|
this.clientSideTailAnimationSpeed = 2.0F;
|
|
@@ -310,6 +311,7 @@ public class Guardian extends Monster {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.isInWaterOrBubble()) {
|
|
this.setAirSupply(300);
|
|
diff --git a/net/minecraft/world/entity/monster/Illusioner.java b/net/minecraft/world/entity/monster/Illusioner.java
|
|
index 9686658b90e886d6236f553d7406771814d18672..4d152a658685c5932d8a71a9bc7ea5ff5bb9911e 100644
|
|
--- a/net/minecraft/world/entity/monster/Illusioner.java
|
|
+++ b/net/minecraft/world/entity/monster/Illusioner.java
|
|
@@ -133,7 +133,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- if (this.level().isClientSide && this.isInvisible()) {
|
|
+ /*if (this.level().isClientSide && this.isInvisible()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.clientSideIllusionTicks--;
|
|
if (this.clientSideIllusionTicks < 0) {
|
|
this.clientSideIllusionTicks = 0;
|
|
@@ -166,6 +166,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
|
index 3c105d164acd9e45de2335ef28ddecf3fa48d267..4d9df6b535a4d8e18c39a5cee89edbabbc31787e 100644
|
|
--- a/net/minecraft/world/entity/monster/Phantom.java
|
|
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
|
@@ -251,7 +251,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
float cos = Mth.cos((this.getUniqueFlapTickOffset() + this.tickCount) * 7.448451F * (float) (Math.PI / 180.0) + (float) Math.PI);
|
|
float cos1 = Mth.cos((this.getUniqueFlapTickOffset() + this.tickCount + 1) * 7.448451F * (float) (Math.PI / 180.0) + (float) Math.PI);
|
|
if (cos > 0.0F && cos1 <= 0.0F) {
|
|
@@ -275,6 +275,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
|
this.level().addParticle(ParticleTypes.MYCELIUM, this.getX() + f1, this.getY() + f3, this.getZ() + f2, 0.0, 0.0, 0.0);
|
|
this.level().addParticle(ParticleTypes.MYCELIUM, this.getX() - f1, this.getY() + f3, this.getZ() - f2, 0.0, 0.0, 0.0);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/monster/Shulker.java b/net/minecraft/world/entity/monster/Shulker.java
|
|
index a006300aea2cbb05400550f1c79e872d095384f8..96dab8d04133355b0ead526aa99a73c5783eedb7 100644
|
|
--- a/net/minecraft/world/entity/monster/Shulker.java
|
|
+++ b/net/minecraft/world/entity/monster/Shulker.java
|
|
@@ -78,9 +78,9 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
public static final float MAX_SCALE = 3.0F;
|
|
private float currentPeekAmountO;
|
|
private float currentPeekAmount;
|
|
- @Nullable
|
|
- private BlockPos clientOldAttachPosition;
|
|
- private int clientSideTeleportInterpolation;
|
|
+ //@Nullable // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private BlockPos clientOldAttachPosition; // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private int clientSideTeleportInterpolation; // Plazma - Remove isClientSide on DedicatedServer
|
|
private static final float MAX_LID_OPEN = 1.0F;
|
|
|
|
public Shulker(EntityType<? extends Shulker> entityType, Level level) {
|
|
@@ -226,7 +226,7 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (!this.level().isClientSide && !this.isPassenger() && !this.canStayAt(this.blockPosition(), this.getAttachFace())) {
|
|
+ if (/*!this.level().isClientSide &&*/ !this.isPassenger() && !this.canStayAt(this.blockPosition(), this.getAttachFace())) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.findNewAttachment();
|
|
}
|
|
|
|
@@ -234,13 +234,14 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
this.onPeekAmountChange();
|
|
}
|
|
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.clientSideTeleportInterpolation > 0) {
|
|
this.clientSideTeleportInterpolation--;
|
|
} else {
|
|
this.clientOldAttachPosition = null;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private void findNewAttachment() {
|
|
@@ -320,10 +321,11 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
|
|
@Override
|
|
public boolean startRiding(Entity entity, boolean force) {
|
|
- if (this.level().isClientSide()) {
|
|
+ /*if (this.level().isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.clientOldAttachPosition = null;
|
|
this.clientSideTeleportInterpolation = 0;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.setAttachFace(Direction.DOWN);
|
|
return super.startRiding(entity, force);
|
|
@@ -338,9 +340,10 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
public void stopRiding(boolean suppressCancellation) {
|
|
super.stopRiding(suppressCancellation);
|
|
// Paper end - Force entity dismount during teleportation
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.clientOldAttachPosition = this.blockPosition();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.yBodyRotO = 0.0F;
|
|
this.yBodyRot = 0.0F;
|
|
@@ -389,13 +392,14 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
if (!blockPos1.equals(blockPos)) {
|
|
this.entityData.set(DATA_PEEK_ID, (byte)0);
|
|
this.hasImpulse = true;
|
|
- if (this.level().isClientSide && !this.isPassenger() && !blockPos1.equals(this.clientOldAttachPosition)) {
|
|
+ /*if (this.level().isClientSide && !this.isPassenger() && !blockPos1.equals(this.clientOldAttachPosition)) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.clientOldAttachPosition = blockPos;
|
|
this.clientSideTeleportInterpolation = 6;
|
|
this.xOld = this.getX();
|
|
this.yOld = this.getY();
|
|
this.zOld = this.getZ();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
}
|
|
@@ -572,7 +576,7 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
}
|
|
|
|
public void setRawPeekAmount(int peekAmount) {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.getAttribute(Attributes.ARMOR).removeModifier(COVERED_ARMOR_MODIFIER_ID);
|
|
if (peekAmount == 0) {
|
|
this.getAttribute(Attributes.ARMOR).addPermanentModifier(COVERED_ARMOR_MODIFIER);
|
|
@@ -582,14 +586,16 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
this.playSound(SoundEvents.SHULKER_OPEN, 1.0F, 1.0F);
|
|
this.gameEvent(GameEvent.CONTAINER_OPEN);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.entityData.set(DATA_PEEK_ID, (byte)peekAmount);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public float getClientPeekAmount(float partialTick) {
|
|
return Mth.lerp(partialTick, this.currentPeekAmountO, this.currentPeekAmount);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void recreateFromPacket(ClientboundAddEntityPacket packet) {
|
|
@@ -612,6 +618,7 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
public void push(Entity entity) {
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Nullable
|
|
public Vec3 getRenderPosition(float partialTick) {
|
|
if (this.clientOldAttachPosition != null && this.clientSideTeleportInterpolation > 0) {
|
|
@@ -627,6 +634,7 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
|
return null;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected float sanitizeScale(float scale) {
|
|
diff --git a/net/minecraft/world/entity/monster/Skeleton.java b/net/minecraft/world/entity/monster/Skeleton.java
|
|
index 7018471a465724e4a1d67fe18bb602176cddd522..b018a72a1793fb1357832a2e5d38c71d131b6938 100644
|
|
--- a/net/minecraft/world/entity/monster/Skeleton.java
|
|
+++ b/net/minecraft/world/entity/monster/Skeleton.java
|
|
@@ -84,7 +84,7 @@ public class Skeleton extends AbstractSkeleton {
|
|
|
|
@Override
|
|
public void tick() {
|
|
- if (!this.level().isClientSide && this.isAlive() && !this.isNoAi()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isAlive() && !this.isNoAi()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.isInPowderSnow) {
|
|
if (this.isFreezeConverting()) {
|
|
this.conversionTime--;
|
|
diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java
|
|
index 240a54b210e23d5b79e6bcaf3806aa454668135d..cdaa3c0d2388581edc83dd68d3d20bdb1095f393 100644
|
|
--- a/net/minecraft/world/entity/monster/Slime.java
|
|
+++ b/net/minecraft/world/entity/monster/Slime.java
|
|
@@ -296,7 +296,7 @@ public class Slime extends Mob implements Enemy {
|
|
public void remove(Entity.RemovalReason reason, org.bukkit.event.entity.EntityRemoveEvent.Cause eventCause) {
|
|
// CraftBukkit end
|
|
int size = this.getSize();
|
|
- if (!this.level().isClientSide && size > 1 && this.isDeadOrDying()) {
|
|
+ if (/*!this.level().isClientSide &&*/ size > 1 && this.isDeadOrDying()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
float width = this.getDimensions(this.getPose()).width();
|
|
float f = width / 2.0F;
|
|
int i = size / 2;
|
|
diff --git a/net/minecraft/world/entity/monster/SpellcasterIllager.java b/net/minecraft/world/entity/monster/SpellcasterIllager.java
|
|
index 44fdd3fc23ca820e45329ade655756bce0296cce..eab773f8934cdf1a3f16bae27fc0f35b17f8c78a 100644
|
|
--- a/net/minecraft/world/entity/monster/SpellcasterIllager.java
|
|
+++ b/net/minecraft/world/entity/monster/SpellcasterIllager.java
|
|
@@ -55,7 +55,7 @@ public abstract class SpellcasterIllager extends AbstractIllager {
|
|
}
|
|
|
|
public boolean isCastingSpell() {
|
|
- return this.level().isClientSide ? this.entityData.get(DATA_SPELL_CASTING_ID) > 0 : this.spellCastingTickCount > 0;
|
|
+ return this.spellCastingTickCount > 0; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public void setIsCastingSpell(SpellcasterIllager.IllagerSpell currentSpell) {
|
|
@@ -64,7 +64,7 @@ public abstract class SpellcasterIllager extends AbstractIllager {
|
|
}
|
|
|
|
public SpellcasterIllager.IllagerSpell getCurrentSpell() {
|
|
- return !this.level().isClientSide ? this.currentSpell : SpellcasterIllager.IllagerSpell.byId(this.entityData.get(DATA_SPELL_CASTING_ID));
|
|
+ return this.currentSpell; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -78,7 +78,7 @@ public abstract class SpellcasterIllager extends AbstractIllager {
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (this.level().isClientSide && this.isCastingSpell()) {
|
|
+ /*if (this.level().isClientSide && this.isCastingSpell()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
SpellcasterIllager.IllagerSpell currentSpell = this.getCurrentSpell();
|
|
float f = (float)currentSpell.spellColor[0];
|
|
float f1 = (float)currentSpell.spellColor[1];
|
|
@@ -109,6 +109,7 @@ public abstract class SpellcasterIllager extends AbstractIllager {
|
|
0.0
|
|
);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
protected int getSpellCastingTime() {
|
|
diff --git a/net/minecraft/world/entity/monster/Spider.java b/net/minecraft/world/entity/monster/Spider.java
|
|
index ece8d81e29709a1c0cb5c7b55b1193b630ecb113..9a0704c0cbb65d74bbbf0945e0391fdf90a749ea 100644
|
|
--- a/net/minecraft/world/entity/monster/Spider.java
|
|
+++ b/net/minecraft/world/entity/monster/Spider.java
|
|
@@ -119,9 +119,9 @@ public class Spider extends Monster {
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setClimbing(this.horizontalCollision && (this.level().paperConfig().entities.behavior.allowSpiderWorldBorderClimbing || !(io.papermc.paper.FeatureHooks.isSpiderCollidingWithWorldBorder(this) && this.level().getWorldBorder().isInsideCloseToBorder(this, this.getBoundingBox())))); // Paper - Add config option for spider worldborder climbing (Inflate by +EPSILON as collision will just barely place us outside border)
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public static AttributeSupplier.Builder createAttributes() {
|
|
diff --git a/net/minecraft/world/entity/monster/Strider.java b/net/minecraft/world/entity/monster/Strider.java
|
|
index 241526239bdbd5d9276f85e7fca46a7051f46a25..c21d482887976700471a4d303cc0efdcba2df2b5 100644
|
|
--- a/net/minecraft/world/entity/monster/Strider.java
|
|
+++ b/net/minecraft/world/entity/monster/Strider.java
|
|
@@ -147,9 +147,10 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
|
|
|
@Override
|
|
public void onSyncedDataUpdated(EntityDataAccessor<?> key) {
|
|
- if (DATA_BOOST_TIME.equals(key) && this.level().isClientSide) {
|
|
+ /*if (DATA_BOOST_TIME.equals(key) && this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.steering.onSynced();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.onSyncedDataUpdated(key);
|
|
}
|
|
@@ -468,9 +469,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
|
// Purpur end
|
|
|
|
if (!isFood && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) {
|
|
- if (!this.level().isClientSide) {
|
|
- player.startRiding(this);
|
|
- }
|
|
+ player.startRiding(this); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/entity/monster/Witch.java b/net/minecraft/world/entity/monster/Witch.java
|
|
index e4353c64732067198f082cdd266c1f1ee1fe4f4e..b3fdce396c07f0fb97bb13317255808938e1706e 100644
|
|
--- a/net/minecraft/world/entity/monster/Witch.java
|
|
+++ b/net/minecraft/world/entity/monster/Witch.java
|
|
@@ -149,7 +149,7 @@ public class Witch extends Raider implements RangedAttackMob {
|
|
|
|
@Override
|
|
public void aiStep() {
|
|
- if (!this.level().isClientSide && this.isAlive()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isAlive()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.healRaidersGoal.decrementCooldown();
|
|
if (this.healRaidersGoal.getCooldown() <= 0) {
|
|
this.attackPlayersGoal.setCanAttack(true);
|
|
diff --git a/net/minecraft/world/entity/monster/Zoglin.java b/net/minecraft/world/entity/monster/Zoglin.java
|
|
index d2a67f3e1c971f737e58567dae23fa70e9d942ea..67a6b23ee305cec3e373f543daa72d67508b21e4 100644
|
|
--- a/net/minecraft/world/entity/monster/Zoglin.java
|
|
+++ b/net/minecraft/world/entity/monster/Zoglin.java
|
|
@@ -298,7 +298,7 @@ public class Zoglin extends Monster implements HoglinBase {
|
|
@Override
|
|
public void setBaby(boolean childZombie) {
|
|
this.getEntityData().set(DATA_BABY_ID, childZombie);
|
|
- if (!this.level().isClientSide && childZombie) {
|
|
+ if (/*!this.level().isClientSide &&*/ childZombie) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(0.5);
|
|
}
|
|
}
|
|
@@ -334,11 +334,7 @@ public class Zoglin extends Monster implements HoglinBase {
|
|
|
|
@Override
|
|
protected SoundEvent getAmbientSound() {
|
|
- if (this.level().isClientSide) {
|
|
- return null;
|
|
- } else {
|
|
- return this.brain.hasMemoryValue(MemoryModuleType.ATTACK_TARGET) ? SoundEvents.ZOGLIN_ANGRY : SoundEvents.ZOGLIN_AMBIENT;
|
|
- }
|
|
+ return this.brain.hasMemoryValue(MemoryModuleType.ATTACK_TARGET) ? SoundEvents.ZOGLIN_ANGRY : SoundEvents.ZOGLIN_AMBIENT; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java
|
|
index 7af71c777dca26cd94b1807a2a77ea0d30e92976..3b63e76b1b459e9f237b0a19d013ac6061b3ca0b 100644
|
|
--- a/net/minecraft/world/entity/monster/Zombie.java
|
|
+++ b/net/minecraft/world/entity/monster/Zombie.java
|
|
@@ -251,7 +251,7 @@ public class Zombie extends Monster {
|
|
@Override
|
|
public void setBaby(boolean childZombie) {
|
|
this.getEntityData().set(DATA_BABY_ID, childZombie);
|
|
- if (this.level() != null && !this.level().isClientSide) {
|
|
+ if (this.level() != null /*&& !this.level().isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
AttributeInstance attribute = this.getAttribute(Attributes.MOVEMENT_SPEED);
|
|
attribute.removeModifier(this.babyModifier.id()); // Paper - Make baby speed configurable
|
|
if (childZombie) {
|
|
@@ -275,7 +275,7 @@ public class Zombie extends Monster {
|
|
|
|
@Override
|
|
public void tick() {
|
|
- if (!this.level().isClientSide && this.isAlive() && !this.isNoAi()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isAlive() && !this.isNoAi()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.isUnderWaterConverting()) {
|
|
this.conversionTime--;
|
|
if (this.conversionTime < 0) {
|
|
diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java
|
|
index 1ca0514732916d325c4a76d73120aaf613c3f780..9e63fce67882419cd5587cedd44c2c6596c5f1f8 100644
|
|
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
|
|
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
|
|
@@ -200,7 +200,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
|
|
|
@Override
|
|
public void tick() {
|
|
- if (!this.level().isClientSide && this.isAlive() && this.isConverting()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isAlive() && this.isConverting()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
int conversionProgress = this.getConversionProgress();
|
|
this.villagerConversionTime -= conversionProgress;
|
|
if (this.villagerConversionTime <= 0) {
|
|
@@ -218,9 +218,9 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
|
if (itemInHand.is(Items.GOLDEN_APPLE)) {
|
|
if (this.hasEffect(MobEffects.WEAKNESS) && level().purpurConfig.zombieVillagerCureEnabled) { // Purpur - Add option to disable zombie villagers cure
|
|
itemInHand.consume(1, player);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.startConverting(player.getUUID(), this.random.nextInt(level().purpurConfig.zombieVillagerCuringTimeMax - level().purpurConfig.zombieVillagerCuringTimeMin + 1) + level().purpurConfig.zombieVillagerCuringTimeMin); // Purpur - Customizable Zombie Villager curing times
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS_SERVER;
|
|
} else {
|
|
@@ -262,6 +262,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
|
if (broadcastEntityEvent) this.level().broadcastEntityEvent(this, (byte)16); // Paper - missing entity behaviour api - converting without entity event
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void handleEntityEvent(byte id) {
|
|
if (id == 16) {
|
|
@@ -282,6 +283,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
|
super.handleEntityEvent(id);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
private void finishConversion(ServerLevel serverLevel) {
|
|
Villager converted = this.convertTo( // CraftBukkit
|
|
diff --git a/net/minecraft/world/entity/monster/breeze/Breeze.java b/net/minecraft/world/entity/monster/breeze/Breeze.java
|
|
index 23dff1d01387ce89b020aa93de99e6ef557c04e3..ec93f1f402aa66134f658fc542fd0d309f70739b 100644
|
|
--- a/net/minecraft/world/entity/monster/breeze/Breeze.java
|
|
+++ b/net/minecraft/world/entity/monster/breeze/Breeze.java
|
|
@@ -89,6 +89,7 @@ public class Breeze extends Monster {
|
|
|
|
@Override
|
|
public void onSyncedDataUpdated(EntityDataAccessor<?> key) {
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.level().isClientSide() && DATA_POSE.equals(key)) {
|
|
this.resetAnimations();
|
|
Pose pose = this.getPose();
|
|
@@ -103,16 +104,19 @@ public class Breeze extends Monster {
|
|
this.slide.startIfStopped(this.tickCount);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.onSyncedDataUpdated(key);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private void resetAnimations() {
|
|
this.shoot.stop();
|
|
this.idle.stop();
|
|
this.inhale.stop();
|
|
this.longJump.stop();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void tick() {
|
|
@@ -138,9 +142,11 @@ public class Breeze extends Monster {
|
|
}
|
|
|
|
this.soundTick = this.soundTick == 0 ? this.random.nextIntBetweenInclusive(1, 80) : this.soundTick - 1;
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.soundTick == 0) {
|
|
this.playWhirlSound();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.tick();
|
|
}
|
|
@@ -175,6 +181,7 @@ public class Breeze extends Monster {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void playAmbientSound() {
|
|
if (this.getTarget() == null || !this.onGround()) {
|
|
@@ -187,6 +194,7 @@ public class Breeze extends Monster {
|
|
float f1 = 0.8F + 0.2F * this.random.nextFloat();
|
|
this.level().playLocalSound(this, SoundEvents.BREEZE_WHIRL, this.getSoundSource(), f1, f);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public ProjectileDeflection deflection(Projectile projectile) {
|
|
diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java
|
|
index d39d95cc8ba82cf5d7bebcda6497aa42018cb19d..9975699ea5f79200b324b04d500551fcebd07a8d 100644
|
|
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
|
|
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
|
|
@@ -71,12 +71,12 @@ public class Creaking extends Monster {
|
|
public static final int TWITCH_DEATH_DURATION = 45;
|
|
private static final int MAX_PLAYER_STUCK_COUNTER = 4;
|
|
private int attackAnimationRemainingTicks;
|
|
- public final AnimationState attackAnimationState = new AnimationState();
|
|
- public final AnimationState invulnerabilityAnimationState = new AnimationState();
|
|
- public final AnimationState deathAnimationState = new AnimationState();
|
|
+ //public final AnimationState attackAnimationState = new AnimationState(); // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //public final AnimationState invulnerabilityAnimationState = new AnimationState(); // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //public final AnimationState deathAnimationState = new AnimationState(); // Plazma - Remove isClientSide on DedicatedServer
|
|
private int invulnerabilityAnimationRemainingTicks;
|
|
- private boolean eyesGlowing;
|
|
- private int nextFlickerTime;
|
|
+ //private boolean eyesGlowing; // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private int nextFlickerTime; // Plazma - Remove isClientSide on DedicatedServer
|
|
private int playerStuckCounter;
|
|
|
|
public Creaking(EntityType<? extends Creaking> entityType, Level level) {
|
|
@@ -251,7 +251,7 @@ public class Creaking extends Monster {
|
|
this.attackAnimationRemainingTicks--;
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean flag = this.entityData.get(CAN_MOVE);
|
|
boolean flag1 = this.checkCanMove();
|
|
if (flag1 != flag) {
|
|
@@ -265,14 +265,14 @@ public class Creaking extends Monster {
|
|
}
|
|
|
|
this.entityData.set(CAN_MOVE, flag1);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.aiStep();
|
|
}
|
|
|
|
@Override
|
|
public void tick() {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockPos homePos = this.getHomePos();
|
|
if (homePos != null) {
|
|
boolean flag = this.level().getBlockEntity(homePos) instanceof CreakingHeartBlockEntity creakingHeartBlockEntity
|
|
@@ -281,20 +281,21 @@ public class Creaking extends Monster {
|
|
this.setHealth(0.0F);
|
|
}
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.tick();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setupAnimationStates();
|
|
this.checkEyeBlink();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
protected void tickDeath() {
|
|
if (this.isHeartBound() && this.isTearingDown()) {
|
|
this.deathTime++;
|
|
- if (!this.level().isClientSide() && this.deathTime > 45 && !this.isRemoved()) {
|
|
+ if (/*!this.level().isClientSide() &&*/ this.deathTime > 45 && !this.isRemoved()) { // Plazma - Remove isClientSide on DedicatedServer
|
|
this.tearDown();
|
|
}
|
|
} else {
|
|
@@ -308,11 +309,13 @@ public class Creaking extends Monster {
|
|
this.walkAnimation.update(min, 0.4F, 1.0F);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private void setupAnimationStates() {
|
|
this.attackAnimationState.animateWhen(this.attackAnimationRemainingTicks > 0, this.tickCount);
|
|
this.invulnerabilityAnimationState.animateWhen(this.invulnerabilityAnimationRemainingTicks > 0, this.tickCount);
|
|
this.deathAnimationState.animateWhen(this.isTearingDown(), this.tickCount);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public void tearDown() {
|
|
if (this.level() instanceof ServerLevel serverLevel) {
|
|
@@ -461,6 +464,7 @@ public class Creaking extends Monster {
|
|
return this.entityData.get(IS_TEARING_DOWN);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public boolean hasGlowingEyes() {
|
|
return this.eyesGlowing;
|
|
}
|
|
@@ -472,6 +476,7 @@ public class Creaking extends Monster {
|
|
this.eyesGlowing = !this.eyesGlowing;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void playAttackSound() {
|
|
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
index 28f3bc31b4c093e426ae141edeee61a12a444ba1..f80fd583531a7ee2147503fd04fef48802c2a3e5 100644
|
|
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
@@ -396,7 +396,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
|
|
|
|
@Override
|
|
protected SoundEvent getAmbientSound() {
|
|
- return this.level().isClientSide ? null : HoglinAi.getSoundForCurrentActivity(this).orElse(null);
|
|
+ return HoglinAi.getSoundForCurrentActivity(this).orElse(null); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
|
index f0d78cf5fe2c39add9a673471103c352cce72a45..83e07ccc72788271c9a6f06ad40a55b4dea727d7 100644
|
|
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
|
|
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
|
@@ -358,13 +358,13 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
|
|
@Override
|
|
public void setBaby(boolean childZombie) {
|
|
this.getEntityData().set(DATA_BABY_ID, childZombie);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
AttributeInstance attribute = this.getAttribute(Attributes.MOVEMENT_SPEED);
|
|
attribute.removeModifier(SPEED_MODIFIER_BABY.id());
|
|
if (childZombie) {
|
|
attribute.addTransientModifier(SPEED_MODIFIER_BABY);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -530,7 +530,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
|
|
|
|
@Override
|
|
protected SoundEvent getAmbientSound() {
|
|
- return this.level().isClientSide ? null : PiglinAi.getSoundForCurrentActivity(this).orElse(null);
|
|
+ return PiglinAi.getSoundForCurrentActivity(this).orElse(null); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
|
|
index f968e5c99bdb23b268bc34ea1ba5d54ae9ad0ff9..a4311f887b3df9065070a2d6f3da532ec36dcd8d 100644
|
|
--- a/net/minecraft/world/entity/monster/warden/Warden.java
|
|
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
|
|
@@ -101,10 +101,10 @@ public class Warden extends Monster implements VibrationSystem {
|
|
private static final float DIGGING_PARTICLES_DURATION = 4.5F;
|
|
private static final float DIGGING_PARTICLES_OFFSET = 0.7F;
|
|
private static final int PROJECTILE_ANGER_DISTANCE = 30;
|
|
- private int tendrilAnimation;
|
|
- private int tendrilAnimationO;
|
|
- private int heartAnimation;
|
|
- private int heartAnimationO;
|
|
+ //private int tendrilAnimation; // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private int tendrilAnimationO; // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private int heartAnimation; // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private int heartAnimationO; // Plazma - Remove isClientSide on DedicatedServer
|
|
public AnimationState roarAnimationState = new AnimationState();
|
|
public AnimationState sniffAnimationState = new AnimationState();
|
|
public AnimationState emergeAnimationState = new AnimationState();
|
|
@@ -257,9 +257,11 @@ public class Warden extends Monster implements VibrationSystem {
|
|
builder.define(CLIENT_ANGER_LEVEL, 0);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public int getClientAngerLevel() {
|
|
return this.entityData.get(CLIENT_ANGER_LEVEL);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
private void syncClientAngerLevel() {
|
|
this.entityData.set(CLIENT_ANGER_LEVEL, this.getActiveAnger());
|
|
@@ -275,7 +277,7 @@ public class Warden extends Monster implements VibrationSystem {
|
|
}
|
|
|
|
super.tick();
|
|
- if (this.level().isClientSide()) {
|
|
+ /*if (this.level().isClientSide()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.tickCount % this.getHeartBeatDelay() == 0) {
|
|
this.heartAnimation = 10;
|
|
if (!this.isSilent()) {
|
|
@@ -304,6 +306,7 @@ public class Warden extends Monster implements VibrationSystem {
|
|
this.clientDiggingParticles(this.diggingAnimationState);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -331,7 +334,7 @@ public class Warden extends Monster implements VibrationSystem {
|
|
this.roarAnimationState.stop();
|
|
this.attackAnimationState.start(this.tickCount);
|
|
} else if (id == 61) {
|
|
- this.tendrilAnimation = 10;
|
|
+ //this.tendrilAnimation = 10; // Plazma - Remove isClientSide on DedicatedServer
|
|
} else if (id == 62) {
|
|
this.sonicBoomAnimationState.start(this.tickCount);
|
|
} else {
|
|
@@ -339,6 +342,7 @@ public class Warden extends Monster implements VibrationSystem {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private int getHeartBeatDelay() {
|
|
float f = (float)this.getClientAngerLevel() / AngerLevel.ANGRY.getMinimumAnger();
|
|
return 40 - Mth.floor(Mth.clamp(f, 0.0F, 1.0F) * 30.0F);
|
|
@@ -366,6 +370,7 @@ public class Warden extends Monster implements VibrationSystem {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void onSyncedDataUpdated(EntityDataAccessor<?> key) {
|
|
diff --git a/net/minecraft/world/entity/npc/AbstractVillager.java b/net/minecraft/world/entity/npc/AbstractVillager.java
|
|
index b4e79cac5611942240ce85120f7bbee329ae2fb8..48da80cdb4a4063a24e69703d3f439f2bbeb2e17 100644
|
|
--- a/net/minecraft/world/entity/npc/AbstractVillager.java
|
|
+++ b/net/minecraft/world/entity/npc/AbstractVillager.java
|
|
@@ -123,16 +123,17 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
|
|
|
@Override
|
|
public MerchantOffers getOffers() {
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
throw new IllegalStateException("Cannot load Villager offers on the client");
|
|
} else {
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.offers == null) {
|
|
this.offers = new MerchantOffers();
|
|
this.updateTrades();
|
|
}
|
|
|
|
return this.offers;
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -175,7 +176,7 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
|
|
|
@Override
|
|
public void notifyTradeUpdated(ItemStack stack) {
|
|
- if (!this.level().isClientSide && this.ambientSoundTime > -this.getAmbientSoundInterval() + 20) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.ambientSoundTime > -this.getAmbientSoundInterval() + 20) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.ambientSoundTime = -this.getAmbientSoundInterval();
|
|
this.makeSound(this.getTradeUpdatedSound(!stack.isEmpty()));
|
|
}
|
|
@@ -197,12 +198,12 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
|
@Override
|
|
public void addAdditionalSaveData(CompoundTag compound) {
|
|
super.addAdditionalSaveData(compound);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
MerchantOffers offers = this.getOffers();
|
|
if (!offers.isEmpty()) {
|
|
compound.put("Offers", MerchantOffers.CODEC.encodeStart(this.registryAccess().createSerializationContext(NbtOps.INSTANCE), offers).getOrThrow());
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.writeInventoryToTag(compound, this.registryAccess());
|
|
}
|
|
@@ -297,10 +298,12 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
|
return this.getPosition(partialTicks).add(vec3.yRot(-f));
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public boolean isClientSide() {
|
|
return this.level().isClientSide;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public boolean stillValid(Player player) {
|
|
diff --git a/net/minecraft/world/entity/npc/ClientSideMerchant.java b/net/minecraft/world/entity/npc/ClientSideMerchant.java
|
|
index 70048626e9b911568ad0eb6294482cac3ded474f..e0d841db9b4d22b4e078336bd88e186fd88e0b11 100644
|
|
--- a/net/minecraft/world/entity/npc/ClientSideMerchant.java
|
|
+++ b/net/minecraft/world/entity/npc/ClientSideMerchant.java
|
|
@@ -46,10 +46,12 @@ public class ClientSideMerchant implements Merchant {
|
|
public void notifyTradeUpdated(ItemStack stack) {
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public boolean isClientSide() {
|
|
return this.source.level().isClientSide;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public boolean stillValid(Player player) {
|
|
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
|
index 16fbe4e6521cd4f6baa8f5dd590da0fc749f6585..a488abb5035cda96605945c96bc53a4718263326 100644
|
|
--- a/net/minecraft/world/entity/npc/Villager.java
|
|
+++ b/net/minecraft/world/entity/npc/Villager.java
|
|
@@ -463,7 +463,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
|
this.setUnhappy();
|
|
return tryRide(player, hand, InteractionResult.SUCCESS); // Purpur - Ridables
|
|
} else {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean isEmpty = this.getOffers().isEmpty();
|
|
if (hand == InteractionHand.MAIN_HAND) {
|
|
if (isEmpty) {
|
|
@@ -481,7 +481,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
|
|
|
if (this.level().purpurConfig.villagerAllowTrading) // Purpur - Add config for villager trading
|
|
this.startTrading(player);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
@@ -489,9 +489,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
|
|
|
public void setUnhappy() {
|
|
this.setUnhappyCounter(40);
|
|
- if (!this.level().isClientSide()) {
|
|
- this.makeSound(SoundEvents.VILLAGER_NO);
|
|
- }
|
|
+ this.makeSound(SoundEvents.VILLAGER_NO); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private void startTrading(Player player) {
|
|
@@ -516,11 +514,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
|
}
|
|
|
|
private void resetSpecialPrices() {
|
|
- if (!this.level().isClientSide()) {
|
|
- for (MerchantOffer merchantOffer : this.getOffers()) {
|
|
- merchantOffer.resetSpecialPriceDiff();
|
|
- }
|
|
- }
|
|
+ for (MerchantOffer merchantOffer : this.getOffers()) merchantOffer.resetSpecialPriceDiff(); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/npc/WanderingTrader.java b/net/minecraft/world/entity/npc/WanderingTrader.java
|
|
index c3fbcc7956a64d49466874776f257ba27f55f2a4..6171c150179672bda59d5db5cdca111bff9cc1d7 100644
|
|
--- a/net/minecraft/world/entity/npc/WanderingTrader.java
|
|
+++ b/net/minecraft/world/entity/npc/WanderingTrader.java
|
|
@@ -181,7 +181,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
|
player.awardStat(Stats.TALKED_TO_VILLAGER);
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.getOffers().isEmpty()) {
|
|
return tryRide(player, hand, InteractionResult.CONSUME); // Purpur - Ridables
|
|
}
|
|
@@ -191,7 +191,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
|
this.setTradingPlayer(player);
|
|
this.openTradingScreen(player, this.getDisplayName(), 1);
|
|
} // Purpur - Add config for villager trading
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
@@ -311,9 +311,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- if (!this.level().isClientSide) {
|
|
- this.maybeDespawn();
|
|
- }
|
|
+ this.maybeDespawn(); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private void maybeDespawn() {
|
|
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
|
index 3aab8856b07389a8d7a06a9f66f21771a3f2d122..65d32d3392ac30800c1963b682f220917a8e490b 100644
|
|
--- a/net/minecraft/world/entity/player/Player.java
|
|
+++ b/net/minecraft/world/entity/player/Player.java
|
|
@@ -238,7 +238,7 @@ public abstract class Player extends LivingEntity {
|
|
super(EntityType.PLAYER, level);
|
|
this.setUUID(gameProfile.getId());
|
|
this.gameProfile = gameProfile;
|
|
- this.inventoryMenu = new InventoryMenu(this.inventory, !level.isClientSide, this);
|
|
+ this.inventoryMenu = new InventoryMenu(this.inventory, this); // Plazma - Remove isClientSide on DedicatedServer
|
|
this.containerMenu = this.inventoryMenu;
|
|
this.moveTo(pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, yRot, 0.0F);
|
|
this.rotOffs = 180.0F;
|
|
@@ -313,7 +313,7 @@ public abstract class Player extends LivingEntity {
|
|
this.sleepCounter = 100;
|
|
}
|
|
|
|
- if (!this.level().isClientSide && this.level().isDay()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.level().isDay()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.stopSleepInBed(false, true);
|
|
}
|
|
} else if (this.sleepCounter > 0) {
|
|
@@ -325,7 +325,7 @@ public abstract class Player extends LivingEntity {
|
|
|
|
this.updateIsUnderwater();
|
|
super.tick();
|
|
- if (!this.level().isClientSide && this.containerMenu != null && !this.containerMenu.stillValid(this)) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.containerMenu != null && !this.containerMenu.stillValid(this)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper - Inventory close reason
|
|
this.containerMenu = this.inventoryMenu;
|
|
}
|
|
@@ -592,7 +592,7 @@ public abstract class Player extends LivingEntity {
|
|
|
|
@Override
|
|
public void rideTick() {
|
|
- if (!this.level().isClientSide && this.wantsToStopRiding() && this.isPassenger()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.wantsToStopRiding() && this.isPassenger()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.stopRiding();
|
|
// CraftBukkit start - SPIGOT-7316: no longer passenger, dismount and return
|
|
if (!this.isPassenger()) {
|
|
@@ -664,7 +664,7 @@ public abstract class Player extends LivingEntity {
|
|
|
|
this.playShoulderEntityAmbientSound(this.getShoulderEntityLeft());
|
|
this.playShoulderEntityAmbientSound(this.getShoulderEntityRight());
|
|
- if (!this.level().isClientSide && (this.fallDistance > 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) {
|
|
+ if (/*!this.level().isClientSide &&*/ (this.fallDistance > 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (!this.level().paperConfig().entities.behavior.parrotsAreUnaffectedByPlayerMovement) // Paper - Add option to make parrots stay
|
|
this.removeEntitiesOnShoulder();
|
|
}
|
|
@@ -719,10 +719,10 @@ public abstract class Player extends LivingEntity {
|
|
this.autoSpinAttackTicks = ticks;
|
|
this.autoSpinAttackDmg = damage;
|
|
this.autoSpinAttackItemStack = itemStack;
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.removeEntitiesOnShoulder();
|
|
this.setLivingEntityFlag(4, true);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Nonnull
|
|
@@ -807,9 +807,10 @@ public abstract class Player extends LivingEntity {
|
|
@Nullable
|
|
public ItemEntity drop(ItemStack droppedItem, boolean dropAround, boolean includeThrowerName, boolean callEvent, @Nullable java.util.function.Consumer<org.bukkit.entity.Item> entityOperation) {
|
|
// CraftBukkit end
|
|
- if (!droppedItem.isEmpty() && this.level().isClientSide) {
|
|
+ /*if (!droppedItem.isEmpty() && this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.swing(InteractionHand.MAIN_HAND);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return null;
|
|
}
|
|
@@ -1037,9 +1038,7 @@ public abstract class Player extends LivingEntity {
|
|
@Override
|
|
protected void hurtCurrentlyUsedShield(float damage) {
|
|
if (this.useItem.is(Items.SHIELD)) {
|
|
- if (!this.level().isClientSide) {
|
|
- this.awardStat(Stats.ITEM_USED.get(this.useItem.getItem()));
|
|
- }
|
|
+ this.awardStat(Stats.ITEM_USED.get(this.useItem.getItem())); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (damage >= 3.0F) {
|
|
int i = 1 + Mth.floor(damage);
|
|
@@ -1446,7 +1445,7 @@ public abstract class Player extends LivingEntity {
|
|
EnchantmentHelper.doPostAttackEffects(serverLevel1, target, damageSource);
|
|
}
|
|
|
|
- if (!this.level().isClientSide && !weaponItem.isEmpty() && entity instanceof LivingEntity) {
|
|
+ if (/*!this.level().isClientSide &&*/ !weaponItem.isEmpty() && entity instanceof LivingEntity) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (flag5) {
|
|
weaponItem.postHurtEnemy((LivingEntity)entity, this);
|
|
}
|
|
@@ -1881,14 +1880,14 @@ public abstract class Player extends LivingEntity {
|
|
public void causeFoodExhaustion(float exhaustion, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason reason) {
|
|
// CraftBukkit end
|
|
if (!this.abilities.invulnerable) {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
org.bukkit.event.entity.EntityExhaustionEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerExhaustionEvent(this, reason, exhaustion);
|
|
if (!event.isCancelled()) {
|
|
this.foodData.addExhaustion(event.getExhaustion());
|
|
}
|
|
// CraftBukkit end
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
|
|
@@ -2085,7 +2084,7 @@ public abstract class Player extends LivingEntity {
|
|
@Nullable
|
|
private Entity respawnEntityOnShoulder0(CompoundTag entityCompound) { // CraftBukkit void->boolean
|
|
// Paper end - release entity api - return entity - overload
|
|
- if (!this.level().isClientSide && !entityCompound.isEmpty()) {
|
|
+ if (/*!this.level().isClientSide &&*/ !entityCompound.isEmpty()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
return EntityType.create(entityCompound, this.level(), EntitySpawnReason.LOAD).map((entity) -> { // CraftBukkit
|
|
if (entity instanceof TamableAnimal) {
|
|
((TamableAnimal)entity).setOwnerUUID(this.uuid);
|
|
diff --git a/net/minecraft/world/entity/projectile/AbstractArrow.java b/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
index 7bca1cd398f6406f2b9d284dd4fbc9ef14136e77..29bb4ac1562b9c67bc08f10cb83299ec450a594e 100644
|
|
--- a/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
+++ b/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
@@ -204,13 +204,13 @@ public abstract class AbstractArrow extends Projectile {
|
|
}
|
|
|
|
if (this.isInGround() && flag) {
|
|
- if (!this.level().isClientSide()) {
|
|
+ //if (!this.level().isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.lastState != blockState && this.shouldFall()) {
|
|
this.startFalling();
|
|
} else {
|
|
this.tickDespawn();
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.inGroundTime++;
|
|
if (this.isAlive()) {
|
|
@@ -461,7 +461,7 @@ public abstract class AbstractArrow extends Projectile {
|
|
}
|
|
|
|
if (entity instanceof LivingEntity livingEntity1) {
|
|
- if (!this.level().isClientSide && this.getPierceLevel() <= 0) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.getPierceLevel() <= 0) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
livingEntity1.setArrowCount(livingEntity1.getArrowCount() + 1);
|
|
}
|
|
|
|
@@ -479,7 +479,7 @@ public abstract class AbstractArrow extends Projectile {
|
|
this.piercedAndKilledEntities.add(livingEntity1);
|
|
}
|
|
|
|
- if (!this.level().isClientSide && owner instanceof ServerPlayer serverPlayer) {
|
|
+ if (/*!this.level().isClientSide &&*/ owner instanceof ServerPlayer serverPlayer) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.piercedAndKilledEntities != null) {
|
|
CriteriaTriggers.KILLED_BY_ARROW.trigger(serverPlayer, this.piercedAndKilledEntities, this.firedFromWeapon);
|
|
} else if (!entity.isAlive()) {
|
|
@@ -669,7 +669,7 @@ public abstract class AbstractArrow extends Projectile {
|
|
|
|
@Override
|
|
public void playerTouch(Player entity) {
|
|
- if (!this.level().isClientSide && (this.isInGround() || this.isNoPhysics()) && this.shakeTime <= 0) {
|
|
+ if (/*!this.level().isClientSide &&*/ (this.isInGround() || this.isNoPhysics()) && this.shakeTime <= 0) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
ItemStack itemstack = this.getPickupItem();
|
|
if (this.pickup == Pickup.ALLOWED && !itemstack.isEmpty() && entity.getInventory().canHold(itemstack) > 0) {
|
|
@@ -782,7 +782,7 @@ public abstract class AbstractArrow extends Projectile {
|
|
}
|
|
|
|
public boolean isNoPhysics() {
|
|
- return !this.level().isClientSide ? this.noPhysics : (this.entityData.get(ID_FLAGS) & 2) != 0;
|
|
+ return this.noPhysics; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
|
index 9a99b813de8b606fab26c87086a21372e5172ba3..906897e68537c712af21ecac871208adc566fc6e 100644
|
|
--- a/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
|
+++ b/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
|
@@ -67,7 +67,7 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
|
public void tick() {
|
|
Entity owner = this.getOwner();
|
|
this.applyInertia();
|
|
- if (this.level().isClientSide || (owner == null || !owner.isRemoved()) && this.level().hasChunkAt(this.blockPosition())) {
|
|
+ if (/*this.level().isClientSide ||*/ (owner == null || !owner.isRemoved()) && this.level().hasChunkAt(this.blockPosition())) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
HitResult hitResultOnMoveVector = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType());
|
|
Vec3 location;
|
|
if (hitResultOnMoveVector.getType() != HitResult.Type.MISS) {
|
|
diff --git a/net/minecraft/world/entity/projectile/Arrow.java b/net/minecraft/world/entity/projectile/Arrow.java
|
|
index 56574f8ef879159edc0114da09300143a2c79a35..c4b0935f38166894a90df20385103e4fc802c34a 100644
|
|
--- a/net/minecraft/world/entity/projectile/Arrow.java
|
|
+++ b/net/minecraft/world/entity/projectile/Arrow.java
|
|
@@ -79,7 +79,7 @@ public class Arrow extends AbstractArrow {
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.isInGround()) {
|
|
if (this.inGroundTime % 5 == 0) {
|
|
this.makeParticle(1);
|
|
@@ -87,7 +87,7 @@ public class Arrow extends AbstractArrow {
|
|
} else {
|
|
this.makeParticle(2);
|
|
}
|
|
- } else if (this.isInGround() && this.inGroundTime != 0 && !this.getPotionContents().equals(PotionContents.EMPTY) && this.inGroundTime >= 600) {
|
|
+ } else*/ if (this.isInGround() && this.inGroundTime != 0 && !this.getPotionContents().equals(PotionContents.EMPTY) && this.inGroundTime >= 600) { // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level().broadcastEntityEvent(this, (byte)0);
|
|
this.setPickupItemStack(new ItemStack(Items.ARROW));
|
|
}
|
|
diff --git a/net/minecraft/world/entity/projectile/DragonFireball.java b/net/minecraft/world/entity/projectile/DragonFireball.java
|
|
index 963cdb34214cf4bfcbdb8fbdc9b98221c884f581..b15bcd1417677c6e8d2780a913bae7e3aa10deef 100644
|
|
--- a/net/minecraft/world/entity/projectile/DragonFireball.java
|
|
+++ b/net/minecraft/world/entity/projectile/DragonFireball.java
|
|
@@ -28,37 +28,43 @@ public class DragonFireball extends AbstractHurtingProjectile {
|
|
@Override
|
|
protected void onHit(HitResult result) {
|
|
super.onHit(result);
|
|
- if (result.getType() != HitResult.Type.ENTITY || !this.ownedBy(((EntityHitResult)result).getEntity())) {
|
|
- if (!this.level().isClientSide) {
|
|
- List<LivingEntity> entitiesOfClass = this.level().getEntitiesOfClass(LivingEntity.class, this.getBoundingBox().inflate(4.0, 2.0, 4.0));
|
|
- AreaEffectCloud areaEffectCloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
|
|
- Entity owner = this.getOwner();
|
|
- if (owner instanceof LivingEntity) {
|
|
- areaEffectCloud.setOwner((LivingEntity)owner);
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (result.getType() == HitResult.Type.ENTITY && this.ownedBy(((EntityHitResult) result).getEntity())) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ final List<LivingEntity> entitiesOfClass = this.level().getEntitiesOfClass(LivingEntity.class, this.getBoundingBox().inflate(4.0, 2.0, 4.0));
|
|
+ final AreaEffectCloud areaEffectCloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
|
|
+
|
|
+ if (this.getOwner() instanceof LivingEntity owner) {
|
|
+ areaEffectCloud.setOwner(owner);
|
|
+ }
|
|
|
|
- areaEffectCloud.setParticle(ParticleTypes.DRAGON_BREATH);
|
|
- areaEffectCloud.setRadius(3.0F);
|
|
- areaEffectCloud.setDuration(600);
|
|
- areaEffectCloud.setRadiusPerTick((7.0F - areaEffectCloud.getRadius()) / areaEffectCloud.getDuration());
|
|
- areaEffectCloud.addEffect(new MobEffectInstance(MobEffects.HARM, 1, 1));
|
|
- if (!entitiesOfClass.isEmpty()) {
|
|
- for (LivingEntity livingEntity : entitiesOfClass) {
|
|
- double d = this.distanceToSqr(livingEntity);
|
|
- if (d < 16.0) {
|
|
- areaEffectCloud.setPos(livingEntity.getX(), livingEntity.getY(), livingEntity.getZ());
|
|
- break;
|
|
- }
|
|
- }
|
|
+ areaEffectCloud.setParticle(ParticleTypes.DRAGON_BREATH);
|
|
+ areaEffectCloud.setRadius(3.0F);
|
|
+ areaEffectCloud.setDuration(600);
|
|
+ areaEffectCloud.setRadiusPerTick((7.0F - areaEffectCloud.getRadius()) / areaEffectCloud.getDuration());
|
|
+ areaEffectCloud.addEffect(new MobEffectInstance(MobEffects.HARM, 1, 1));
|
|
+ if (!entitiesOfClass.isEmpty()) {
|
|
+ for (LivingEntity livingEntity : entitiesOfClass) {
|
|
+ if (this.distanceToSqr(livingEntity) >= 16.0) {
|
|
+ continue;
|
|
}
|
|
|
|
- if (new com.destroystokyo.paper.event.entity.EnderDragonFireballHitEvent((org.bukkit.entity.DragonFireball) this.getBukkitEntity(), entitiesOfClass.stream().map(LivingEntity::getBukkitLivingEntity).collect(java.util.stream.Collectors.toList()), (org.bukkit.entity.AreaEffectCloud) areaEffectCloud.getBukkitEntity()).callEvent()) { // Paper - EnderDragon Events
|
|
- this.level().levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1);
|
|
- this.level().addFreshEntity(areaEffectCloud, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EXPLOSION); // Paper - use correct spawn reason
|
|
- } else areaEffectCloud.discard(null); // Paper - EnderDragon Events
|
|
- this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
+ areaEffectCloud.setPos(livingEntity.getX(), livingEntity.getY(), livingEntity.getZ());
|
|
+ break;
|
|
}
|
|
}
|
|
+
|
|
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFireballHitEvent((org.bukkit.entity.DragonFireball) this.getBukkitEntity(), entitiesOfClass.stream().map(LivingEntity::getBukkitLivingEntity).collect(java.util.stream.Collectors.toList()), (org.bukkit.entity.AreaEffectCloud) areaEffectCloud.getBukkitEntity()).callEvent()) { // Paper - EnderDragon Events
|
|
+ this.level().levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1);
|
|
+ this.level().addFreshEntity(areaEffectCloud, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EXPLOSION); // Paper - use correct spawn reason
|
|
+ } else {
|
|
+ areaEffectCloud.discard(null); // Paper - EnderDragon Events
|
|
+ }
|
|
+
|
|
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/projectile/EvokerFangs.java b/net/minecraft/world/entity/projectile/EvokerFangs.java
|
|
index f9c10584808183677fccebe7e1244b98d7236df4..d22c19d8b0c38ac3c27dd336dc48021ef21b5586 100644
|
|
--- a/net/minecraft/world/entity/projectile/EvokerFangs.java
|
|
+++ b/net/minecraft/world/entity/projectile/EvokerFangs.java
|
|
@@ -22,7 +22,7 @@ public class EvokerFangs extends Entity implements TraceableEntity {
|
|
public int warmupDelayTicks;
|
|
private boolean sentSpikeEvent;
|
|
private int lifeTicks = 22;
|
|
- private boolean clientSideAttackStarted;
|
|
+ //private boolean clientSideAttackStarted; // Plazma - Remove isClientSide on DedicatedServer
|
|
@Nullable
|
|
private LivingEntity owner;
|
|
@Nullable
|
|
@@ -81,7 +81,7 @@ public class EvokerFangs extends Entity implements TraceableEntity {
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.clientSideAttackStarted) {
|
|
this.lifeTicks--;
|
|
if (this.lifeTicks == 14) {
|
|
@@ -96,7 +96,7 @@ public class EvokerFangs extends Entity implements TraceableEntity {
|
|
}
|
|
}
|
|
}
|
|
- } else if (--this.warmupDelayTicks < 0) {
|
|
+ } else*/ if (--this.warmupDelayTicks < 0) { // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.warmupDelayTicks == -8) {
|
|
for (LivingEntity livingEntity : this.level().getEntitiesOfClass(LivingEntity.class, this.getBoundingBox().inflate(0.2, 0.0, 0.2))) {
|
|
this.dealDamageTo(livingEntity);
|
|
@@ -135,6 +135,7 @@ public class EvokerFangs extends Entity implements TraceableEntity {
|
|
@Override
|
|
public void handleEntityEvent(byte id) {
|
|
super.handleEntityEvent(id);
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
if (id == 4) {
|
|
this.clientSideAttackStarted = true;
|
|
if (!this.isSilent()) {
|
|
@@ -151,8 +152,10 @@ public class EvokerFangs extends Entity implements TraceableEntity {
|
|
);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public float getAnimationProgress(float partialTicks) {
|
|
if (!this.clientSideAttackStarted) {
|
|
return 0.0F;
|
|
@@ -161,6 +164,7 @@ public class EvokerFangs extends Entity implements TraceableEntity {
|
|
return i <= 0 ? 1.0F : 1.0F - (i - partialTicks) / 20.0F;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
|
|
diff --git a/net/minecraft/world/entity/projectile/EyeOfEnder.java b/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
|
index 01a9bad80a30a7879a69b800258b616b4d986108..68017b41d92900344c296ab980abaa369908cdee 100644
|
|
--- a/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
|
+++ b/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
|
@@ -119,7 +119,7 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
|
double d3 = deltaMovement.horizontalDistance();
|
|
this.setXRot(Projectile.lerpRotation(this.xRotO, (float)(Mth.atan2(deltaMovement.y, d3) * 180.0F / (float)Math.PI)));
|
|
this.setYRot(Projectile.lerpRotation(this.yRotO, (float)(Mth.atan2(deltaMovement.x, deltaMovement.z) * 180.0F / (float)Math.PI)));
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // Plazma - Remove isClientSide on DedicatedServer
|
|
double d4 = this.tx - d;
|
|
double d5 = this.tz - d2;
|
|
float f = (float)Math.sqrt(d4 * d4 + d5 * d5);
|
|
@@ -134,7 +134,7 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
|
int i = this.getY() < this.ty ? 1 : -1;
|
|
deltaMovement = new Vec3(Math.cos(f1) * d6, d7 + (i - d7) * 0.015F, Math.sin(f1) * d6);
|
|
this.setDeltaMovement(deltaMovement);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
float f2 = 0.25F;
|
|
if (this.isInWater()) {
|
|
@@ -163,10 +163,10 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
|
);
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.setPos(d, d1, d2);
|
|
this.life++;
|
|
- if (this.life > 80 && !this.level().isClientSide) {
|
|
+ if (this.life > 80 /*&& !this.level().isClientSide*/) { // Plazma - Why checking twice :sob:
|
|
this.playSound(SoundEvents.ENDER_EYE_DEATH, 1.0F, 1.0F);
|
|
this.discard(this.surviveAfterDeath ? org.bukkit.event.entity.EntityRemoveEvent.Cause.DROP : org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
|
if (this.surviveAfterDeath) {
|
|
@@ -175,9 +175,11 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
|
this.level().levelEvent(2003, this.blockPosition(), 0);
|
|
}
|
|
}
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
} else {
|
|
this.setPosRaw(d, d1, d2);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
|
index 774ca9e0b56fd175ae246051de762d0c4256ca58..aa661609d0633947c07ad65186c2eb546c3ffea1 100644
|
|
--- a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
|
+++ b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
|
@@ -184,7 +184,7 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
|
}
|
|
|
|
this.life++;
|
|
- if (this.level().isClientSide && this.life % 2 < 2) {
|
|
+ /*if (this.level().isClientSide && this.life % 2 < 2) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level()
|
|
.addParticle(
|
|
ParticleTypes.FIREWORK,
|
|
@@ -196,6 +196,7 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
|
this.random.nextGaussian() * 0.05
|
|
);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.life > this.lifetime && this.level() instanceof ServerLevel serverLevel) {
|
|
// CraftBukkit start
|
|
@@ -291,10 +292,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
|
|
|
@Override
|
|
public void handleEntityEvent(byte id) {
|
|
- if (id == 17 && this.level().isClientSide) {
|
|
+ /*if (id == 17 && this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
Vec3 deltaMovement = this.getDeltaMovement();
|
|
this.level().createFireworks(this.getX(), this.getY(), this.getZ(), deltaMovement.x, deltaMovement.y, deltaMovement.z, this.getExplosions());
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.handleEntityEvent(id);
|
|
}
|
|
diff --git a/net/minecraft/world/entity/projectile/FishingHook.java b/net/minecraft/world/entity/projectile/FishingHook.java
|
|
index 1e012c7ef699a64ff3f1b00f897bb893ab25ecbd..8612a08d9c522496910a5514c5818b0f1b6ba725 100644
|
|
--- a/net/minecraft/world/entity/projectile/FishingHook.java
|
|
+++ b/net/minecraft/world/entity/projectile/FishingHook.java
|
|
@@ -164,7 +164,7 @@ public class FishingHook extends Projectile {
|
|
Player playerOwner = this.getPlayerOwner();
|
|
if (playerOwner == null) {
|
|
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
|
- } else if (this.level().isClientSide || !this.shouldStopFishing(playerOwner)) {
|
|
+ } else if (/*this.level().isClientSide ||*/ !this.shouldStopFishing(playerOwner)) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.onGround()) {
|
|
this.life++;
|
|
if (this.life >= 1200) {
|
|
@@ -233,9 +233,7 @@ public class FishingHook extends Projectile {
|
|
);
|
|
}
|
|
|
|
- if (!this.level().isClientSide) {
|
|
- this.catchingFish(blockPos);
|
|
- }
|
|
+ this.catchingFish(blockPos); // Plazma - Remove isClientSide on DedicatedServer
|
|
} else {
|
|
this.outOfWaterTime = Math.min(10, this.outOfWaterTime + 1);
|
|
}
|
|
@@ -285,9 +283,7 @@ public class FishingHook extends Projectile {
|
|
@Override
|
|
protected void onHitEntity(EntityHitResult result) {
|
|
super.onHitEntity(result);
|
|
- if (!this.level().isClientSide) {
|
|
- this.setHookedEntity(result.getEntity());
|
|
- }
|
|
+ this.setHookedEntity(result.getEntity()); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -500,7 +496,7 @@ public class FishingHook extends Projectile {
|
|
public int retrieve(net.minecraft.world.InteractionHand hand, ItemStack stack) {
|
|
// Paper end - Add hand parameter to PlayerFishEvent
|
|
Player playerOwner = this.getPlayerOwner();
|
|
- if (!this.level().isClientSide && playerOwner != null && !this.shouldStopFishing(playerOwner)) {
|
|
+ if (/*!this.level().isClientSide &&*/ playerOwner != null && !this.shouldStopFishing(playerOwner)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
int i = 0;
|
|
if (this.hookedIn != null) {
|
|
// CraftBukkit start
|
|
@@ -594,9 +590,10 @@ public class FishingHook extends Projectile {
|
|
|
|
@Override
|
|
public void handleEntityEvent(byte id) {
|
|
- if (id == 31 && this.level().isClientSide && this.hookedIn instanceof Player && ((Player)this.hookedIn).isLocalPlayer()) {
|
|
+ /*if (id == 31 && this.level().isClientSide && this.hookedIn instanceof Player && ((Player)this.hookedIn).isLocalPlayer()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.pullEntity(this.hookedIn);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
super.handleEntityEvent(id);
|
|
}
|
|
diff --git a/net/minecraft/world/entity/projectile/LlamaSpit.java b/net/minecraft/world/entity/projectile/LlamaSpit.java
|
|
index bc102b049047d6e2a1d29e10f92cdf5ae2c140bd..24f8f3ac556042f96f62ccc3806854972e62ea79 100644
|
|
--- a/net/minecraft/world/entity/projectile/LlamaSpit.java
|
|
+++ b/net/minecraft/world/entity/projectile/LlamaSpit.java
|
|
@@ -81,9 +81,7 @@ public class LlamaSpit extends Projectile {
|
|
@Override
|
|
protected void onHitBlock(BlockHitResult result) {
|
|
super.onHitBlock(result);
|
|
- if (!this.level().isClientSide) {
|
|
- this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
- }
|
|
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
|
|
index 843f1396a6567672e5e8002d7e48fb18cf39d5de..ff3f6a1b26a0c4192f93f77a34f5d234b4165155 100644
|
|
--- a/net/minecraft/world/entity/projectile/Projectile.java
|
|
+++ b/net/minecraft/world/entity/projectile/Projectile.java
|
|
@@ -345,7 +345,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
|
|
|
public boolean deflect(ProjectileDeflection deflection, @Nullable Entity entity, @Nullable Entity owner, boolean deflectedByPlayer) {
|
|
deflection.deflect(this, entity, this.random);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// Paper start - Fix PickupStatus getting reset
|
|
if (this instanceof AbstractArrow arrow) {
|
|
arrow.setOwner(owner, false);
|
|
@@ -354,7 +354,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
|
}
|
|
// Paper end - Fix PickupStatus getting reset
|
|
this.onDeflection(entity, deflectedByPlayer);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return true;
|
|
}
|
|
diff --git a/net/minecraft/world/entity/projectile/ShulkerBullet.java b/net/minecraft/world/entity/projectile/ShulkerBullet.java
|
|
index 45ccfa92fe06a3f5041dac1ddd5550e5a89d8d80..34e788a02e77cacaeae6d54e43eadd6aa1a539f0 100644
|
|
--- a/net/minecraft/world/entity/projectile/ShulkerBullet.java
|
|
+++ b/net/minecraft/world/entity/projectile/ShulkerBullet.java
|
|
@@ -214,7 +214,7 @@ public class ShulkerBullet extends Projectile {
|
|
public void tick() {
|
|
super.tick();
|
|
HitResult hitResult = null;
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.finalTarget == null && this.targetId != null) {
|
|
this.finalTarget = ((ServerLevel)this.level()).getEntity(this.targetId);
|
|
if (this.finalTarget == null) {
|
|
@@ -237,7 +237,7 @@ public class ShulkerBullet extends Projectile {
|
|
}
|
|
|
|
hitResult = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
Vec3 deltaMovement = this.getDeltaMovement();
|
|
this.setPos(this.position().add(deltaMovement));
|
|
@@ -251,12 +251,12 @@ public class ShulkerBullet extends Projectile {
|
|
}
|
|
|
|
ProjectileUtil.rotateTowardsMovement(this, 0.5F);
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level()
|
|
.addParticle(
|
|
ParticleTypes.END_ROD, this.getX() - deltaMovement.x, this.getY() - deltaMovement.y + 0.15, this.getZ() - deltaMovement.z, 0.0, 0.0, 0.0
|
|
);
|
|
- } else if (this.finalTarget != null && !this.finalTarget.isRemoved()) {
|
|
+ } else*/ if (this.finalTarget != null && !this.finalTarget.isRemoved()) { // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.flightSteps > 0) {
|
|
this.flightSteps--;
|
|
if (this.flightSteps == 0) {
|
|
diff --git a/net/minecraft/world/entity/projectile/SmallFireball.java b/net/minecraft/world/entity/projectile/SmallFireball.java
|
|
index 808aa5dcb27c87b6ba5c1eee639486067447e370..503858fd3acc567b6cc67dc0fa677ebe319afa73 100644
|
|
--- a/net/minecraft/world/entity/projectile/SmallFireball.java
|
|
+++ b/net/minecraft/world/entity/projectile/SmallFireball.java
|
|
@@ -75,8 +75,6 @@ public class SmallFireball extends Fireball {
|
|
@Override
|
|
protected void onHit(HitResult result) {
|
|
super.onHit(result);
|
|
- if (!this.level().isClientSide) {
|
|
- this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
- }
|
|
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/entity/projectile/Snowball.java b/net/minecraft/world/entity/projectile/Snowball.java
|
|
index 1d399532c67c213c95c06837b0c7855384f1a25c..39abd487819ffe14c487004affd3a82ab8d85377 100644
|
|
--- a/net/minecraft/world/entity/projectile/Snowball.java
|
|
+++ b/net/minecraft/world/entity/projectile/Snowball.java
|
|
@@ -61,7 +61,7 @@ public class Snowball extends ThrowableItemProjectile {
|
|
protected void onHitBlock(net.minecraft.world.phys.BlockHitResult blockHitResult) {
|
|
super.onHitBlock(blockHitResult);
|
|
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
net.minecraft.core.BlockPos pos = blockHitResult.getBlockPos();
|
|
net.minecraft.core.BlockPos relativePos = pos.relative(blockHitResult.getDirection());
|
|
|
|
@@ -82,16 +82,16 @@ public class Snowball extends ThrowableItemProjectile {
|
|
this.level().setBlockAndUpdate(pos, blockState.setValue(net.minecraft.world.level.block.CampfireBlock.LIT, false));
|
|
}
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
// Purpur end - options to extinguish fire blocks with snowballs
|
|
|
|
@Override
|
|
protected void onHit(HitResult result) {
|
|
super.onHit(result);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level().broadcastEntityEvent(this, (byte)3);
|
|
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/entity/projectile/SpectralArrow.java b/net/minecraft/world/entity/projectile/SpectralArrow.java
|
|
index eec6760dc1ffd3bca3cb3ad31fc1b1ff3b9875bb..e71582c25a156e63fbf61cbf1c2f406d043e51f2 100644
|
|
--- a/net/minecraft/world/entity/projectile/SpectralArrow.java
|
|
+++ b/net/minecraft/world/entity/projectile/SpectralArrow.java
|
|
@@ -29,9 +29,10 @@ public class SpectralArrow extends AbstractArrow {
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (this.level().isClientSide && !this.isInGround()) {
|
|
+ /*if (this.level().isClientSide && !this.isInGround()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level().addParticle(ParticleTypes.INSTANT_EFFECT, this.getX(), this.getY(), this.getZ(), 0.0, 0.0, 0.0);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/projectile/ThrownEgg.java b/net/minecraft/world/entity/projectile/ThrownEgg.java
|
|
index 76481c0e77fc3a2e4be8eeb9de8d1e6de5507c64..ba472247f793b1bdd987fd0003c2bf33f308dc6a 100644
|
|
--- a/net/minecraft/world/entity/projectile/ThrownEgg.java
|
|
+++ b/net/minecraft/world/entity/projectile/ThrownEgg.java
|
|
@@ -58,64 +58,65 @@ public class ThrownEgg extends ThrowableItemProjectile {
|
|
@Override
|
|
protected void onHit(HitResult result) {
|
|
super.onHit(result);
|
|
- if (!this.level().isClientSide) {
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ boolean hatching = this.random.nextInt(8) == 0; // CraftBukkit
|
|
+ int toSpawn = 1;
|
|
+
|
|
+ if (this.random.nextInt(32) == 0) {
|
|
+ toSpawn = 4;
|
|
+ }
|
|
+ // CraftBukkit start
|
|
+ org.bukkit.entity.EntityType hatchingType = org.bukkit.entity.EntityType.CHICKEN;
|
|
+
|
|
+ net.minecraft.world.entity.Entity shooter = this.getOwner();
|
|
+ if (!hatching) {
|
|
+ toSpawn = 0;
|
|
+ }
|
|
+
|
|
+ if (shooter instanceof net.minecraft.server.level.ServerPlayer) {
|
|
+ org.bukkit.event.player.PlayerEggThrowEvent event = new org.bukkit.event.player.PlayerEggThrowEvent((org.bukkit.entity.Player) shooter.getBukkitEntity(), (org.bukkit.entity.Egg) this.getBukkitEntity(), hatching, (byte) toSpawn, hatchingType);
|
|
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
|
+
|
|
+ toSpawn = event.getNumHatches();
|
|
+ hatching = event.isHatching();
|
|
+ hatchingType = event.getHatchingType();
|
|
+ // If hatching is set to false, ensure child count is 0
|
|
+ if (!hatching) {
|
|
+ toSpawn = 0;
|
|
+ }
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
+ // Paper start - Add ThrownEggHatchEvent
|
|
+ com.destroystokyo.paper.event.entity.ThrownEggHatchEvent event = new com.destroystokyo.paper.event.entity.ThrownEggHatchEvent((org.bukkit.entity.Egg) getBukkitEntity(), hatching, (byte) toSpawn, hatchingType);
|
|
+ event.callEvent();
|
|
+ hatching = event.isHatching();
|
|
+ toSpawn = hatching ? event.getNumHatches() : 0; // If hatching is set to false, ensure child count is 0
|
|
+ hatchingType = event.getHatchingType();
|
|
+ // Paper end - Add ThrownEggHatchEvent
|
|
+
|
|
+ for (int i = 0; i < toSpawn; i++) {
|
|
+ net.minecraft.world.entity.Entity chicken = this.level().getWorld().makeEntity(new org.bukkit.Location(this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F), hatchingType.getEntityClass()); // CraftBukkit
|
|
+ if (chicken == null) {
|
|
+ continue;
|
|
+ }
|
|
+
|
|
// CraftBukkit start
|
|
- boolean hatching = this.random.nextInt(8) == 0;
|
|
- if (true) {
|
|
+ if (chicken.getBukkitEntity() instanceof org.bukkit.entity.Ageable ageable) {
|
|
+ ageable.setBaby();
|
|
+ }
|
|
// CraftBukkit end
|
|
- int i = 1;
|
|
- if (this.random.nextInt(32) == 0) {
|
|
- i = 4;
|
|
- }
|
|
- // CraftBukkit start
|
|
- org.bukkit.entity.EntityType hatchingType = org.bukkit.entity.EntityType.CHICKEN;
|
|
-
|
|
- net.minecraft.world.entity.Entity shooter = this.getOwner();
|
|
- if (!hatching) {
|
|
- i = 0;
|
|
- }
|
|
- if (shooter instanceof net.minecraft.server.level.ServerPlayer) {
|
|
- org.bukkit.event.player.PlayerEggThrowEvent event = new org.bukkit.event.player.PlayerEggThrowEvent((org.bukkit.entity.Player) shooter.getBukkitEntity(), (org.bukkit.entity.Egg) this.getBukkitEntity(), hatching, (byte) i, hatchingType);
|
|
- this.level().getCraftServer().getPluginManager().callEvent(event);
|
|
-
|
|
- i = event.getNumHatches();
|
|
- hatching = event.isHatching();
|
|
- hatchingType = event.getHatchingType();
|
|
- // If hatching is set to false, ensure child count is 0
|
|
- if (!hatching) {
|
|
- i = 0;
|
|
- }
|
|
- }
|
|
- // CraftBukkit end
|
|
- // Paper start - Add ThrownEggHatchEvent
|
|
- com.destroystokyo.paper.event.entity.ThrownEggHatchEvent event = new com.destroystokyo.paper.event.entity.ThrownEggHatchEvent((org.bukkit.entity.Egg) getBukkitEntity(), hatching, (byte) i, hatchingType);
|
|
- event.callEvent();
|
|
- hatching = event.isHatching();
|
|
- i = hatching ? event.getNumHatches() : 0; // If hatching is set to false, ensure child count is 0
|
|
- hatchingType = event.getHatchingType();
|
|
- // Paper end - Add ThrownEggHatchEvent
|
|
-
|
|
- for (int i1 = 0; i1 < i; i1++) {
|
|
- net.minecraft.world.entity.Entity chicken = this.level().getWorld().makeEntity(new org.bukkit.Location(this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F), hatchingType.getEntityClass()); // CraftBukkit
|
|
- if (chicken != null) {
|
|
- // CraftBukkit start
|
|
- if (chicken.getBukkitEntity() instanceof org.bukkit.entity.Ageable ageable) {
|
|
- ageable.setBaby();
|
|
- }
|
|
- // CraftBukkit end
|
|
- chicken.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F);
|
|
- if (!chicken.fudgePositionAfterSizeChange(ZERO_SIZED_DIMENSIONS)) {
|
|
- break;
|
|
- }
|
|
-
|
|
- this.level().addFreshEntity(chicken, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG); // CraftBukkit
|
|
- }
|
|
- }
|
|
+ chicken.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F);
|
|
+ if (!chicken.fudgePositionAfterSizeChange(ZERO_SIZED_DIMENSIONS)) {
|
|
+ break;
|
|
}
|
|
|
|
- this.level().broadcastEntityEvent(this, (byte)3);
|
|
- this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
+ this.level().addFreshEntity(chicken, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG); // CraftBukkit
|
|
}
|
|
+
|
|
+ this.level().broadcastEntityEvent(this, (byte) 3);
|
|
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/projectile/ThrownPotion.java b/net/minecraft/world/entity/projectile/ThrownPotion.java
|
|
index 5cff36e392a1a6150a5187e913fbfc9c176ccc88..0d7a845bbea1af0648f6d8cd79f8c0c56fefeb84 100644
|
|
--- a/net/minecraft/world/entity/projectile/ThrownPotion.java
|
|
+++ b/net/minecraft/world/entity/projectile/ThrownPotion.java
|
|
@@ -63,7 +63,7 @@ public class ThrownPotion extends ThrowableItemProjectile {
|
|
@Override
|
|
protected void onHitBlock(BlockHitResult result) {
|
|
super.onHitBlock(result);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ItemStack item = this.getItem();
|
|
Direction direction = result.getDirection();
|
|
BlockPos blockPos = result.getBlockPos();
|
|
@@ -77,7 +77,7 @@ public class ThrownPotion extends ThrowableItemProjectile {
|
|
this.dowseFire(blockPos1.relative(direction1));
|
|
}
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/projectile/WitherSkull.java b/net/minecraft/world/entity/projectile/WitherSkull.java
|
|
index a0b909c745ea60cae73def06f9d947345911c5e4..c36a4d51a69ba1735608589b4368fd321d54c6e9 100644
|
|
--- a/net/minecraft/world/entity/projectile/WitherSkull.java
|
|
+++ b/net/minecraft/world/entity/projectile/WitherSkull.java
|
|
@@ -90,7 +90,7 @@ public class WitherSkull extends AbstractHurtingProjectile {
|
|
@Override
|
|
protected void onHit(HitResult result) {
|
|
super.onHit(result);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
org.bukkit.event.entity.ExplosionPrimeEvent event = new org.bukkit.event.entity.ExplosionPrimeEvent(this.getBukkitEntity(), this.level().purpurConfig.witherExplosionRadius, false); // Purpur - Config for wither explosion radius
|
|
this.level().getCraftServer().getPluginManager().callEvent(event);
|
|
@@ -100,7 +100,7 @@ public class WitherSkull extends AbstractHurtingProjectile {
|
|
}
|
|
// CraftBukkit end
|
|
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
// Purpur start - Add canSaveToDisk to Entity
|
|
diff --git a/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java b/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java
|
|
index 2bb750bdb9b1ea2152cc10cf014364a1e1d55a2a..61b32ce05f50ad60332d53713f74872b2507d755 100644
|
|
--- a/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java
|
|
+++ b/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java
|
|
@@ -93,21 +93,19 @@ public abstract class AbstractWindCharge extends AbstractHurtingProjectile imple
|
|
@Override
|
|
protected void onHitBlock(BlockHitResult result) {
|
|
super.onHitBlock(result);
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Vec3i unitVec3i = result.getDirection().getUnitVec3i();
|
|
Vec3 vec3 = Vec3.atLowerCornerOf(unitVec3i).multiply(0.25, 0.25, 0.25);
|
|
Vec3 vec31 = result.getLocation().add(vec3);
|
|
this.explode(vec31);
|
|
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
protected void onHit(HitResult result) {
|
|
super.onHit(result);
|
|
- if (!this.level().isClientSide) {
|
|
- this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
- }
|
|
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -138,7 +136,7 @@ public abstract class AbstractWindCharge extends AbstractHurtingProjectile imple
|
|
|
|
@Override
|
|
public void tick() {
|
|
- if (!this.level().isClientSide && this.getBlockY() > this.level().getMaxY() + 30) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.getBlockY() > this.level().getMaxY() + 30) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.explode(this.position());
|
|
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.OUT_OF_WORLD); // CraftBukkit - add Bukkit remove cause
|
|
} else {
|
|
diff --git a/net/minecraft/world/entity/vehicle/AbstractBoat.java b/net/minecraft/world/entity/vehicle/AbstractBoat.java
|
|
index b1b312e45ed4514eaa6fb3941af64b641220c5bd..0baba6fe28cb27534d70316155ee3bcc0bcde308 100644
|
|
--- a/net/minecraft/world/entity/vehicle/AbstractBoat.java
|
|
+++ b/net/minecraft/world/entity/vehicle/AbstractBoat.java
|
|
@@ -76,9 +76,9 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
private double lastYd;
|
|
private boolean isAboveBubbleColumn;
|
|
private boolean bubbleColumnDirectionIsDown;
|
|
- private float bubbleMultiplier;
|
|
- private float bubbleAngle;
|
|
- private float bubbleAngleO;
|
|
+ //private float bubbleMultiplier; // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private float bubbleAngle; // Plazma - Remove isClientSide on DedicatedServer
|
|
+ //private float bubbleAngleO; // Plazma - Remove isClientSide on DedicatedServer
|
|
@Nullable
|
|
private Leashable.LeashData leashData;
|
|
private final Supplier<Item> dropItem;
|
|
@@ -165,21 +165,23 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
|
|
@Override
|
|
public void onAboveBubbleCol(boolean downwards) {
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.isAboveBubbleColumn = true;
|
|
this.bubbleColumnDirectionIsDown = downwards;
|
|
if (this.getBubbleTime() == 0) {
|
|
this.setBubbleTime(60);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.level()
|
|
.addParticle(ParticleTypes.SPLASH, this.getX() + this.random.nextFloat(), this.getY() + 0.7, this.getZ() + this.random.nextFloat(), 0.0, 0.0, 0.0);
|
|
if (this.random.nextInt(20) == 0) {
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level()
|
|
.playLocalSound(
|
|
this.getX(), this.getY(), this.getZ(), this.getSwimSplashSound(), this.getSoundSource(), 1.0F, 0.8F + 0.4F * this.random.nextFloat(), false
|
|
);
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
this.gameEvent(GameEvent.SPLASH, this.getControllingPassenger());
|
|
}
|
|
}
|
|
@@ -281,7 +283,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
this.outOfControlTicks++;
|
|
}
|
|
|
|
- if (!this.level().isClientSide && this.outOfControlTicks >= 60.0F) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.outOfControlTicks >= 60.0F) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.ejectPassengers();
|
|
}
|
|
|
|
@@ -301,10 +303,11 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
}
|
|
|
|
this.floatBoat();
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.controlBoat();
|
|
this.level().sendPacketToServer(new ServerboundPaddleBoatPacket(this.getPaddleState(0), this.getPaddleState(1)));
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
|
} else {
|
|
@@ -359,7 +362,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
|
|
List<Entity> entities = this.level().getEntities(this, this.getBoundingBox().inflate(0.2F, -0.01F, 0.2F), EntitySelector.pushableBy(this));
|
|
if (!entities.isEmpty()) {
|
|
- boolean flag = !this.level().isClientSide && !(this.getControllingPassenger() instanceof Player);
|
|
+ boolean flag = /*!this.level().isClientSide &&*/ !(this.getControllingPassenger() instanceof Player); // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
for (Entity entity : entities) {
|
|
if (!entity.hasPassenger(this)) {
|
|
@@ -381,7 +384,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
}
|
|
|
|
private void tickBubbleColumn() {
|
|
- if (this.level().isClientSide) {
|
|
+ /*if (this.level().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
int bubbleTime = this.getBubbleTime();
|
|
if (bubbleTime > 0) {
|
|
this.bubbleMultiplier += 0.05F;
|
|
@@ -393,6 +396,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
this.bubbleAngleO = this.bubbleAngle;
|
|
this.bubbleAngle = 10.0F * (float)Math.sin(0.5F * (float)this.level().getGameTime()) * this.bubbleMultiplier;
|
|
} else {
|
|
+ */
|
|
if (!this.isAboveBubbleColumn) {
|
|
this.setBubbleTime(0);
|
|
}
|
|
@@ -414,7 +418,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
|
|
this.isAboveBubbleColumn = false;
|
|
}
|
|
- }
|
|
+ //}
|
|
}
|
|
|
|
@Nullable
|
|
@@ -793,11 +797,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
if (interactionResult != InteractionResult.PASS) {
|
|
return interactionResult;
|
|
} else {
|
|
- return (InteractionResult)(player.isSecondaryUseActive()
|
|
- || !(this.outOfControlTicks < 60.0F)
|
|
- || !this.level().isClientSide && !player.startRiding(this)
|
|
- ? InteractionResult.PASS
|
|
- : InteractionResult.SUCCESS);
|
|
+ return (player.isSecondaryUseActive() || !(this.outOfControlTicks < 60.0F) || /*!this.level().isClientSide &&*/ !player.startRiding(this)) ? InteractionResult.PASS : InteractionResult.SUCCESS; // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
|
|
@@ -810,7 +810,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
@Override
|
|
public void remove(Entity.RemovalReason reason, org.bukkit.event.entity.EntityRemoveEvent.Cause eventCause) {
|
|
// CraftBukkit end
|
|
- if (!this.level().isClientSide && reason.shouldDestroy() && this.isLeashed()) {
|
|
+ if (/*!this.level().isClientSide &&*/ reason.shouldDestroy() && this.isLeashed()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.dropLeash();
|
|
}
|
|
|
|
@@ -841,9 +841,11 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
|
return this.entityData.get(DATA_ID_BUBBLE_TIME);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public float getBubbleAngle(float partialTick) {
|
|
return Mth.lerp(partialTick, this.bubbleAngleO, this.bubbleAngle);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected boolean canAddPassenger(Entity passenger) {
|
|
diff --git a/net/minecraft/world/entity/vehicle/AbstractChestBoat.java b/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
|
|
index b230955ae880d84fde40b4feffa5caf3c4449eb7..5a40612318db2452f8ce7902be06a70c8865bf2b 100644
|
|
--- a/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
|
|
+++ b/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
|
|
@@ -73,7 +73,7 @@ public abstract class AbstractChestBoat extends AbstractBoat implements HasCusto
|
|
@Override
|
|
public void remove(Entity.RemovalReason reason, org.bukkit.event.entity.EntityRemoveEvent.Cause cause) {
|
|
// CraftBukkit end
|
|
- if (!this.level().isClientSide && reason.shouldDestroy()) {
|
|
+ if (/*!this.level().isClientSide &&*/ reason.shouldDestroy()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Containers.dropContents(this.level(), this, this);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
|
index 6df4d736d94b9e49a3eb3d59a329e37127aa64cd..ba8179f9ab777e51c1cf758c5e3f4e4bbe8ead23 100644
|
|
--- a/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
|
+++ b/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
|
@@ -607,45 +607,54 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
|
|
|
@Override
|
|
public void push(Entity entity) {
|
|
- if (!this.level().isClientSide) {
|
|
- if (!entity.noPhysics && !this.noPhysics) {
|
|
- if (!this.level().paperConfig().collisions.allowVehicleCollisions && this.level().paperConfig().collisions.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper - Collision option for requiring a player participant
|
|
- if (!this.hasPassenger(entity)) {
|
|
- // CraftBukkit start
|
|
- org.bukkit.event.vehicle.VehicleEntityCollisionEvent collisionEvent = new org.bukkit.event.vehicle.VehicleEntityCollisionEvent(
|
|
- (org.bukkit.entity.Vehicle) this.getBukkitEntity(),
|
|
- entity.getBukkitEntity()
|
|
- );
|
|
- if (!collisionEvent.callEvent()) return;
|
|
- // CraftBukkit end
|
|
- double d = entity.getX() - this.getX();
|
|
- double d1 = entity.getZ() - this.getZ();
|
|
- double d2 = d * d + d1 * d1;
|
|
- if (d2 >= 1.0E-4F) {
|
|
- d2 = Math.sqrt(d2);
|
|
- d /= d2;
|
|
- d1 /= d2;
|
|
- double d3 = 1.0 / d2;
|
|
- if (d3 > 1.0) {
|
|
- d3 = 1.0;
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (entity.noPhysics || this.noPhysics) {
|
|
+ return;
|
|
+ }
|
|
|
|
- d *= d3;
|
|
- d1 *= d3;
|
|
- d *= 0.1F;
|
|
- d1 *= 0.1F;
|
|
- d *= 0.5;
|
|
- d1 *= 0.5;
|
|
- if (entity instanceof AbstractMinecart abstractMinecart) {
|
|
- this.pushOtherMinecart(abstractMinecart, d, d1);
|
|
- } else {
|
|
- this.push(-d, 0.0, -d1);
|
|
- entity.push(d / 4.0, 0.0, d1 / 4.0);
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
+ if (!this.level().paperConfig().collisions.allowVehicleCollisions && this.level().paperConfig().collisions.onlyPlayersCollide && !(entity instanceof Player)) {// Paper - Collision option for requiring a player participant
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ if (this.hasPassenger(entity)) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ // CraftBukkit start
|
|
+ org.bukkit.event.vehicle.VehicleEntityCollisionEvent collisionEvent = new org.bukkit.event.vehicle.VehicleEntityCollisionEvent((org.bukkit.entity.Vehicle) this.getBukkitEntity(), entity.getBukkitEntity());
|
|
+ if (!collisionEvent.callEvent()) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
+ double dX = entity.getX() - this.getX();
|
|
+ double dZ = entity.getZ() - this.getZ();
|
|
+ double dL = dX * dX + dZ * dZ;
|
|
+ if (dL < 1.0E-4F) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ dL = Math.sqrt(dL);
|
|
+ dX /= dL;
|
|
+ dZ /= dL;
|
|
+ double d3 = 1.0 / dL;
|
|
+ if (d3 > 1.0) {
|
|
+ d3 = 1.0;
|
|
+ }
|
|
+
|
|
+ dX *= d3;
|
|
+ dZ *= d3;
|
|
+ dX *= 0.1F;
|
|
+ dZ *= 0.1F;
|
|
+ dX *= 0.5;
|
|
+ dZ *= 0.5;
|
|
+ if (entity instanceof AbstractMinecart abstractMinecart) {
|
|
+ this.pushOtherMinecart(abstractMinecart, dX, dZ);
|
|
+ } else {
|
|
+ this.push(-dX, 0.0, -dZ);
|
|
+ entity.push(dX / 4.0, 0.0, dZ / 4.0);
|
|
}
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private void pushOtherMinecart(AbstractMinecart otherMinecart, double deltaX, double deltaZ) {
|
|
diff --git a/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
|
index 516b230769fb9ddaa49adca9b6aa64d4510810da..6fcff0d4acbc0fe7471cf0a1dcec47e254c3d187 100644
|
|
--- a/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
|
+++ b/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
|
@@ -80,7 +80,7 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
|
@Override
|
|
public void remove(Entity.RemovalReason reason, org.bukkit.event.entity.EntityRemoveEvent.Cause cause) {
|
|
// CraftBukkit end - add Bukkit remove cause
|
|
- if (!this.level().isClientSide && reason.shouldDestroy()) {
|
|
+ if (/*!this.level().isClientSide &&*/ reason.shouldDestroy()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Containers.dropContents(this.level(), this, this);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/vehicle/Minecart.java b/net/minecraft/world/entity/vehicle/Minecart.java
|
|
index b683bb83211ef26964fd740fcf0b96c00a7b2ca5..fb785f505b3cfba5fe557c26d660003e6270feb5 100644
|
|
--- a/net/minecraft/world/entity/vehicle/Minecart.java
|
|
+++ b/net/minecraft/world/entity/vehicle/Minecart.java
|
|
@@ -22,13 +22,9 @@ public class Minecart extends AbstractMinecart {
|
|
|
|
@Override
|
|
public InteractionResult interact(Player player, InteractionHand hand) {
|
|
- if (!player.isSecondaryUseActive() && !this.isVehicle() && (this.level().isClientSide || player.startRiding(this))) {
|
|
+ if (!player.isSecondaryUseActive() && !this.isVehicle() && (/*this.level().isClientSide ||*/ player.startRiding(this))) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.playerRotationOffset = this.rotationOffset;
|
|
- if (!this.level().isClientSide) {
|
|
- return (InteractionResult)(player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS);
|
|
- } else {
|
|
- return InteractionResult.SUCCESS;
|
|
- }
|
|
+ return player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS; // Plazma - Remove isClientSide on DedicatedServer
|
|
} else {
|
|
return InteractionResult.PASS;
|
|
}
|
|
@@ -65,6 +61,7 @@ public class Minecart extends AbstractMinecart {
|
|
return true;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void tick() {
|
|
double d = this.getYRot();
|
|
@@ -86,4 +83,5 @@ public class Minecart extends AbstractMinecart {
|
|
this.playerRotationOffset = f;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/entity/vehicle/MinecartFurnace.java b/net/minecraft/world/entity/vehicle/MinecartFurnace.java
|
|
index 77528bf65ee211340fcbf6833cadbc9b882cdbbc..d2ce4677a8f37ce341d4b909dd2e2a4489bc2c4d 100644
|
|
--- a/net/minecraft/world/entity/vehicle/MinecartFurnace.java
|
|
+++ b/net/minecraft/world/entity/vehicle/MinecartFurnace.java
|
|
@@ -46,7 +46,7 @@ public class MinecartFurnace extends AbstractMinecart {
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
- if (!this.level().isClientSide()) {
|
|
+ //if (!this.level().isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (this.fuel > 0) {
|
|
this.fuel--;
|
|
}
|
|
@@ -56,7 +56,7 @@ public class MinecartFurnace extends AbstractMinecart {
|
|
}
|
|
|
|
this.setHasFuel(this.fuel > 0);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (this.hasFuel() && this.random.nextInt(4) == 0) {
|
|
this.level().addParticle(ParticleTypes.LARGE_SMOKE, this.getX(), this.getY() + 0.8, this.getZ(), 0.0, 0.0, 0.0);
|
|
diff --git a/net/minecraft/world/entity/vehicle/MinecartHopper.java b/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
|
index 8341e7f01606fca90e69384c16fc19bb9e20d1b7..f4b6223a2f2ef676a4a12e6e56898d08ee596f32 100644
|
|
--- a/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
|
+++ b/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
|
@@ -93,7 +93,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
|
|
}
|
|
|
|
private void tryConsumeItems() {
|
|
- if (!this.level().isClientSide && this.isAlive() && this.isEnabled() && !this.consumedItemThisFrame && this.suckInItems()) {
|
|
+ if (/*!this.level().isClientSide &&*/ this.isAlive() && this.isEnabled() && !this.consumedItemThisFrame && this.suckInItems()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.consumedItemThisFrame = true;
|
|
this.setChanged();
|
|
}
|
|
diff --git a/net/minecraft/world/entity/vehicle/MinecartSpawner.java b/net/minecraft/world/entity/vehicle/MinecartSpawner.java
|
|
index 4a5fa99ac574970a308eaf66493ff8e19abfc3c7..17bceec465c5a9f565908f63ed92b9f7feedd21d 100644
|
|
--- a/net/minecraft/world/entity/vehicle/MinecartSpawner.java
|
|
+++ b/net/minecraft/world/entity/vehicle/MinecartSpawner.java
|
|
@@ -37,9 +37,7 @@ public class MinecartSpawner extends AbstractMinecart {
|
|
}
|
|
|
|
private Runnable createTicker(Level level) {
|
|
- return level instanceof ServerLevel
|
|
- ? () -> this.spawner.serverTick((ServerLevel)level, this.blockPosition())
|
|
- : () -> this.spawner.clientTick(level, this.blockPosition());
|
|
+ return () -> this.spawner.serverTick((ServerLevel)level, this.blockPosition()); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/entity/vehicle/MinecartTNT.java b/net/minecraft/world/entity/vehicle/MinecartTNT.java
|
|
index da2ff774cd711e3db96376580772ee4eb3293944..64cd67045886da3d27a324713d15899981389ee3 100644
|
|
--- a/net/minecraft/world/entity/vehicle/MinecartTNT.java
|
|
+++ b/net/minecraft/world/entity/vehicle/MinecartTNT.java
|
|
@@ -162,12 +162,12 @@ public class MinecartTNT extends AbstractMinecart {
|
|
|
|
public void primeFuse() {
|
|
this.fuse = 80;
|
|
- if (!this.level().isClientSide) {
|
|
+ //if (!this.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level().broadcastEntityEvent(this, (byte)10);
|
|
if (!this.isSilent()) {
|
|
this.level().playSound(null, this.getX(), this.getY(), this.getZ(), SoundEvents.TNT_PRIMED, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public int getFuse() {
|
|
diff --git a/net/minecraft/world/inventory/BeaconMenu.java b/net/minecraft/world/inventory/BeaconMenu.java
|
|
index c2304250757b9b82d918c208a44be2e23a5ecd82..274e6c06dd35755cfff2411abf69b64e319c7a19 100644
|
|
--- a/net/minecraft/world/inventory/BeaconMenu.java
|
|
+++ b/net/minecraft/world/inventory/BeaconMenu.java
|
|
@@ -70,12 +70,12 @@ public class BeaconMenu extends AbstractContainerMenu {
|
|
@Override
|
|
public void removed(Player player) {
|
|
super.removed(player);
|
|
- if (!player.level().isClientSide) {
|
|
+ //if (!player.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ItemStack itemStack = this.paymentSlot.remove(this.paymentSlot.getMaxStackSize());
|
|
if (!itemStack.isEmpty()) {
|
|
player.drop(itemStack, false);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/inventory/InventoryMenu.java b/net/minecraft/world/inventory/InventoryMenu.java
|
|
index 4d9a80ec027a98ed376a55f492d2a639e9db4bd2..eecb7c296559de15a7fa5266f5bd146a6787b3c5 100644
|
|
--- a/net/minecraft/world/inventory/InventoryMenu.java
|
|
+++ b/net/minecraft/world/inventory/InventoryMenu.java
|
|
@@ -43,18 +43,18 @@ public class InventoryMenu extends AbstractCraftingMenu {
|
|
EMPTY_ARMOR_SLOT_HELMET
|
|
);
|
|
private static final EquipmentSlot[] SLOT_IDS = new EquipmentSlot[]{EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.FEET};
|
|
- public final boolean active;
|
|
+ //public final boolean active; // Plazma - Remove isClientSide on DedicatedServer
|
|
private final Player owner;
|
|
// CraftBukkit start
|
|
private org.bukkit.craftbukkit.inventory.CraftInventoryView bukkitEntity = null;
|
|
// CraftBukkit end
|
|
|
|
- public InventoryMenu(Inventory playerInventory, boolean active, final Player owner) {
|
|
+ public InventoryMenu(Inventory playerInventory, /*boolean active,*/ final Player owner) { // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
super((MenuType) null, 0, 2, 2, playerInventory); // CraftBukkit - save player
|
|
this.setTitle(Component.translatable("container.crafting")); // SPIGOT-4722: Allocate title for player inventory
|
|
// CraftBukkit end
|
|
- this.active = active;
|
|
+ //this.active = active; // Plazma - Remove isClientSide on DedicatedServer
|
|
this.owner = owner;
|
|
this.addResultSlot(owner, 154, 28);
|
|
this.addCraftingGridSlots(98, 18);
|
|
@@ -95,9 +95,7 @@ public class InventoryMenu extends AbstractCraftingMenu {
|
|
public void removed(Player player) {
|
|
super.removed(player);
|
|
this.resultSlots.clearContent();
|
|
- if (!player.level().isClientSide) {
|
|
- this.clearContainer(player, this.craftSlots);
|
|
- }
|
|
+ this.clearContainer(player, this.craftSlots); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/inventory/MerchantMenu.java b/net/minecraft/world/inventory/MerchantMenu.java
|
|
index 3019790d5eccef23c710e77615243551fcc676b0..b0234cead15e6db63e07205d1755d5cb46d8c454 100644
|
|
--- a/net/minecraft/world/inventory/MerchantMenu.java
|
|
+++ b/net/minecraft/world/inventory/MerchantMenu.java
|
|
@@ -58,9 +58,11 @@ public class MerchantMenu extends AbstractContainerMenu {
|
|
this.addStandardInventorySlots(playerInventory, 108, 84);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public void setShowProgressBar(boolean showProgressBar) {
|
|
this.showProgressBar = showProgressBar;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void slotsChanged(Container inventory) {
|
|
@@ -160,7 +162,7 @@ public class MerchantMenu extends AbstractContainerMenu {
|
|
this.moveItemStackTo(item, 3, 39, true, false); // This should always succeed because it's checked above
|
|
|
|
slot.onQuickCraft(item, itemStack);
|
|
- this.playTradeSound();
|
|
+ //this.playTradeSound(); // Plazma - Remove isClientSide on DedicatedServer
|
|
slot.set(ItemStack.EMPTY); // item should ALWAYS be empty
|
|
}
|
|
// Paper end - Add PlayerTradeEvent and PlayerPurchaseEvent
|
|
@@ -169,6 +171,7 @@ public class MerchantMenu extends AbstractContainerMenu {
|
|
return itemStack;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private void playTradeSound() {
|
|
if (!this.trader.isClientSide() && this.trader instanceof Entity) { // CraftBukkit - SPIGOT-5035
|
|
Entity entity = (Entity)this.trader;
|
|
@@ -176,12 +179,13 @@ public class MerchantMenu extends AbstractContainerMenu {
|
|
.playLocalSound(entity.getX(), entity.getY(), entity.getZ(), this.trader.getNotifyTradeSound(), SoundSource.NEUTRAL, 1.0F, 1.0F, false);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void removed(Player player) {
|
|
super.removed(player);
|
|
this.trader.setTradingPlayer(null);
|
|
- if (!this.trader.isClientSide()) {
|
|
+ //if (!this.trader.isClientSide()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (!player.isAlive() || player instanceof ServerPlayer && ((ServerPlayer)player).hasDisconnected()) {
|
|
ItemStack itemStack = this.tradeContainer.removeItemNoUpdate(0);
|
|
if (!itemStack.isEmpty()) {
|
|
@@ -196,7 +200,7 @@ public class MerchantMenu extends AbstractContainerMenu {
|
|
player.getInventory().placeItemBackInInventory(this.tradeContainer.removeItemNoUpdate(0));
|
|
player.getInventory().placeItemBackInInventory(this.tradeContainer.removeItemNoUpdate(1));
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public void tryMoveItems(int selectedMerchantRecipe) {
|
|
@@ -254,7 +258,9 @@ public class MerchantMenu extends AbstractContainerMenu {
|
|
return this.trader.getOffers();
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public boolean showProgressBar() {
|
|
return this.showProgressBar;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
|
index 1df587402862d67a76ed090df60bfa20c3a9209d..b2dafed969c0523cf4ec05ac98bdf9ca8f8b9979 100644
|
|
--- a/net/minecraft/world/item/BlockItem.java
|
|
+++ b/net/minecraft/world/item/BlockItem.java
|
|
@@ -208,34 +208,35 @@ public class BlockItem extends Item {
|
|
}
|
|
|
|
public static boolean updateCustomBlockEntityTag(Level level, @Nullable Player player, BlockPos pos, ItemStack stack) {
|
|
- if (level.isClientSide) {
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ final CustomData customData = stack.getOrDefault(DataComponents.BLOCK_ENTITY_DATA, CustomData.EMPTY);
|
|
+ if (customData.isEmpty()) {
|
|
return false;
|
|
- } else {
|
|
- CustomData customData = stack.getOrDefault(DataComponents.BLOCK_ENTITY_DATA, CustomData.EMPTY);
|
|
- if (!customData.isEmpty()) {
|
|
- BlockEntityType<?> blockEntityType = customData.parseEntityType(level.registryAccess(), Registries.BLOCK_ENTITY_TYPE);
|
|
- if (blockEntityType == null) {
|
|
- return false;
|
|
- }
|
|
-
|
|
- BlockEntity blockEntity = level.getBlockEntity(pos);
|
|
- if (blockEntity != null) {
|
|
- BlockEntityType<?> type = blockEntity.getType();
|
|
- if (type != blockEntityType) {
|
|
- return false;
|
|
- }
|
|
+ }
|
|
|
|
- if (!type.onlyOpCanSetNbt() || player != null && (player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place")))) { // Spigot - add permission
|
|
- if (!(level.purpurConfig.silkTouchEnabled && blockEntity instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity && player.getBukkitEntity().hasPermission("purpur.drop.spawners"))) // Purpur - Silk touch spawners
|
|
- return customData.loadInto(blockEntity, level.registryAccess());
|
|
- }
|
|
+ final BlockEntityType<?> blockEntityType = customData.parseEntityType(level.registryAccess(), Registries.BLOCK_ENTITY_TYPE);
|
|
+ if (blockEntityType == null) {
|
|
+ return false;
|
|
+ }
|
|
|
|
- return false;
|
|
- }
|
|
- }
|
|
+ final BlockEntity blockEntity = level.getBlockEntity(pos);
|
|
+ if (blockEntity == null) {
|
|
+ return false;
|
|
+ }
|
|
|
|
+ final BlockEntityType<?> type = blockEntity.getType();
|
|
+ if (type != blockEntityType) {
|
|
return false;
|
|
}
|
|
+
|
|
+ if (!type.onlyOpCanSetNbt() || player != null && (player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place")))) { // Spigot - add permission
|
|
+ if (!(level.purpurConfig.silkTouchEnabled && blockEntity instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity && player.getBukkitEntity().hasPermission("purpur.drop.spawners"))) { // Purpur - Silk touch spawners
|
|
+ return customData.loadInto(blockEntity, level.registryAccess());
|
|
+ }
|
|
+ }
|
|
+
|
|
+ return false;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/item/BoatItem.java b/net/minecraft/world/item/BoatItem.java
|
|
index ca86122e38688b29340cd8413ccf1746315e292a..488b51826b451cfc8c98a379e92a1cedf520457a 100644
|
|
--- a/net/minecraft/world/item/BoatItem.java
|
|
+++ b/net/minecraft/world/item/BoatItem.java
|
|
@@ -67,7 +67,7 @@ public class BoatItem extends Item {
|
|
if (!level.noCollision(boat, boat.getBoundingBox())) {
|
|
return InteractionResult.FAIL;
|
|
} else {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(level, playerPovHitResult.getBlockPos(), player.getDirection(), player, boat, hand).isCancelled()) {
|
|
return InteractionResult.FAIL;
|
|
@@ -79,7 +79,7 @@ public class BoatItem extends Item {
|
|
// CraftBukkit end
|
|
level.gameEvent(player, GameEvent.ENTITY_PLACE, playerPovHitResult.getLocation());
|
|
itemInHand.consume(1, player);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
player.awardStat(Stats.ITEM_USED.get(this));
|
|
return InteractionResult.SUCCESS;
|
|
diff --git a/net/minecraft/world/item/BoneMealItem.java b/net/minecraft/world/item/BoneMealItem.java
|
|
index b76760c2d3f06a7058418b6276f3362171d45645..3bb2f0e3cd154d1bb3d761504e1f0691cab51979 100644
|
|
--- a/net/minecraft/world/item/BoneMealItem.java
|
|
+++ b/net/minecraft/world/item/BoneMealItem.java
|
|
@@ -42,20 +42,20 @@ public class BoneMealItem extends Item {
|
|
BlockPos clickedPos = context.getClickedPos();
|
|
BlockPos blockPos = clickedPos.relative(context.getClickedFace());
|
|
if (growCrop(context.getItemInHand(), level, clickedPos)) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (context.getPlayer() != null) context.getPlayer().gameEvent(GameEvent.ITEM_INTERACT_FINISH); // CraftBukkit - SPIGOT-7518
|
|
level.levelEvent(1505, clickedPos, 15);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
BlockState blockState = level.getBlockState(clickedPos);
|
|
boolean isFaceSturdy = blockState.isFaceSturdy(level, clickedPos, context.getClickedFace());
|
|
if (isFaceSturdy && growWaterPlant(context.getItemInHand(), level, blockPos, context.getClickedFace())) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (context.getPlayer() != null) context.getPlayer().gameEvent(GameEvent.ITEM_INTERACT_FINISH); // CraftBukkit - SPIGOT-7518
|
|
level.levelEvent(1505, blockPos, 15);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/item/BucketItem.java b/net/minecraft/world/item/BucketItem.java
|
|
index b820ecfbe71dd57a0f04b1c3381ffb76b0c16f16..45df21f63425236257a7dc24edb793815763a06a 100644
|
|
--- a/net/minecraft/world/item/BucketItem.java
|
|
+++ b/net/minecraft/world/item/BucketItem.java
|
|
@@ -73,9 +73,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
|
bucketPickup.getPickupSound().ifPresent(soundEvent -> player.playSound(soundEvent, 1.0F, 1.0F));
|
|
level.gameEvent(player, GameEvent.FLUID_PICKUP, blockPos);
|
|
ItemStack itemStack1 = ItemUtils.createFilledResult(itemInHand, player, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit
|
|
- if (!level.isClientSide) {
|
|
- CriteriaTriggers.FILLED_BUCKET.trigger((ServerPlayer)player, itemStack);
|
|
- }
|
|
+ CriteriaTriggers.FILLED_BUCKET.trigger((ServerPlayer)player, itemStack); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS.heldItemTransformedTo(itemStack1);
|
|
}
|
|
@@ -165,7 +163,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
|
this.playEmptySound(player, level, pos);
|
|
return true;
|
|
} else {
|
|
- if (!level.isClientSide && canBeReplaced && !blockState.liquid()) {
|
|
+ if (/*!level.isClientSide &&*/ canBeReplaced && !blockState.liquid()) { // Plazma - Remove isClientSide on DedicatedServer
|
|
level.destroyBlock(pos, true);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/item/CrossbowItem.java b/net/minecraft/world/item/CrossbowItem.java
|
|
index 1131e984fd30e40c1b99054b5db9462ffe55b5f1..e10099ae73fa495dc907990beeed58bee7a0af16 100644
|
|
--- a/net/minecraft/world/item/CrossbowItem.java
|
|
+++ b/net/minecraft/world/item/CrossbowItem.java
|
|
@@ -223,34 +223,25 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
|
|
|
@Override
|
|
public void onUseTick(Level level, LivingEntity livingEntity, ItemStack stack, int count) {
|
|
- if (!level.isClientSide) {
|
|
- CrossbowItem.ChargingSounds chargingSounds = this.getChargingSounds(stack);
|
|
- float f = (float)(stack.getUseDuration(livingEntity) - count) / getChargeDuration(stack, livingEntity);
|
|
- if (f < 0.2F) {
|
|
- this.startSoundPlayed = false;
|
|
- this.midLoadSoundPlayed = false;
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ final CrossbowItem.ChargingSounds sounds = this.getChargingSounds(stack);
|
|
+ float f = ((float) (stack.getUseDuration(livingEntity) - count)) / getChargeDuration(stack, livingEntity);
|
|
|
|
- if (f >= 0.2F && !this.startSoundPlayed) {
|
|
- this.startSoundPlayed = true;
|
|
- chargingSounds.start()
|
|
- .ifPresent(
|
|
- sound -> level.playSound(
|
|
- null, livingEntity.getX(), livingEntity.getY(), livingEntity.getZ(), sound.value(), SoundSource.PLAYERS, 0.5F, 1.0F
|
|
- )
|
|
- );
|
|
- }
|
|
+ if (f < 0.2F) {
|
|
+ this.startSoundPlayed = false;
|
|
+ this.midLoadSoundPlayed = false;
|
|
+ }
|
|
|
|
- if (f >= 0.5F && !this.midLoadSoundPlayed) {
|
|
- this.midLoadSoundPlayed = true;
|
|
- chargingSounds.mid()
|
|
- .ifPresent(
|
|
- sound -> level.playSound(
|
|
- null, livingEntity.getX(), livingEntity.getY(), livingEntity.getZ(), sound.value(), SoundSource.PLAYERS, 0.5F, 1.0F
|
|
- )
|
|
- );
|
|
- }
|
|
+ if (f >= 0.2F && !this.startSoundPlayed) {
|
|
+ this.startSoundPlayed = true;
|
|
+ sounds.start().ifPresent(sound -> level.playSound(null, livingEntity.getX(), livingEntity.getY(), livingEntity.getZ(), sound.value(), SoundSource.PLAYERS, 0.5F, 1.0F));
|
|
+ }
|
|
+
|
|
+ if (f >= 0.5F && !this.midLoadSoundPlayed) {
|
|
+ this.midLoadSoundPlayed = true;
|
|
+ sounds.mid().ifPresent(sound -> level.playSound(null, livingEntity.getX(), livingEntity.getY(), livingEntity.getZ(), sound.value(), SoundSource.PLAYERS, 0.5F, 1.0F));
|
|
}
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/item/DebugStickItem.java b/net/minecraft/world/item/DebugStickItem.java
|
|
index 51ff487fc5a00d284de88965ef5fd4fbd4b9f803..854afa85c7b6c03ceb5a1d036be1b17e0818e5e4 100644
|
|
--- a/net/minecraft/world/item/DebugStickItem.java
|
|
+++ b/net/minecraft/world/item/DebugStickItem.java
|
|
@@ -27,9 +27,7 @@ public class DebugStickItem extends Item {
|
|
|
|
@Override
|
|
public boolean canAttackBlock(BlockState state, Level level, BlockPos pos, Player player) {
|
|
- if (!level.isClientSide) {
|
|
- this.handleInteraction(player, state, level, pos, false, player.getItemInHand(InteractionHand.MAIN_HAND));
|
|
- }
|
|
+ this.handleInteraction(player, state, level, pos, false, player.getItemInHand(InteractionHand.MAIN_HAND)); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return false;
|
|
}
|
|
@@ -38,7 +36,7 @@ public class DebugStickItem extends Item {
|
|
public InteractionResult useOn(UseOnContext context) {
|
|
Player player = context.getPlayer();
|
|
Level level = context.getLevel();
|
|
- if (!level.isClientSide && player != null) {
|
|
+ if (/*!level.isClientSide &&*/ player != null) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockPos clickedPos = context.getClickedPos();
|
|
if (!this.handleInteraction(player, level.getBlockState(clickedPos), level, clickedPos, true, context.getItemInHand())) {
|
|
return InteractionResult.FAIL;
|
|
diff --git a/net/minecraft/world/item/DyeItem.java b/net/minecraft/world/item/DyeItem.java
|
|
index 427c252159cf0945835651205f0aee27e0c44f3a..16d84647650fd90c5296efad0dbdae90653b4b67 100644
|
|
--- a/net/minecraft/world/item/DyeItem.java
|
|
+++ b/net/minecraft/world/item/DyeItem.java
|
|
@@ -26,7 +26,7 @@ public class DyeItem extends Item implements SignApplicator {
|
|
public InteractionResult interactLivingEntity(ItemStack stack, Player player, LivingEntity target, InteractionHand hand) {
|
|
if (target instanceof Sheep sheep && sheep.isAlive() && !sheep.isSheared() && sheep.getColor() != this.dyeColor) {
|
|
sheep.level().playSound(player, sheep, SoundEvents.DYE_USE, SoundSource.PLAYERS, 1.0F, 1.0F);
|
|
- if (!player.level().isClientSide) {
|
|
+ //if (!player.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
sheep.setColor(this.dyeColor);
|
|
// CraftBukkit start
|
|
byte bColor = (byte) this.dyeColor.getId();
|
|
@@ -40,7 +40,7 @@ public class DyeItem extends Item implements SignApplicator {
|
|
sheep.setColor(DyeColor.byId((byte) event.getColor().getWoolData()));
|
|
// CraftBukkit end
|
|
stack.shrink(1);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/item/EmptyMapItem.java b/net/minecraft/world/item/EmptyMapItem.java
|
|
index a65534461261f90b462b57f922c6e179e419d3eb..2b72ecc3e8d35db920deda0d09b83d004c2ea262 100644
|
|
--- a/net/minecraft/world/item/EmptyMapItem.java
|
|
+++ b/net/minecraft/world/item/EmptyMapItem.java
|
|
@@ -15,9 +15,10 @@ public class EmptyMapItem extends Item {
|
|
@Override
|
|
public InteractionResult use(Level level, Player player, InteractionHand hand) {
|
|
ItemStack itemInHand = player.getItemInHand(hand);
|
|
- if (level.isClientSide) {
|
|
+ /*if (level.isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
itemInHand.consume(1, player);
|
|
player.awardStat(Stats.ITEM_USED.get(this));
|
|
player.level().playSound(null, player, SoundEvents.UI_CARTOGRAPHY_TABLE_TAKE_RESULT, player.getSoundSource(), 1.0F, 1.0F);
|
|
@@ -31,6 +32,6 @@ public class EmptyMapItem extends Item {
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/item/EnderEyeItem.java b/net/minecraft/world/item/EnderEyeItem.java
|
|
index 1bf4ec4ef42b80d14916f1f54242e136b866360a..2003db2a3bf5905b681e42d82b404a55c522c2c2 100644
|
|
--- a/net/minecraft/world/item/EnderEyeItem.java
|
|
+++ b/net/minecraft/world/item/EnderEyeItem.java
|
|
@@ -38,8 +38,10 @@ public class EnderEyeItem extends Item {
|
|
BlockState blockState = level.getBlockState(clickedPos);
|
|
if (!blockState.is(Blocks.END_PORTAL_FRAME) || blockState.getValue(EndPortalFrameBlock.HAS_EYE)) {
|
|
return InteractionResult.PASS;
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
} else if (level.isClientSide) {
|
|
return InteractionResult.SUCCESS;
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
} else {
|
|
BlockState blockState1 = blockState.setValue(EndPortalFrameBlock.HAS_EYE, true);
|
|
// Paper start
|
|
diff --git a/net/minecraft/world/item/FishingRodItem.java b/net/minecraft/world/item/FishingRodItem.java
|
|
index f700e588e89705dbb00c64b83df3793baf5d90cd..3f64812326ef1c478f9e2fb7df28f0ec75eb6135 100644
|
|
--- a/net/minecraft/world/item/FishingRodItem.java
|
|
+++ b/net/minecraft/world/item/FishingRodItem.java
|
|
@@ -23,10 +23,10 @@ public class FishingRodItem extends Item {
|
|
public InteractionResult use(Level level, Player player, InteractionHand hand) {
|
|
ItemStack itemInHand = player.getItemInHand(hand);
|
|
if (player.fishing != null) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
int i = player.fishing.retrieve(hand, itemInHand); // Paper - Add hand parameter to PlayerFishEvent
|
|
itemInHand.hurtAndBreak(i, player, LivingEntity.getSlotForHand(hand));
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
level.playSound(
|
|
null,
|
|
diff --git a/net/minecraft/world/item/FoodOnAStickItem.java b/net/minecraft/world/item/FoodOnAStickItem.java
|
|
index 40efa042f537939c68dcde547ee89e895331f7dd..f7b715e83f55312abc00c3e35fd7141875739ddc 100644
|
|
--- a/net/minecraft/world/item/FoodOnAStickItem.java
|
|
+++ b/net/minecraft/world/item/FoodOnAStickItem.java
|
|
@@ -24,9 +24,10 @@ public class FoodOnAStickItem<T extends Entity & ItemSteerable> extends Item {
|
|
@Override
|
|
public InteractionResult use(Level level, Player player, InteractionHand hand) {
|
|
ItemStack itemInHand = player.getItemInHand(hand);
|
|
- if (level.isClientSide) {
|
|
+ /*if (level.isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
return InteractionResult.PASS;
|
|
} else {
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
Entity controlledVehicle = player.getControlledVehicle();
|
|
if (player.isPassenger()
|
|
&& controlledVehicle instanceof ItemSteerable itemSteerable
|
|
@@ -39,6 +40,6 @@ public class FoodOnAStickItem<T extends Entity & ItemSteerable> extends Item {
|
|
player.awardStat(Stats.ITEM_USED.get(this));
|
|
return InteractionResult.PASS;
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/item/HangingEntityItem.java b/net/minecraft/world/item/HangingEntityItem.java
|
|
index cd9e0398876567afc337db8f6ff0ebb0ee162383..f092533f4155d884752005216f812af7856abae8 100644
|
|
--- a/net/minecraft/world/item/HangingEntityItem.java
|
|
+++ b/net/minecraft/world/item/HangingEntityItem.java
|
|
@@ -66,7 +66,7 @@ public class HangingEntityItem extends Item {
|
|
}
|
|
|
|
if (hangingEntity.survives()) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start - fire HangingPlaceEvent
|
|
org.bukkit.entity.Player who = player == null ? null : (org.bukkit.entity.Player) player.getBukkitEntity();
|
|
org.bukkit.block.Block blockClicked = org.bukkit.craftbukkit.block.CraftBlock.at(level, blockPos);
|
|
@@ -83,7 +83,7 @@ public class HangingEntityItem extends Item {
|
|
hangingEntity.playPlacementSound();
|
|
level.gameEvent(player, GameEvent.ENTITY_PLACE, hangingEntity.position());
|
|
level.addFreshEntity(hangingEntity);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
itemInHand.shrink(1);
|
|
return InteractionResult.SUCCESS;
|
|
diff --git a/net/minecraft/world/item/HoeItem.java b/net/minecraft/world/item/HoeItem.java
|
|
index acef797b884f6072ada4b9d5af53daf13273edca..8ce5c526c7035d46bdf1b82d96cd36700aa6d0f6 100644
|
|
--- a/net/minecraft/world/item/HoeItem.java
|
|
+++ b/net/minecraft/world/item/HoeItem.java
|
|
@@ -65,7 +65,7 @@ public class HoeItem extends DiggerItem {
|
|
if (predicate.test(context)) {
|
|
Player player = context.getPlayer();
|
|
if (!TILLABLES.containsKey(clickedBlock)) level.playSound(null, clickedPos, SoundEvents.HOE_TILL, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - Tool actionable options - force sound
|
|
- if (!level.isClientSide) {
|
|
+ /*if (!level.isClientSide)*/ { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
consumer.accept(context);
|
|
if (player != null) {
|
|
context.getItemInHand().hurtAndBreak(1, player, LivingEntity.getSlotForHand(context.getHand()));
|
|
diff --git a/net/minecraft/world/item/Item.java b/net/minecraft/world/item/Item.java
|
|
index 6821d39a24ef610ea8b04f6dbeca2cdc0b8e7787..d2c9c5f621e57ea4ac41ebbbd4695f13e57db875 100644
|
|
--- a/net/minecraft/world/item/Item.java
|
|
+++ b/net/minecraft/world/item/Item.java
|
|
@@ -217,7 +217,7 @@ public class Item implements FeatureElement, ItemLike {
|
|
if (tool == null) {
|
|
return false;
|
|
} else {
|
|
- if (!level.isClientSide && state.getDestroySpeed(level, pos) != 0.0F && tool.damagePerBlock() > 0) {
|
|
+ if (/*!level.isClientSide &&*/ state.getDestroySpeed(level, pos) != 0.0F && tool.damagePerBlock() > 0) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
stack.hurtAndBreak(tool.damagePerBlock(), miningEntity, EquipmentSlot.MAINHAND);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/item/ItemUtils.java b/net/minecraft/world/item/ItemUtils.java
|
|
index 9fae6d24d67337bd7f2adc1cc244b75b42ae78ce..e9bf008bf23b0e212680c325b5a23ee505a64cb1 100644
|
|
--- a/net/minecraft/world/item/ItemUtils.java
|
|
+++ b/net/minecraft/world/item/ItemUtils.java
|
|
@@ -40,7 +40,7 @@ public class ItemUtils {
|
|
|
|
public static void onContainerDestroyed(ItemEntity container, Iterable<ItemStack> contents) {
|
|
Level level = container.level();
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// Paper start - call EntityDropItemEvent
|
|
contents.forEach(itemStack -> {
|
|
ItemEntity droppedItem = new ItemEntity(level, container.getX(), container.getY(), container.getZ(), itemStack);
|
|
@@ -50,6 +50,6 @@ public class ItemUtils {
|
|
}
|
|
});
|
|
// Paper end - call EntityDropItemEvent
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/item/JukeboxPlayable.java b/net/minecraft/world/item/JukeboxPlayable.java
|
|
index 3bbfb14d22139c079ecd766a36c9a395518e9cd7..0c4c15ab034a52b40446ad6eea46c6f961428991 100644
|
|
--- a/net/minecraft/world/item/JukeboxPlayable.java
|
|
+++ b/net/minecraft/world/item/JukeboxPlayable.java
|
|
@@ -65,7 +65,7 @@ public record JukeboxPlayable(EitherHolder<JukeboxSong> song, boolean showInTool
|
|
} else {
|
|
BlockState blockState = level.getBlockState(pos);
|
|
if (blockState.is(Blocks.JUKEBOX) && !blockState.getValue(JukeboxBlock.HAS_RECORD)) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ItemStack itemStack = stack.consumeAndReturn(1, player);
|
|
if (level.getBlockEntity(pos) instanceof JukeboxBlockEntity jukeboxBlockEntity) {
|
|
jukeboxBlockEntity.setTheItem(itemStack);
|
|
@@ -73,7 +73,7 @@ public record JukeboxPlayable(EitherHolder<JukeboxSong> song, boolean showInTool
|
|
}
|
|
|
|
player.awardStat(Stats.PLAY_RECORD);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/item/KnowledgeBookItem.java b/net/minecraft/world/item/KnowledgeBookItem.java
|
|
index 958960047bba69a2cf00d7d80b53bb423fc5b294..1560c8eabe0570c0d5430a124992a77a8bc230e9 100644
|
|
--- a/net/minecraft/world/item/KnowledgeBookItem.java
|
|
+++ b/net/minecraft/world/item/KnowledgeBookItem.java
|
|
@@ -28,28 +28,29 @@ public class KnowledgeBookItem extends Item {
|
|
ItemStack itemInHand = player.getItemInHand(hand);
|
|
List<ResourceKey<Recipe<?>>> list = itemInHand.getOrDefault(DataComponents.RECIPES, List.of());
|
|
itemInHand.consume(1, player);
|
|
+
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
if (list.isEmpty()) {
|
|
return InteractionResult.FAIL;
|
|
- } else {
|
|
- if (!level.isClientSide) {
|
|
- RecipeManager recipeManager = level.getServer().getRecipeManager();
|
|
- List<RecipeHolder<?>> list1 = new ArrayList<>(list.size());
|
|
-
|
|
- for (ResourceKey<Recipe<?>> resourceKey : list) {
|
|
- Optional<RecipeHolder<?>> optional = recipeManager.byKey(resourceKey);
|
|
- if (!optional.isPresent()) {
|
|
- LOGGER.error("Invalid recipe: {}", resourceKey);
|
|
- return InteractionResult.FAIL;
|
|
- }
|
|
-
|
|
- list1.add(optional.get());
|
|
- }
|
|
-
|
|
- player.awardRecipes(list1);
|
|
- player.awardStat(Stats.ITEM_USED.get(this));
|
|
+ }
|
|
+
|
|
+ RecipeManager recipeManager = level.getServer().getRecipeManager();
|
|
+ List<RecipeHolder<?>> list1 = new ArrayList<>(list.size());
|
|
+
|
|
+ for (ResourceKey<Recipe<?>> resourceKey : list) {
|
|
+ Optional<RecipeHolder<?>> optional = recipeManager.byKey(resourceKey);
|
|
+ if (optional.isEmpty()) {
|
|
+ LOGGER.error("Invalid recipe: {}", resourceKey);
|
|
+ return InteractionResult.FAIL;
|
|
}
|
|
|
|
- return InteractionResult.SUCCESS;
|
|
+ list1.add(optional.get());
|
|
}
|
|
+
|
|
+ player.awardRecipes(list1);
|
|
+ player.awardStat(Stats.ITEM_USED.get(this));
|
|
+
|
|
+ return InteractionResult.SUCCESS;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/item/LeadItem.java b/net/minecraft/world/item/LeadItem.java
|
|
index 8c13ae2da3cf2b0979b501be5e3829da44fea45e..b8981ee1072d49e857f0e9772fead0ed800777c2 100644
|
|
--- a/net/minecraft/world/item/LeadItem.java
|
|
+++ b/net/minecraft/world/item/LeadItem.java
|
|
@@ -27,7 +27,7 @@ public class LeadItem extends Item {
|
|
BlockState blockState = level.getBlockState(clickedPos);
|
|
if (blockState.is(BlockTags.FENCES)) {
|
|
Player player = context.getPlayer();
|
|
- if (!level.isClientSide && player != null) {
|
|
+ if (/*!level.isClientSide &&*/ player != null) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
return bindPlayerMobs(player, level, clickedPos, context.getHand()); // CraftBukkit - Pass hand
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/item/MapItem.java b/net/minecraft/world/item/MapItem.java
|
|
index 309392d414ecbe60474abd0af534184740951707..edf00ca8f78b1870b71fd460ebae7f4709866d1a 100644
|
|
--- a/net/minecraft/world/item/MapItem.java
|
|
+++ b/net/minecraft/world/item/MapItem.java
|
|
@@ -271,18 +271,20 @@ public class MapItem extends Item {
|
|
|
|
@Override
|
|
public void inventoryTick(ItemStack stack, Level level, Entity entity, int itemSlot, boolean isSelected) {
|
|
- if (!level.isClientSide) {
|
|
- MapItemSavedData savedData = getSavedData(stack, level);
|
|
- if (savedData != null) {
|
|
- if (entity instanceof Player player) {
|
|
- savedData.tickCarriedBy(player, stack);
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ final MapItemSavedData saved = getSavedData(stack, level);
|
|
+ if (saved == null) {
|
|
+ return;
|
|
+ }
|
|
|
|
- if (!savedData.locked && (isSelected || entity instanceof Player && ((Player)entity).getOffhandItem() == stack)) {
|
|
- this.update(level, entity, savedData);
|
|
- }
|
|
- }
|
|
+ if (entity instanceof Player player) {
|
|
+ saved.tickCarriedBy(player, stack);
|
|
}
|
|
+
|
|
+ if (!saved.locked && (isSelected || entity instanceof Player && ((Player)entity).getOffhandItem() == stack)) {
|
|
+ this.update(level, entity, saved);
|
|
+ }
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -351,12 +353,12 @@ public class MapItem extends Item {
|
|
public InteractionResult useOn(UseOnContext context) {
|
|
BlockState blockState = context.getLevel().getBlockState(context.getClickedPos());
|
|
if (blockState.is(BlockTags.BANNERS)) {
|
|
- if (!context.getLevel().isClientSide) {
|
|
+ //if (!context.getLevel().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
MapItemSavedData savedData = getSavedData(context.getItemInHand(), context.getLevel());
|
|
if (savedData != null && !savedData.toggleBanner(context.getLevel(), context.getClickedPos())) {
|
|
return InteractionResult.FAIL;
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/item/NameTagItem.java b/net/minecraft/world/item/NameTagItem.java
|
|
index 98fa29283994ec50c15591b13331bf9ae87683c6..5dcba028f300741ea4d867825d7731ec52dc4b6b 100644
|
|
--- a/net/minecraft/world/item/NameTagItem.java
|
|
+++ b/net/minecraft/world/item/NameTagItem.java
|
|
@@ -17,7 +17,7 @@ public class NameTagItem extends Item {
|
|
public InteractionResult interactLivingEntity(ItemStack stack, Player player, LivingEntity target, InteractionHand hand) {
|
|
Component component = stack.get(DataComponents.CUSTOM_NAME);
|
|
if (component != null && target.getType().canSerialize() && target.canBeNameTagged()) {
|
|
- if (!player.level().isClientSide && target.isAlive()) {
|
|
+ if (/*!player.level().isClientSide &&*/ target.isAlive()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// Paper start - Add PlayerNameEntityEvent
|
|
io.papermc.paper.event.player.PlayerNameEntityEvent event = new io.papermc.paper.event.player.PlayerNameEntityEvent(((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity(), target.getBukkitLivingEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(stack.getHoverName()), true);
|
|
if (!event.callEvent()) return InteractionResult.PASS;
|
|
diff --git a/net/minecraft/world/item/PotionItem.java b/net/minecraft/world/item/PotionItem.java
|
|
index 84b3a8d8f6aaba043d2e1560e55641ea5b89b112..bc699110863aca621f75a4b7be13352dfe0a6849 100644
|
|
--- a/net/minecraft/world/item/PotionItem.java
|
|
+++ b/net/minecraft/world/item/PotionItem.java
|
|
@@ -51,7 +51,7 @@ public class PotionItem extends Item {
|
|
level.playSound(null, clickedPos, SoundEvents.GENERIC_SPLASH, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
player.setItemInHand(context.getHand(), ItemUtils.createFilledResult(itemInHand, player, new ItemStack(Items.GLASS_BOTTLE)));
|
|
player.awardStat(Stats.ITEM_USED.get(itemInHand.getItem()));
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ServerLevel serverLevel = (ServerLevel)level;
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
@@ -67,7 +67,7 @@ public class PotionItem extends Item {
|
|
1.0
|
|
);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
level.playSound(null, clickedPos, SoundEvents.BOTTLE_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
level.gameEvent(null, GameEvent.FLUID_PLACE, clickedPos);
|
|
diff --git a/net/minecraft/world/item/SaddleItem.java b/net/minecraft/world/item/SaddleItem.java
|
|
index 1586f0a53b1c71321105b3efd906bb7e388e2d18..2f1fc6b00d65a59d7c4da9bd618ed9490b278708 100644
|
|
--- a/net/minecraft/world/item/SaddleItem.java
|
|
+++ b/net/minecraft/world/item/SaddleItem.java
|
|
@@ -16,10 +16,10 @@ public class SaddleItem extends Item {
|
|
@Override
|
|
public InteractionResult interactLivingEntity(ItemStack stack, Player player, LivingEntity target, InteractionHand hand) {
|
|
if (target instanceof Saddleable saddleable && target.isAlive() && !saddleable.isSaddled() && saddleable.isSaddleable()) {
|
|
- if (!player.level().isClientSide) {
|
|
+ //if (!player.level().isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
saddleable.equipSaddle(stack.split(1), SoundSource.NEUTRAL);
|
|
target.level().gameEvent(target, GameEvent.EQUIP, target.position());
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/item/ScaffoldingBlockItem.java b/net/minecraft/world/item/ScaffoldingBlockItem.java
|
|
index f4973bbecb8067dc3cc6f0e1e3a170af8bb3a81a..69c9bd5e657053ea20d9cfbde63c2e06a55e607a 100644
|
|
--- a/net/minecraft/world/item/ScaffoldingBlockItem.java
|
|
+++ b/net/minecraft/world/item/ScaffoldingBlockItem.java
|
|
@@ -39,7 +39,7 @@ public class ScaffoldingBlockItem extends BlockItem {
|
|
BlockPos.MutableBlockPos mutableBlockPos = clickedPos.mutable().move(direction);
|
|
|
|
while (i < 7) {
|
|
- if (!level.isClientSide && !level.isInWorldBounds(mutableBlockPos)) {
|
|
+ if (/*!level.isClientSide &&*/ !level.isInWorldBounds(mutableBlockPos)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Player player = context.getPlayer();
|
|
int maxY = level.getMaxY();
|
|
if (player instanceof ServerPlayer && mutableBlockPos.getY() > maxY) {
|
|
diff --git a/net/minecraft/world/item/ShearsItem.java b/net/minecraft/world/item/ShearsItem.java
|
|
index 9140b41f2ffef897b74792c916e8320a9a7afb7c..5662b9a60177f3a2e37632d44d3d5ea142af4edc 100644
|
|
--- a/net/minecraft/world/item/ShearsItem.java
|
|
+++ b/net/minecraft/world/item/ShearsItem.java
|
|
@@ -44,7 +44,7 @@ public class ShearsItem extends Item {
|
|
|
|
@Override
|
|
public boolean mineBlock(ItemStack stack, Level level, BlockState state, BlockPos pos, LivingEntity entityLiving) {
|
|
- if (!level.isClientSide && !state.is(BlockTags.FIRE)) {
|
|
+ if (/*!level.isClientSide &&*/ !state.is(BlockTags.FIRE)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
stack.hurtAndBreak(1, entityLiving, EquipmentSlot.MAINHAND);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/item/ShovelItem.java b/net/minecraft/world/item/ShovelItem.java
|
|
index 5ec778fcc33d93f6aba9f76c8736398791372a4a..a1846a96e5a5e8ea46a6d628e2aa11f0353d35d6 100644
|
|
--- a/net/minecraft/world/item/ShovelItem.java
|
|
+++ b/net/minecraft/world/item/ShovelItem.java
|
|
@@ -55,9 +55,7 @@ public class ShovelItem extends DiggerItem {
|
|
// Purpur end - Tool actionable options
|
|
} else if (blockState.getBlock() instanceof CampfireBlock && blockState.getValue(CampfireBlock.LIT)) {
|
|
afterAction = () -> { // Paper
|
|
- if (!level.isClientSide()) {
|
|
- level.levelEvent(null, 1009, clickedPos, 0);
|
|
- }
|
|
+ level.levelEvent(null, 1009, clickedPos, 0); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
CampfireBlock.dowse(context.getPlayer(), level, clickedPos, blockState);
|
|
}; // Paper
|
|
@@ -65,7 +63,7 @@ public class ShovelItem extends DiggerItem {
|
|
}
|
|
|
|
if (blockState2 != null) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// Paper start
|
|
if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(context.getPlayer(), clickedPos, blockState2)) {
|
|
return InteractionResult.PASS;
|
|
@@ -77,7 +75,7 @@ public class ShovelItem extends DiggerItem {
|
|
if (player != null) {
|
|
context.getItemInHand().hurtAndBreak(1, player, LivingEntity.getSlotForHand(context.getHand()));
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/item/SignItem.java b/net/minecraft/world/item/SignItem.java
|
|
index fffac12db30d4321981959a9149cc56f8b4f6df6..24c45ef6d5e096efcdd734c38e8e5a739187d538 100644
|
|
--- a/net/minecraft/world/item/SignItem.java
|
|
+++ b/net/minecraft/world/item/SignItem.java
|
|
@@ -23,8 +23,7 @@ public class SignItem extends StandingAndWallBlockItem {
|
|
@Override
|
|
protected boolean updateCustomBlockEntityTag(BlockPos pos, Level level, @Nullable Player player, ItemStack stack, BlockState state) {
|
|
boolean flag = super.updateCustomBlockEntityTag(pos, level, player, stack, state);
|
|
- if (!level.isClientSide
|
|
- && !flag
|
|
+ if (!flag // Plazma - Remove isClientSide on DedicatedServer
|
|
&& player != null
|
|
&& level.getBlockEntity(pos) instanceof SignBlockEntity signBlockEntity
|
|
&& level.getBlockState(pos).getBlock() instanceof SignBlock signBlock) {
|
|
diff --git a/net/minecraft/world/item/SolidBucketItem.java b/net/minecraft/world/item/SolidBucketItem.java
|
|
index a3fd0b49ff147ad623dddd8a4e8937d9cf19762b..24e15df31fd62d779522bbecac2eed60d67fbfb8 100644
|
|
--- a/net/minecraft/world/item/SolidBucketItem.java
|
|
+++ b/net/minecraft/world/item/SolidBucketItem.java
|
|
@@ -40,9 +40,7 @@ public class SolidBucketItem extends BlockItem implements DispensibleContainerIt
|
|
@Override
|
|
public boolean emptyContents(@Nullable Player player, Level level, BlockPos pos, @Nullable BlockHitResult result) {
|
|
if (level.isInWorldBounds(pos) && level.isEmptyBlock(pos)) {
|
|
- if (!level.isClientSide) {
|
|
- level.setBlock(pos, this.getBlock().defaultBlockState(), 3);
|
|
- }
|
|
+ level.setBlock(pos, this.getBlock().defaultBlockState(), 3); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
level.gameEvent(player, GameEvent.FLUID_PLACE, pos);
|
|
level.playSound(player, pos, this.placeSound, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
diff --git a/net/minecraft/world/item/SpawnEggItem.java b/net/minecraft/world/item/SpawnEggItem.java
|
|
index f4728999e41ce01eefe6ce2f359a7c32a268105f..70d942693651b7eed1da47812ad023004df54553 100644
|
|
--- a/net/minecraft/world/item/SpawnEggItem.java
|
|
+++ b/net/minecraft/world/item/SpawnEggItem.java
|
|
@@ -47,64 +47,59 @@ public class SpawnEggItem extends Item {
|
|
@Override
|
|
public InteractionResult useOn(UseOnContext context) {
|
|
Level level = context.getLevel();
|
|
- if (level.isClientSide) {
|
|
- return InteractionResult.SUCCESS;
|
|
- } else {
|
|
- ItemStack itemInHand = context.getItemInHand();
|
|
- BlockPos clickedPos = context.getClickedPos();
|
|
- Direction clickedFace = context.getClickedFace();
|
|
- BlockState blockState = level.getBlockState(clickedPos);
|
|
- if (level.getBlockEntity(clickedPos) instanceof Spawner spawner) {
|
|
- if (level.paperConfig().entities.spawning.disableMobSpawnerSpawnEggTransformation) return InteractionResult.FAIL; // Paper - Allow disabling mob spawner spawn egg transformation
|
|
- EntityType<?> type = this.getType(level.registryAccess(), itemInHand);
|
|
- // Purpur start - PlayerSetSpawnerTypeWithEggEvent
|
|
- if (spawner instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity) {
|
|
- org.bukkit.block.Block bukkitBlock = level.getWorld().getBlockAt(clickedPos.getX(), clickedPos.getY(), clickedPos.getZ());
|
|
- org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent event = new org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), bukkitBlock, (org.bukkit.block.CreatureSpawner) bukkitBlock.getState(), org.bukkit.entity.EntityType.fromName(type.getName()));
|
|
- if (!event.callEvent()) {
|
|
- return InteractionResult.FAIL;
|
|
- }
|
|
- type = EntityType.getFromBukkitType(event.getEntityType());
|
|
- } else if (spawner instanceof net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity) {
|
|
- org.bukkit.block.Block bukkitBlock = level.getWorld().getBlockAt(clickedPos.getX(), clickedPos.getY(), clickedPos.getZ());
|
|
- org.purpurmc.purpur.event.PlayerSetTrialSpawnerTypeWithEggEvent event = new org.purpurmc.purpur.event.PlayerSetTrialSpawnerTypeWithEggEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), bukkitBlock, (org.bukkit.block.TrialSpawner) bukkitBlock.getState(), org.bukkit.entity.EntityType.fromName(type.getName()));
|
|
- if (!event.callEvent()) {
|
|
- return InteractionResult.FAIL;
|
|
- }
|
|
- type = EntityType.getFromBukkitType(event.getEntityType());
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ final ItemStack itemInHand = context.getItemInHand();
|
|
+ final BlockPos clickedPos = context.getClickedPos();
|
|
+ final Direction clickedFace = context.getClickedFace();
|
|
+ final BlockState blockState = level.getBlockState(clickedPos);
|
|
+
|
|
+ if (level.getBlockEntity(clickedPos) instanceof Spawner spawner) {
|
|
+ if (level.paperConfig().entities.spawning.disableMobSpawnerSpawnEggTransformation) { // Paper - Allow disabling mob spawner spawn egg transformation
|
|
+ return InteractionResult.FAIL;
|
|
+ }
|
|
+
|
|
+ EntityType<?> type = this.getType(level.registryAccess(), itemInHand);
|
|
+ // Purpur start - PlayerSetSpawnerTypeWithEggEvent
|
|
+ if (spawner instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity) {
|
|
+ org.bukkit.block.Block bukkitBlock = level.getWorld().getBlockAt(clickedPos.getX(), clickedPos.getY(), clickedPos.getZ());
|
|
+ org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent event = new org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), bukkitBlock, (org.bukkit.block.CreatureSpawner) bukkitBlock.getState(), org.bukkit.entity.EntityType.fromName(type.getName()));
|
|
+ if (!event.callEvent()) {
|
|
+ return InteractionResult.FAIL;
|
|
}
|
|
- // Purpur end - PlayerSetSpawnerTypeWithEggEvent
|
|
- spawner.setEntityId(type, level.getRandom());
|
|
- level.sendBlockUpdated(clickedPos, blockState, blockState, 3);
|
|
- level.gameEvent(context.getPlayer(), GameEvent.BLOCK_CHANGE, clickedPos);
|
|
- itemInHand.shrink(1);
|
|
- return InteractionResult.SUCCESS;
|
|
- } else {
|
|
- BlockPos blockPos;
|
|
- if (blockState.getCollisionShape(level, clickedPos).isEmpty()) {
|
|
- blockPos = clickedPos;
|
|
- } else {
|
|
- blockPos = clickedPos.relative(clickedFace);
|
|
+ type = EntityType.getFromBukkitType(event.getEntityType());
|
|
+ } else if (spawner instanceof net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity) {
|
|
+ org.bukkit.block.Block bukkitBlock = level.getWorld().getBlockAt(clickedPos.getX(), clickedPos.getY(), clickedPos.getZ());
|
|
+ org.purpurmc.purpur.event.PlayerSetTrialSpawnerTypeWithEggEvent event = new org.purpurmc.purpur.event.PlayerSetTrialSpawnerTypeWithEggEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), bukkitBlock, (org.bukkit.block.TrialSpawner) bukkitBlock.getState(), org.bukkit.entity.EntityType.fromName(type.getName()));
|
|
+ if (!event.callEvent()) {
|
|
+ return InteractionResult.FAIL;
|
|
}
|
|
+ type = EntityType.getFromBukkitType(event.getEntityType());
|
|
+ }
|
|
+ // Purpur end - PlayerSetSpawnerTypeWithEggEvent
|
|
|
|
- EntityType<?> type = this.getType(level.registryAccess(), itemInHand);
|
|
- if (type.spawn(
|
|
- (ServerLevel)level,
|
|
- itemInHand,
|
|
- context.getPlayer(),
|
|
- blockPos,
|
|
- EntitySpawnReason.SPAWN_ITEM_USE,
|
|
- true,
|
|
- !Objects.equals(clickedPos, blockPos) && clickedFace == Direction.UP
|
|
- )
|
|
- != null) {
|
|
- itemInHand.shrink(1);
|
|
- level.gameEvent(context.getPlayer(), GameEvent.ENTITY_PLACE, clickedPos);
|
|
- }
|
|
+ spawner.setEntityId(type, level.getRandom());
|
|
+ level.sendBlockUpdated(clickedPos, blockState, blockState, 3);
|
|
+ level.gameEvent(context.getPlayer(), GameEvent.BLOCK_CHANGE, clickedPos);
|
|
+ itemInHand.shrink(1);
|
|
|
|
- return InteractionResult.SUCCESS;
|
|
- }
|
|
+ return InteractionResult.SUCCESS;
|
|
+ }
|
|
+
|
|
+ final BlockPos blockPos;
|
|
+ if (blockState.getCollisionShape(level, clickedPos).isEmpty()) {
|
|
+ blockPos = clickedPos;
|
|
+ } else {
|
|
+ blockPos = clickedPos.relative(clickedFace);
|
|
+ }
|
|
+
|
|
+ final EntityType<?> type = this.getType(level.registryAccess(), itemInHand);
|
|
+ if (type.spawn((ServerLevel) level, itemInHand, context.getPlayer(), blockPos, EntitySpawnReason.SPAWN_ITEM_USE, true, !Objects.equals(clickedPos, blockPos) && clickedFace == Direction.UP) != null) {
|
|
+ itemInHand.shrink(1);
|
|
+ level.gameEvent(context.getPlayer(), GameEvent.ENTITY_PLACE, clickedPos);
|
|
}
|
|
+
|
|
+ return InteractionResult.SUCCESS;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/item/component/Consumable.java b/net/minecraft/world/item/component/Consumable.java
|
|
index bab1b98f6d51d867fbe986e731d8a6b2ff00573b..cd1897dd9a7ea209e4368cc0d8063cdd322dd011 100644
|
|
--- a/net/minecraft/world/item/component/Consumable.java
|
|
+++ b/net/minecraft/world/item/component/Consumable.java
|
|
@@ -83,7 +83,7 @@ public record Consumable(
|
|
}
|
|
|
|
stack.getAllOfType(ConsumableListener.class).forEach(consumableListener -> consumableListener.onConsume(level, entity, stack, this));
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
org.bukkit.event.entity.EntityPotionEffectEvent.Cause cause;
|
|
if (stack.is(net.minecraft.world.item.Items.MILK_BUCKET)) {
|
|
@@ -96,7 +96,7 @@ public record Consumable(
|
|
|
|
this.onConsumeEffects.forEach(consumeEffect -> consumeEffect.apply(level, stack, entity, cause));
|
|
// CraftBukkit end
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
entity.gameEvent(this.animation == ItemUseAnimation.DRINK ? GameEvent.DRINK : GameEvent.EAT);
|
|
stack.consume(1, entity);
|
|
diff --git a/net/minecraft/world/item/equipment/Equippable.java b/net/minecraft/world/item/equipment/Equippable.java
|
|
index 8c4b15b072d299082c14fcbdc8f753f57fdaa6b2..13d670bfca586be36ff58fcba4d277c9503d8414 100644
|
|
--- a/net/minecraft/world/item/equipment/Equippable.java
|
|
+++ b/net/minecraft/world/item/equipment/Equippable.java
|
|
@@ -86,9 +86,7 @@ public record Equippable(
|
|
ItemStack itemBySlot = player.getItemBySlot(this.slot);
|
|
if ((!EnchantmentHelper.has(itemBySlot, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE) || player.isCreative())
|
|
&& !ItemStack.isSameItemSameComponents(stack, itemBySlot)) {
|
|
- if (!player.level().isClientSide()) {
|
|
- player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
|
|
- }
|
|
+ player.awardStat(Stats.ITEM_USED.get(stack.getItem())); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (stack.getCount() <= 1) {
|
|
ItemStack itemStack = itemBySlot.isEmpty() ? stack : itemBySlot.copyAndClear();
|
|
diff --git a/net/minecraft/world/item/trading/Merchant.java b/net/minecraft/world/item/trading/Merchant.java
|
|
index 24e93da7b46ec01a88c468d25b2b6cccc0d50f0e..5be4c4b7abf3d2cfb16ac64be8ba7e7482c1a648 100644
|
|
--- a/net/minecraft/world/item/trading/Merchant.java
|
|
+++ b/net/minecraft/world/item/trading/Merchant.java
|
|
@@ -48,7 +48,7 @@ public interface Merchant {
|
|
}
|
|
}
|
|
|
|
- boolean isClientSide();
|
|
+ //boolean isClientSide(); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
boolean stillValid(Player player);
|
|
|
|
diff --git a/net/minecraft/world/level/BaseCommandBlock.java b/net/minecraft/world/level/BaseCommandBlock.java
|
|
index a67d40eb4bfa85888af8bf027a8859378d290cfa..b502b8615266f85f018b5ed83f39ed5fd4967813 100644
|
|
--- a/net/minecraft/world/level/BaseCommandBlock.java
|
|
+++ b/net/minecraft/world/level/BaseCommandBlock.java
|
|
@@ -114,7 +114,7 @@ public abstract class BaseCommandBlock implements CommandSource {
|
|
}
|
|
|
|
public boolean performCommand(Level level) {
|
|
- if (level.isClientSide || level.getGameTime() == this.lastExecution) {
|
|
+ if (/*level.isClientSide ||*/ level.getGameTime() == this.lastExecution) { // Plazma - Remove isClientSide on DedicatedServer
|
|
return false;
|
|
} else if ("Searge".equalsIgnoreCase(this.command)) {
|
|
this.lastOutput = Component.literal("#itzlipofutzli");
|
|
@@ -193,9 +193,10 @@ public abstract class BaseCommandBlock implements CommandSource {
|
|
if (!player.canUseGameMasterBlocks() && (!player.isCreative() || !player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
|
|
return InteractionResult.PASS;
|
|
} else {
|
|
- if (player.getCommandSenderWorld().isClientSide) {
|
|
+ /*if (player.getCommandSenderWorld().isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
player.openMinecartCommandBlock(this);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/BaseSpawner.java b/net/minecraft/world/level/BaseSpawner.java
|
|
index 8de482367f3d9d91048b7c85cbaefcda9f9fbcdc..05f1d1590d87c3548c724970eb82afda56932bf8 100644
|
|
--- a/net/minecraft/world/level/BaseSpawner.java
|
|
+++ b/net/minecraft/world/level/BaseSpawner.java
|
|
@@ -56,6 +56,7 @@ public abstract class BaseSpawner {
|
|
return level.hasNearbyAlivePlayerThatAffectsSpawning(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, this.requiredPlayerRange); // Paper - Affects Spawning API
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public void clientTick(Level level, BlockPos pos) {
|
|
if (!this.isNearPlayer(level, pos)) {
|
|
this.oSpin = this.spin;
|
|
@@ -74,6 +75,7 @@ public abstract class BaseSpawner {
|
|
this.spin = (this.spin + 1000.0F / (this.spawnDelay + 200.0F)) % 360.0;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public void serverTick(ServerLevel serverLevel, BlockPos pos) {
|
|
if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick
|
|
@@ -322,15 +324,7 @@ public abstract class BaseSpawner {
|
|
}
|
|
|
|
public boolean onEventTriggered(Level level, int id) {
|
|
- if (id == 1) {
|
|
- if (level.isClientSide) {
|
|
- this.spawnDelay = this.minSpawnDelay;
|
|
- }
|
|
-
|
|
- return true;
|
|
- } else {
|
|
- return false;
|
|
- }
|
|
+ return id == 1; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public void setNextSpawnData(@Nullable Level level, BlockPos pos, SpawnData nextSpawnData) {
|
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
|
index d350909d37966ecb9e55bf7706b675a18c76e49d..df28a59ef9f233916d5d32aea7aa1b6bedb36a58 100644
|
|
--- a/net/minecraft/world/level/Level.java
|
|
+++ b/net/minecraft/world/level/Level.java
|
|
@@ -126,7 +126,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
|
|
private final Holder<DimensionType> dimensionTypeRegistration;
|
|
public final WritableLevelData levelData;
|
|
- public final boolean isClientSide;
|
|
+ //public final boolean isClientSide; // Plazma - Remove isClientSide on DedicatedServer
|
|
private final WorldBorder worldBorder;
|
|
private final BiomeManager biomeManager;
|
|
private final ResourceKey<Level> dimension;
|
|
@@ -872,7 +872,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
ResourceKey<Level> dimension,
|
|
RegistryAccess registryAccess,
|
|
Holder<DimensionType> dimensionTypeRegistration,
|
|
- boolean isClientSide,
|
|
+ //boolean isClientSide, // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean isDebug,
|
|
long biomeZoomSeed,
|
|
int maxChainedNeighborUpdates,
|
|
@@ -912,7 +912,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
this.dimensionTypeRegistration = dimensionTypeRegistration;
|
|
final DimensionType dimensionType = dimensionTypeRegistration.value();
|
|
this.dimension = dimension;
|
|
- this.isClientSide = isClientSide;
|
|
+ //this.isClientSide = isClientSide; // Plazma - Remove isClientSide on DedicatedServer
|
|
if (dimensionType.coordinateScale() != 1.0) {
|
|
this.worldBorder = new WorldBorder() {
|
|
@Override
|
|
@@ -1018,10 +1018,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
}
|
|
// Paper end - Cancel hit for vanished players
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public boolean isClientSide() {
|
|
return this.isClientSide;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Nullable
|
|
@Override
|
|
@@ -1164,7 +1166,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
return false;
|
|
}
|
|
|
|
- if (!this.isClientSide && this.isDebug()) {
|
|
+ if (/*!this.isClientSide &&*/ this.isDebug()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
return false;
|
|
}
|
|
|
|
@@ -1223,13 +1225,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
this.setBlocksDirty(blockPos, oldBlock, actualBlock);
|
|
}
|
|
|
|
- if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || (chunk.getFullStatus() != null && chunk.getFullStatus().isOrAfter(FullChunkStatus.FULL)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement // Paper - rewrite chunk system - change from ticking to full
|
|
+ if ((i & 2) != 0 && (/*!this.isClientSide || (i & 4) == 0) && (this.isClientSide ||*/ chunk == null || (chunk.getFullStatus() != null && chunk.getFullStatus().isOrAfter(FullChunkStatus.FULL)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement // Paper - rewrite chunk system - change from ticking to full // Plazma - Remove isClientSide on DedicatedServer
|
|
this.sendBlockUpdated(blockPos, oldBlock, newBlock, i);
|
|
}
|
|
|
|
if ((i & 1) != 0) {
|
|
this.blockUpdated(blockPos, oldBlock.getBlock());
|
|
- if (!this.isClientSide && newBlock.hasAnalogOutputSignal()) {
|
|
+ if (/*!this.isClientSide &&*/ newBlock.hasAnalogOutputSignal()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.updateNeighbourForOutputSignal(blockPos, newBlock.getBlock());
|
|
}
|
|
}
|
|
@@ -1445,6 +1447,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
this.playSeededSound(player, entity, BuiltInRegistries.SOUND_EVENT.wrapAsHolder(event), category, volume, pitch, this.threadSafeRandom.nextLong());
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public void playLocalSound(BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) {
|
|
this.playLocalSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, sound, category, volume, pitch, distanceDelay);
|
|
}
|
|
@@ -1454,6 +1457,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
|
|
public void playLocalSound(double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) {
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void addParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
|
|
@@ -1680,7 +1684,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
if (this.isOutsideBuildHeight(pos)) {
|
|
return null;
|
|
} else {
|
|
- return !this.isClientSide && !ca.spottedleaf.moonrise.common.util.TickThread.isTickThread() // Paper - rewrite chunk system
|
|
+ return /*!this.isClientSide &&*/ !ca.spottedleaf.moonrise.common.util.TickThread.isTickThread() // Paper - rewrite chunk system // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
? null
|
|
: this.getChunkAt(pos).getBlockEntity(pos, LevelChunk.EntityCreationType.IMMEDIATE);
|
|
}
|
|
@@ -2037,9 +2041,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
return this.worldBorder;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public void sendPacketToServer(Packet<?> packet) {
|
|
throw new UnsupportedOperationException("Can't send packets to server unless you're on the client.");
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public DimensionType dimensionType() {
|
|
diff --git a/net/minecraft/world/level/LevelReader.java b/net/minecraft/world/level/LevelReader.java
|
|
index 26c8c1e5598daf3550aef05b12218c47bda6618b..2239ff6fff38160fd7a0e11887d56859e89229e1 100644
|
|
--- a/net/minecraft/world/level/LevelReader.java
|
|
+++ b/net/minecraft/world/level/LevelReader.java
|
|
@@ -76,7 +76,7 @@ public interface LevelReader extends ca.spottedleaf.moonrise.patches.chunk_syste
|
|
|
|
Holder<Biome> getUncachedNoiseBiome(int x, int y, int z);
|
|
|
|
- boolean isClientSide();
|
|
+ //boolean isClientSide(); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
int getSeaLevel();
|
|
|
|
diff --git a/net/minecraft/world/level/block/AbstractCandleBlock.java b/net/minecraft/world/level/block/AbstractCandleBlock.java
|
|
index 484519183837e2051e0728c52560b86ff7baafe3..c354612806933e0317e4aadbdb63b7d12d3ebf07 100644
|
|
--- a/net/minecraft/world/level/block/AbstractCandleBlock.java
|
|
+++ b/net/minecraft/world/level/block/AbstractCandleBlock.java
|
|
@@ -43,7 +43,7 @@ public abstract class AbstractCandleBlock extends Block {
|
|
|
|
@Override
|
|
protected void onProjectileHit(Level level, BlockState state, BlockHitResult hit, Projectile projectile) {
|
|
- if (!level.isClientSide && projectile.isOnFire() && this.canBeLit(state)) {
|
|
+ if (/*!level.isClientSide &&*/ projectile.isOnFire() && this.canBeLit(state)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// CraftBukkit start
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(level, hit.getBlockPos(), projectile).isCancelled()) {
|
|
return;
|
|
@@ -57,6 +57,7 @@ public abstract class AbstractCandleBlock extends Block {
|
|
return !state.getValue(LIT);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(LIT)) {
|
|
@@ -84,6 +85,7 @@ public abstract class AbstractCandleBlock extends Block {
|
|
|
|
level.addParticle(ParticleTypes.SMALL_FLAME, offset.x, offset.y, offset.z, 0.0, 0.0, 0.0);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static void extinguish(@Nullable Player player, BlockState state, LevelAccessor level, BlockPos pos) {
|
|
setLit(level, state, pos, false);
|
|
diff --git a/net/minecraft/world/level/block/AbstractFurnaceBlock.java b/net/minecraft/world/level/block/AbstractFurnaceBlock.java
|
|
index 4d86ec41ee0cd32d7be90e32b1387473444c5159..376e7402cabe3045356a4cdbd859bd2cc37f4741 100644
|
|
--- a/net/minecraft/world/level/block/AbstractFurnaceBlock.java
|
|
+++ b/net/minecraft/world/level/block/AbstractFurnaceBlock.java
|
|
@@ -38,9 +38,7 @@ public abstract class AbstractFurnaceBlock extends BaseEntityBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide) {
|
|
- this.openContainer(level, pos, player);
|
|
- }
|
|
+ this.openContainer(level, pos, player); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/AbstractSkullBlock.java b/net/minecraft/world/level/block/AbstractSkullBlock.java
|
|
index ab8c39457a4b0167ee9f486a9c43591adf95f538..5d4d41ecdfa61011239c5c09edd0bb877bb801f4 100644
|
|
--- a/net/minecraft/world/level/block/AbstractSkullBlock.java
|
|
+++ b/net/minecraft/world/level/block/AbstractSkullBlock.java
|
|
@@ -38,7 +38,7 @@ public abstract class AbstractSkullBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- if (level.isClientSide) {
|
|
+ /*if (level.isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean flag = state.is(Blocks.DRAGON_HEAD)
|
|
|| state.is(Blocks.DRAGON_WALL_HEAD)
|
|
|| state.is(Blocks.PIGLIN_HEAD)
|
|
@@ -47,6 +47,7 @@ public abstract class AbstractSkullBlock extends BaseEntityBlock {
|
|
return createTickerHelper(blockEntityType, BlockEntityType.SKULL, SkullBlockEntity::animation);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return null;
|
|
}
|
|
@@ -72,11 +73,11 @@ public abstract class AbstractSkullBlock extends BaseEntityBlock {
|
|
|
|
@Override
|
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean hasNeighborSignal = level.hasNeighborSignal(pos);
|
|
if (hasNeighborSignal != state.getValue(POWERED)) {
|
|
level.setBlock(pos, state.setValue(POWERED, hasNeighborSignal), 2);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/AmethystBlock.java b/net/minecraft/world/level/block/AmethystBlock.java
|
|
index f9eb3bf4767d8acf5cd5166a30dee6fcd3ac782b..e692fb59f448c7bd71f934a5bfad92954ce026f5 100644
|
|
--- a/net/minecraft/world/level/block/AmethystBlock.java
|
|
+++ b/net/minecraft/world/level/block/AmethystBlock.java
|
|
@@ -24,9 +24,9 @@ public class AmethystBlock extends Block {
|
|
|
|
@Override
|
|
protected void onProjectileHit(Level level, BlockState state, BlockHitResult hit, Projectile projectile) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockPos blockPos = hit.getBlockPos();
|
|
level.playSound(null, blockPos, SoundEvents.AMETHYST_BLOCK_CHIME, SoundSource.BLOCKS, 1.0F, 0.5F + level.random.nextFloat() * 1.2F);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/AnvilBlock.java b/net/minecraft/world/level/block/AnvilBlock.java
|
|
index c2eaacb4657d7329cc16e4f3d36fa545c7e4c2b7..659fbcdc48c9649bd0fc61addf6ea7bbfd0c4046 100644
|
|
--- a/net/minecraft/world/level/block/AnvilBlock.java
|
|
+++ b/net/minecraft/world/level/block/AnvilBlock.java
|
|
@@ -108,11 +108,7 @@ public class AnvilBlock extends FallingBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide) {
|
|
- if (player.openMenu(state.getMenuProvider(level, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
- player.awardStat(Stats.INTERACT_WITH_ANVIL);
|
|
- } // Paper - Fix InventoryOpenEvent cancellation
|
|
- }
|
|
+ player.openMenu(state.getMenuProvider(level, pos)).ifPresent(ignore -> player.awardStat(Stats.INTERACT_WITH_ANVIL)); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/BaseFireBlock.java b/net/minecraft/world/level/block/BaseFireBlock.java
|
|
index 45df9f008b74dd0d6d790c91102e9afe1da45633..0881304061231aa71a17cf939f5c8bcf8253f07b 100644
|
|
--- a/net/minecraft/world/level/block/BaseFireBlock.java
|
|
+++ b/net/minecraft/world/level/block/BaseFireBlock.java
|
|
@@ -53,6 +53,7 @@ public abstract class BaseFireBlock extends Block {
|
|
return DOWN_AABB;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (random.nextInt(24) == 0) {
|
|
@@ -124,6 +125,7 @@ public abstract class BaseFireBlock extends Block {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
protected abstract boolean canBurn(BlockState state);
|
|
|
|
@@ -185,9 +187,7 @@ public abstract class BaseFireBlock extends Block {
|
|
|
|
@Override
|
|
public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) {
|
|
- if (!level.isClientSide()) {
|
|
- level.levelEvent(null, 1009, pos, 0);
|
|
- }
|
|
+ level.levelEvent(null, 1009, pos, 0); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return super.playerWillDestroy(level, pos, state, player);
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/BasePressurePlateBlock.java b/net/minecraft/world/level/block/BasePressurePlateBlock.java
|
|
index 108c1d23bf80777b943edfa0b5585ebb928540a7..af97e7611b9118e05d9a45ae3373cf765cb1cebe 100644
|
|
--- a/net/minecraft/world/level/block/BasePressurePlateBlock.java
|
|
+++ b/net/minecraft/world/level/block/BasePressurePlateBlock.java
|
|
@@ -82,12 +82,12 @@ public abstract class BasePressurePlateBlock extends Block {
|
|
@Override
|
|
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
|
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
int signalForState = this.getSignalForState(state);
|
|
if (signalForState == 0) {
|
|
this.checkPressed(entity, level, pos, state, signalForState);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private void checkPressed(@Nullable Entity entity, Level level, BlockPos pos, BlockState state, int currentSignal) {
|
|
diff --git a/net/minecraft/world/level/block/BaseRailBlock.java b/net/minecraft/world/level/block/BaseRailBlock.java
|
|
index 0bda61a031fff2a01fd03fd52129f4e3733b9d1f..4236d522c15cbc1b391665254597e4f84ed5054a 100644
|
|
--- a/net/minecraft/world/level/block/BaseRailBlock.java
|
|
+++ b/net/minecraft/world/level/block/BaseRailBlock.java
|
|
@@ -79,7 +79,7 @@ public abstract class BaseRailBlock extends Block implements SimpleWaterloggedBl
|
|
|
|
@Override
|
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
|
- if (!level.isClientSide && level.getBlockState(pos).is(this)) {
|
|
+ if (/*!level.isClientSide &&*/ level.getBlockState(pos).is(this)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
RailShape railShape = state.getValue(this.getShapeProperty());
|
|
if (shouldBeRemoved(pos, level, railShape)) {
|
|
dropResources(state, level, pos);
|
|
@@ -113,12 +113,7 @@ public abstract class BaseRailBlock extends Block implements SimpleWaterloggedBl
|
|
}
|
|
|
|
protected BlockState updateDir(Level level, BlockPos pos, BlockState state, boolean alwaysPlace) {
|
|
- if (level.isClientSide) {
|
|
- return state;
|
|
- } else {
|
|
- RailShape railShape = state.getValue(this.getShapeProperty());
|
|
- return new RailState(level, pos, state).place(level.hasNeighborSignal(pos), alwaysPlace, railShape).getState();
|
|
- }
|
|
+ return new RailState(level, pos, state).place(level.hasNeighborSignal(pos), alwaysPlace, state.getValue(this.getShapeProperty())).getState(); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/BeaconBlock.java b/net/minecraft/world/level/block/BeaconBlock.java
|
|
index 66eee067b4ffdd72393ca813de995062be5b7a90..efe8d910403bd46db96f93ba230bd652720ae2f9 100644
|
|
--- a/net/minecraft/world/level/block/BeaconBlock.java
|
|
+++ b/net/minecraft/world/level/block/BeaconBlock.java
|
|
@@ -46,7 +46,7 @@ public class BeaconBlock extends BaseEntityBlock implements BeaconBeamBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide && level.getBlockEntity(pos) instanceof BeaconBlockEntity beaconBlockEntity && player.openMenu(beaconBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
+ if (/*!level.isClientSide &&*/ level.getBlockEntity(pos) instanceof BeaconBlockEntity beaconBlockEntity && player.openMenu(beaconBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
player.awardStat(Stats.INTERACT_WITH_BEACON);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/level/block/BedBlock.java b/net/minecraft/world/level/block/BedBlock.java
|
|
index e242c616ed481f8809d043d0b629f73a3037e19f..815bc4eb94c01f59ef979b496ef6b9f0479daae6 100644
|
|
--- a/net/minecraft/world/level/block/BedBlock.java
|
|
+++ b/net/minecraft/world/level/block/BedBlock.java
|
|
@@ -81,61 +81,54 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (level.isClientSide) {
|
|
- return InteractionResult.SUCCESS_SERVER;
|
|
- } else {
|
|
- if (state.getValue(PART) != BedPart.HEAD) {
|
|
- pos = pos.relative(state.getValue(FACING));
|
|
- state = level.getBlockState(pos);
|
|
- if (!state.is(this)) {
|
|
- return InteractionResult.CONSUME;
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (state.getValue(PART) != BedPart.HEAD) {
|
|
+ pos = pos.relative(state.getValue(FACING));
|
|
+ state = level.getBlockState(pos);
|
|
+ if (!state.is(this)) {
|
|
+ return InteractionResult.CONSUME;
|
|
}
|
|
+ }
|
|
|
|
- if (false && !canSetSpawn(level)) { // CraftBukkit - moved world and biome check into Player
|
|
- level.removeBlock(pos, false);
|
|
- BlockPos blockPos = pos.relative(state.getValue(FACING).getOpposite());
|
|
- if (level.getBlockState(blockPos).is(this)) {
|
|
- level.removeBlock(blockPos, false);
|
|
- }
|
|
-
|
|
- Vec3 center = pos.getCenter();
|
|
- if (level.purpurConfig.bedExplode) level.explode(null, level.damageSources().badRespawnPointExplosion(center), null, center, (float) level.purpurConfig.bedExplosionPower, level.purpurConfig.bedExplosionFire, level.purpurConfig.bedExplosionEffect); // Purpur - Implement bed explosion options
|
|
- return InteractionResult.SUCCESS_SERVER;
|
|
- } else if (state.getValue(OCCUPIED)) {
|
|
- if (!BedBlock.canSetSpawn(level)) return this.explodeBed(state, level, pos); // Paper - check explode first
|
|
- if (!this.kickVillagerOutOfBed(level, pos)) {
|
|
- player.displayClientMessage(Component.translatable("block.minecraft.bed.occupied"), true);
|
|
- }
|
|
+ if (state.getValue(OCCUPIED)) {
|
|
+ if (!BedBlock.canSetSpawn(level)) { // Paper - check explodes first
|
|
+ return this.explodeBed(state, level, pos);
|
|
+ }
|
|
|
|
- return InteractionResult.SUCCESS_SERVER;
|
|
- } else {
|
|
- // CraftBukkit start
|
|
- final BlockState finalBlockState = state;
|
|
- final BlockPos finalBlockPos = pos;
|
|
- // CraftBukkit end
|
|
- player.startSleepInBed(pos).ifLeft(bedSleepingProblem -> {
|
|
- // Paper start - PlayerBedFailEnterEvent
|
|
- if (bedSleepingProblem != null) {
|
|
- io.papermc.paper.event.player.PlayerBedFailEnterEvent event = new io.papermc.paper.event.player.PlayerBedFailEnterEvent((org.bukkit.entity.Player) player.getBukkitEntity(), io.papermc.paper.event.player.PlayerBedFailEnterEvent.FailReason.values()[bedSleepingProblem.ordinal()], org.bukkit.craftbukkit.block.CraftBlock.at(level, finalBlockPos), !level.dimensionType().bedWorks(), io.papermc.paper.adventure.PaperAdventure.asAdventure(bedSleepingProblem.getMessage()));
|
|
- if (!event.callEvent()) {
|
|
- return;
|
|
- }
|
|
- // Paper end - PlayerBedFailEnterEvent
|
|
- // CraftBukkit start - handling bed explosion from below here
|
|
- if (event.getWillExplode()) { // Paper - PlayerBedFailEnterEvent
|
|
- this.explodeBed(finalBlockState, level, finalBlockPos);
|
|
- } else
|
|
- // CraftBukkit end
|
|
- if (bedSleepingProblem.getMessage() != null) {
|
|
- final net.kyori.adventure.text.Component message = event.getMessage(); // Paper - PlayerBedFailEnterEvent
|
|
- if (message != null) player.displayClientMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message), true); // Paper - PlayerBedFailEnterEvent
|
|
- }
|
|
- } // Paper - PlayerBedFailEnterEvent
|
|
- });
|
|
- return InteractionResult.SUCCESS_SERVER;
|
|
+ if (!this.kickVillagerOutOfBed(level, pos)) {
|
|
+ player.displayClientMessage(Component.translatable("block.minecraft.bed.occupied"), true);
|
|
}
|
|
+
|
|
+ return InteractionResult.SUCCESS_SERVER;
|
|
}
|
|
+
|
|
+ // CraftBukkit start
|
|
+ final BlockState finalBlockState = state;
|
|
+ final BlockPos finalBlockPos = pos;
|
|
+ // CraftBukkit end
|
|
+
|
|
+ player.startSleepInBed(pos).ifLeft(bedSleepingProblem -> {
|
|
+ // Paper start - PlayerBedFailEnterEvent
|
|
+ if (bedSleepingProblem == null) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ io.papermc.paper.event.player.PlayerBedFailEnterEvent event = new io.papermc.paper.event.player.PlayerBedFailEnterEvent((org.bukkit.entity.Player) player.getBukkitEntity(), io.papermc.paper.event.player.PlayerBedFailEnterEvent.FailReason.values()[bedSleepingProblem.ordinal()], org.bukkit.craftbukkit.block.CraftBlock.at(level, finalBlockPos), !level.dimensionType().bedWorks(), io.papermc.paper.adventure.PaperAdventure.asAdventure(bedSleepingProblem.getMessage()));
|
|
+ if (!event.callEvent()) {
|
|
+ return;
|
|
+ }
|
|
+ // Paper end - PlayerBedFailEnterEvent
|
|
+
|
|
+ // CraftBukkit start - handling bed explosion from below here
|
|
+ if (event.getWillExplode()) { // Paper - PlayerBedFailEnterEvent
|
|
+ this.explodeBed(finalBlockState, level, finalBlockPos);
|
|
+ } else /* CraftBukkit end */ if (bedSleepingProblem.getMessage() != null) {
|
|
+ final net.kyori.adventure.text.Component message = event.getMessage(); // Paper - PlayerBedFailEnterEvent
|
|
+ if (message != null) player.displayClientMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message), true); // Paper - PlayerBedFailEnterEvent
|
|
+ }
|
|
+ });
|
|
+ return InteractionResult.SUCCESS_SERVER;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
// CraftBukkit start - Copied from the above method
|
|
@@ -215,7 +208,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
|
|
|
@Override
|
|
public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) {
|
|
- if (!level.isClientSide && player.isCreative()) {
|
|
+ if (/*!level.isClientSide &&*/ player.isCreative()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BedPart bedPart = state.getValue(PART);
|
|
if (bedPart == BedPart.FOOT) {
|
|
BlockPos blockPos = pos.relative(getNeighbourDirection(bedPart, state.getValue(FACING)));
|
|
@@ -342,7 +335,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
|
@Override
|
|
public void setPlacedBy(Level level, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) {
|
|
super.setPlacedBy(level, pos, state, placer, stack);
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockPos blockPos = pos.relative(state.getValue(FACING));
|
|
level.setBlock(blockPos, state.setValue(PART, BedPart.HEAD), 3);
|
|
// CraftBukkit start - SPIGOT-7315: Don't updated if we capture block states
|
|
@@ -352,7 +345,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
|
// CraftBukkit end
|
|
level.blockUpdated(pos, Blocks.AIR);
|
|
state.updateNeighbourShapes(level, pos, 3);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public DyeColor getColor() {
|
|
diff --git a/net/minecraft/world/level/block/BeehiveBlock.java b/net/minecraft/world/level/block/BeehiveBlock.java
|
|
index 8da3a058443a2b54f1d75344e086fbea54261855..8aa44d6fc377c413ed7849818f42352ef7f7ce7c 100644
|
|
--- a/net/minecraft/world/level/block/BeehiveBlock.java
|
|
+++ b/net/minecraft/world/level/block/BeehiveBlock.java
|
|
@@ -93,7 +93,7 @@ public class BeehiveBlock extends BaseEntityBlock {
|
|
@Override
|
|
public void playerDestroy(Level level, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity te, ItemStack stack, boolean includeDrops, boolean dropExp) { // Paper - fix drops not preventing stats/food exhaustion
|
|
super.playerDestroy(level, player, pos, state, te, stack, includeDrops, dropExp); // Paper - fix drops not preventing stats/food exhaustion
|
|
- if (!level.isClientSide && te instanceof BeehiveBlockEntity beehiveBlockEntity) {
|
|
+ if (/*!level.isClientSide &&*/ te instanceof BeehiveBlockEntity beehiveBlockEntity) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (!EnchantmentHelper.hasTag(stack, EnchantmentTags.PREVENTS_BEE_SPAWNS_WHEN_MINING)) {
|
|
beehiveBlockEntity.emptyAllLivingFromHive(player, state, BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY);
|
|
level.updateNeighbourForOutputSignal(pos, this);
|
|
@@ -170,7 +170,7 @@ public class BeehiveBlock extends BaseEntityBlock {
|
|
level.gameEvent(player, GameEvent.FLUID_PICKUP, pos);
|
|
}
|
|
|
|
- if (!level.isClientSide() && flag) {
|
|
+ if (/*!level.isClientSide() &&*/ flag) { // Plazma - Remove isClientSide on DedicatedServer
|
|
player.awardStat(Stats.ITEM_USED.get(item));
|
|
}
|
|
}
|
|
@@ -209,6 +209,7 @@ public class BeehiveBlock extends BaseEntityBlock {
|
|
level.setBlock(pos, state.setValue(HONEY_LEVEL, 0), 3);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(HONEY_LEVEL) >= 5) {
|
|
@@ -261,6 +262,7 @@ public class BeehiveBlock extends BaseEntityBlock {
|
|
0.0
|
|
);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
|
@@ -281,7 +283,7 @@ public class BeehiveBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return level.isClientSide ? null : createTickerHelper(blockEntityType, BlockEntityType.BEEHIVE, BeehiveBlockEntity::serverTick);
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.BEEHIVE, BeehiveBlockEntity::serverTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/BellBlock.java b/net/minecraft/world/level/block/BellBlock.java
|
|
index df4ceccf2351ba4432ec19303512211105f3acd3..75bbd2d4033928503f408e6233320f02467b5222 100644
|
|
--- a/net/minecraft/world/level/block/BellBlock.java
|
|
+++ b/net/minecraft/world/level/block/BellBlock.java
|
|
@@ -137,7 +137,7 @@ public class BellBlock extends BaseEntityBlock {
|
|
|
|
public boolean attemptToRing(@Nullable Entity entity, Level level, BlockPos pos, @Nullable Direction direction) {
|
|
BlockEntity blockEntity = level.getBlockEntity(pos);
|
|
- if (!level.isClientSide && blockEntity instanceof BellBlockEntity) {
|
|
+ if (/*!level.isClientSide &&*/ blockEntity instanceof BellBlockEntity) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (direction == null) {
|
|
direction = level.getBlockState(pos).getValue(FACING);
|
|
}
|
|
@@ -296,7 +296,7 @@ public class BellBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return createTickerHelper(blockEntityType, BlockEntityType.BELL, level.isClientSide ? BellBlockEntity::clientTick : BellBlockEntity::serverTick);
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.BELL, BellBlockEntity::serverTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/BigDripleafBlock.java b/net/minecraft/world/level/block/BigDripleafBlock.java
|
|
index 0ac279c0eaf21fe6013b480422a05c7dad16bc4d..a27d846ed7f321a04c458d703a7a0adb8e6381f9 100644
|
|
--- a/net/minecraft/world/level/block/BigDripleafBlock.java
|
|
+++ b/net/minecraft/world/level/block/BigDripleafBlock.java
|
|
@@ -200,24 +200,29 @@ public class BigDripleafBlock extends HorizontalDirectionalBlock implements Bone
|
|
@Override
|
|
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
|
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
|
- if (!level.isClientSide) {
|
|
- if (state.getValue(TILT) == Tilt.NONE && canEntityTilt(pos, entity) && !level.hasNeighborSignal(pos)) {
|
|
- // CraftBukkit start - tilt dripleaf
|
|
- org.bukkit.event.Cancellable cancellable;
|
|
- if (entity instanceof net.minecraft.world.entity.player.Player player) {
|
|
- cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(player, org.bukkit.event.block.Action.PHYSICAL, pos, null, null, null);
|
|
- } else {
|
|
- cancellable = new org.bukkit.event.entity.EntityInteractEvent(entity.getBukkitEntity(), level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
|
|
- level.getCraftServer().getPluginManager().callEvent((org.bukkit.event.entity.EntityInteractEvent) cancellable);
|
|
- }
|
|
-
|
|
- if (cancellable.isCancelled()) {
|
|
- return;
|
|
- }
|
|
- this.setTiltAndScheduleTick(state, level, pos, Tilt.UNSTABLE, null, entity);
|
|
- // CraftBukkit end
|
|
- }
|
|
+
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (state.getValue(TILT) != Tilt.NONE || !canEntityTilt(pos, entity) || level.hasNeighborSignal(pos)) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ // CraftBukkit start - tilt dripleaf
|
|
+ final org.bukkit.event.Cancellable cancellable;
|
|
+ if (entity instanceof net.minecraft.world.entity.player.Player player) {
|
|
+ cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(player, org.bukkit.event.block.Action.PHYSICAL, pos, null, null, null);
|
|
+ } else {
|
|
+ cancellable = new org.bukkit.event.entity.EntityInteractEvent(entity.getBukkitEntity(), level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
|
|
+ level.getCraftServer().getPluginManager().callEvent((org.bukkit.event.entity.EntityInteractEvent) cancellable);
|
|
}
|
|
+
|
|
+ if (cancellable.isCancelled()) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ this.setTiltAndScheduleTick(state, level, pos, Tilt.UNSTABLE, null, entity);
|
|
+ // CraftBukkit end
|
|
+
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/BlastFurnaceBlock.java b/net/minecraft/world/level/block/BlastFurnaceBlock.java
|
|
index 7e2ba95d5f2a33e9f6e4b333d6321098de15e449..fc7a4b4a80c60d13eadbbfa830d7ff0c7a805033 100644
|
|
--- a/net/minecraft/world/level/block/BlastFurnaceBlock.java
|
|
+++ b/net/minecraft/world/level/block/BlastFurnaceBlock.java
|
|
@@ -50,6 +50,7 @@ public class BlastFurnaceBlock extends AbstractFurnaceBlock {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(LIT)) {
|
|
@@ -70,4 +71,5 @@ public class BlastFurnaceBlock extends AbstractFurnaceBlock {
|
|
level.addParticle(ParticleTypes.SMOKE, d + d5, d1 + d6, d2 + d7, 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
|
|
index d9d3566971d5de25dfd926fac4dd90dd0c48680f..086d8a0ca1a0ff0155eb56e3d50a87f83fbe2324 100644
|
|
--- a/net/minecraft/world/level/block/Block.java
|
|
+++ b/net/minecraft/world/level/block/Block.java
|
|
@@ -183,9 +183,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
|
public static void updateOrDestroy(BlockState oldState, BlockState newState, LevelAccessor level, BlockPos pos, int flags, int recursionLeft) {
|
|
if (newState != oldState) {
|
|
if (newState.isAir()) {
|
|
- if (!level.isClientSide()) {
|
|
- level.destroyBlock(pos, (flags & 32) == 0, null, recursionLeft);
|
|
- }
|
|
+ level.destroyBlock(pos, (flags & 32) == 0, null, recursionLeft); // Plazma - Remove isClientSide on DedicatedServer
|
|
} else {
|
|
level.setBlock(pos, newState, flags & -33, recursionLeft);
|
|
}
|
|
@@ -266,8 +264,10 @@ public class Block extends BlockBehaviour implements ItemLike {
|
|
return ((ca.spottedleaf.moonrise.patches.collisions.shape.CollisionVoxelShape)shape).moonrise$isFullBlock(); // Paper - optimise collisions
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public void destroy(LevelAccessor level, BlockPos pos, BlockState state) {
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/BrewingStandBlock.java b/net/minecraft/world/level/block/BrewingStandBlock.java
|
|
index 1bcdebba2b2b4c7a893d10653db6ea8ffa8fd1db..5ed44d6bf2dfe93137da996cfcc226bb5c96483f 100644
|
|
--- a/net/minecraft/world/level/block/BrewingStandBlock.java
|
|
+++ b/net/minecraft/world/level/block/BrewingStandBlock.java
|
|
@@ -58,7 +58,7 @@ public class BrewingStandBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return level.isClientSide ? null : createTickerHelper(blockEntityType, BlockEntityType.BREWING_STAND, BrewingStandBlockEntity::serverTick);
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.BREWING_STAND, BrewingStandBlockEntity::serverTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -68,13 +68,14 @@ public class BrewingStandBlock extends BaseEntityBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide && level.getBlockEntity(pos) instanceof BrewingStandBlockEntity brewingStandBlockEntity && player.openMenu(brewingStandBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
+ if (/*!level.isClientSide &&*/ level.getBlockEntity(pos) instanceof BrewingStandBlockEntity brewingStandBlockEntity && player.openMenu(brewingStandBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
player.awardStat(Stats.INTERACT_WITH_BREWINGSTAND);
|
|
}
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
double d = pos.getX() + 0.4 + random.nextFloat() * 0.2;
|
|
@@ -82,6 +83,7 @@ public class BrewingStandBlock extends BaseEntityBlock {
|
|
double d2 = pos.getZ() + 0.4 + random.nextFloat() * 0.2;
|
|
level.addParticle(ParticleTypes.SMOKE, d, d1, d2, 0.0, 0.0, 0.0);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) {
|
|
diff --git a/net/minecraft/world/level/block/BrushableBlock.java b/net/minecraft/world/level/block/BrushableBlock.java
|
|
index 3055312b2ac12ebce290f680d7a87d6bca7431b9..dad56d839c632578b6b503addace8744e74a6f4b 100644
|
|
--- a/net/minecraft/world/level/block/BrushableBlock.java
|
|
+++ b/net/minecraft/world/level/block/BrushableBlock.java
|
|
@@ -98,6 +98,7 @@ public class BrushableBlock extends BaseEntityBlock implements Fallable {
|
|
level.gameEvent(fallingBlock, GameEvent.BLOCK_DESTROY, center);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (random.nextInt(16) == 0) {
|
|
@@ -110,6 +111,7 @@ public class BrushableBlock extends BaseEntityBlock implements Fallable {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Nullable
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/BubbleColumnBlock.java b/net/minecraft/world/level/block/BubbleColumnBlock.java
|
|
index be01261dbaebc8727926e641cdd431ecb3a2bd02..54c40397b7f4f344648da08127f9e1319e20702f 100644
|
|
--- a/net/minecraft/world/level/block/BubbleColumnBlock.java
|
|
+++ b/net/minecraft/world/level/block/BubbleColumnBlock.java
|
|
@@ -52,7 +52,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup {
|
|
BlockState blockState = level.getBlockState(pos.above());
|
|
if (blockState.isAir()) {
|
|
entity.onAboveBubbleCol(state.getValue(DRAG_DOWN));
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ServerLevel serverLevel = (ServerLevel)level;
|
|
|
|
for (int i = 0; i < 2; i++) {
|
|
@@ -79,7 +79,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup {
|
|
0.2
|
|
);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
} else {
|
|
entity.onInsideBubbleColumn(state.getValue(DRAG_DOWN));
|
|
}
|
|
@@ -132,6 +132,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
double d = pos.getX();
|
|
@@ -170,6 +171,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup {
|
|
}
|
|
}
|
|
}
|
|
+ */
|
|
|
|
@Override
|
|
protected BlockState updateShape(
|
|
diff --git a/net/minecraft/world/level/block/ButtonBlock.java b/net/minecraft/world/level/block/ButtonBlock.java
|
|
index 7ed884d8d2081ad2e93e68f71cfb0e1a449aed8f..08ac56037f6e7a3b04e58a0a924c102e316f7c64 100644
|
|
--- a/net/minecraft/world/level/block/ButtonBlock.java
|
|
+++ b/net/minecraft/world/level/block/ButtonBlock.java
|
|
@@ -193,7 +193,7 @@ public class ButtonBlock extends FaceAttachedHorizontalDirectionalBlock {
|
|
@Override
|
|
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
|
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
|
- if (!level.isClientSide && this.type.canButtonBeActivatedByArrows() && !state.getValue(POWERED)) {
|
|
+ if (/*!level.isClientSide &&*/ this.type.canButtonBeActivatedByArrows() && !state.getValue(POWERED)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.checkPressed(state, level, pos);
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/CakeBlock.java b/net/minecraft/world/level/block/CakeBlock.java
|
|
index f29f9f3679665464d2d4681806873db061b641c3..f1adfe540c7e329fb0f5c90a3e3ecd1851b2073d 100644
|
|
--- a/net/minecraft/world/level/block/CakeBlock.java
|
|
+++ b/net/minecraft/world/level/block/CakeBlock.java
|
|
@@ -86,7 +86,7 @@ public class CakeBlock extends Block {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (level.isClientSide) {
|
|
+ /*if (level.isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
if (eat(level, pos, state, player).consumesAction()) {
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
@@ -95,6 +95,7 @@ public class CakeBlock extends Block {
|
|
return InteractionResult.CONSUME;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return eat(level, pos, state, player);
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/CalibratedSculkSensorBlock.java b/net/minecraft/world/level/block/CalibratedSculkSensorBlock.java
|
|
index 4a8a0a3ebe4c4b5092054ccd4ed9186e53023d58..7772f834eae8599723bbaf219f57d7868d9f1511 100644
|
|
--- a/net/minecraft/world/level/block/CalibratedSculkSensorBlock.java
|
|
+++ b/net/minecraft/world/level/block/CalibratedSculkSensorBlock.java
|
|
@@ -41,13 +41,7 @@ public class CalibratedSculkSensorBlock extends SculkSensorBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return !level.isClientSide
|
|
- ? createTickerHelper(
|
|
- blockEntityType,
|
|
- BlockEntityType.CALIBRATED_SCULK_SENSOR,
|
|
- (level1, pos, state1, blockEntity) -> VibrationSystem.Ticker.tick(level1, blockEntity.getVibrationData(), blockEntity.getVibrationUser())
|
|
- )
|
|
- : null;
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.CALIBRATED_SCULK_SENSOR, (level1, pos, state1, blockEntity) -> VibrationSystem.Ticker.tick(level1, blockEntity.getVibrationData(), blockEntity.getVibrationUser())); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Nullable
|
|
diff --git a/net/minecraft/world/level/block/CampfireBlock.java b/net/minecraft/world/level/block/CampfireBlock.java
|
|
index 6dc5d41a8f40e6b9179e802d7c309d72d48391fa..b54ec3bd2a0b7dbe02f1187c0ae80d1dc0a5aacb 100644
|
|
--- a/net/minecraft/world/level/block/CampfireBlock.java
|
|
+++ b/net/minecraft/world/level/block/CampfireBlock.java
|
|
@@ -174,6 +174,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB
|
|
return SHAPE;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(LIT)) {
|
|
@@ -199,13 +200,15 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static void dowse(@Nullable Entity entity, LevelAccessor level, BlockPos pos, BlockState state) {
|
|
- if (level.isClientSide()) {
|
|
+ /*if (level.isClientSide()) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
for (int i = 0; i < 20; i++) {
|
|
makeParticles((Level)level, pos, state.getValue(SIGNAL_FIRE), true);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
BlockEntity blockEntity = level.getBlockEntity(pos);
|
|
if (blockEntity instanceof CampfireBlockEntity) {
|
|
@@ -220,9 +223,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB
|
|
if (!state.getValue(BlockStateProperties.WATERLOGGED) && fluidState.getType() == Fluids.WATER) {
|
|
boolean litValue = state.getValue(LIT);
|
|
if (litValue) {
|
|
- if (!level.isClientSide()) {
|
|
- level.playSound(null, pos, SoundEvents.GENERIC_EXTINGUISH_FIRE, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
- }
|
|
+ level.playSound(null, pos, SoundEvents.GENERIC_EXTINGUISH_FIRE, SoundSource.BLOCKS, 1.0F, 1.0F); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
dowse(null, level, pos, state);
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/CartographyTableBlock.java b/net/minecraft/world/level/block/CartographyTableBlock.java
|
|
index 7f206c9e2e9c25c07bde7a5946f90cb66ea26afe..db62c0e4bd040c267f5cd0accf38d876a72faef6 100644
|
|
--- a/net/minecraft/world/level/block/CartographyTableBlock.java
|
|
+++ b/net/minecraft/world/level/block/CartographyTableBlock.java
|
|
@@ -31,11 +31,7 @@ public class CartographyTableBlock extends Block {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide) {
|
|
- if (player.openMenu(state.getMenuProvider(level, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
- player.awardStat(Stats.INTERACT_WITH_CARTOGRAPHY_TABLE);
|
|
- } // Paper - Fix InventoryOpenEvent cancellation
|
|
- }
|
|
+ player.openMenu(state.getMenuProvider(level, pos)).ifPresent(ignore -> player.awardStat(Stats.INTERACT_WITH_CARTOGRAPHY_TABLE)); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/ChestBlock.java b/net/minecraft/world/level/block/ChestBlock.java
|
|
index 7675aa6e058bdafe9debf2561cad9cf6ae05f5b0..746385bceba7aab02801335d1ce730fd59331d66 100644
|
|
--- a/net/minecraft/world/level/block/ChestBlock.java
|
|
+++ b/net/minecraft/world/level/block/ChestBlock.java
|
|
@@ -346,11 +346,13 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements
|
|
return new ChestBlockEntity(pos, state);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
return level.isClientSide ? createTickerHelper(blockEntityType, this.blockEntityType(), ChestBlockEntity::lidAnimateTick) : null;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static boolean isChestBlockedAt(LevelAccessor level, BlockPos pos) {
|
|
return isBlockedChestByBlock(level, pos) || isCatSittingOnChest(level, pos);
|
|
diff --git a/net/minecraft/world/level/block/ChiseledBookShelfBlock.java b/net/minecraft/world/level/block/ChiseledBookShelfBlock.java
|
|
index 7f7e4f8cb3601c43cf5e87a6e2ea94642396fa28..070ed2a3eca88fcfcff483557d3ba8c4ffeee885 100644
|
|
--- a/net/minecraft/world/level/block/ChiseledBookShelfBlock.java
|
|
+++ b/net/minecraft/world/level/block/ChiseledBookShelfBlock.java
|
|
@@ -142,18 +142,18 @@ public class ChiseledBookShelfBlock extends BaseEntityBlock {
|
|
}
|
|
|
|
private static void addBook(Level level, BlockPos pos, Player player, ChiseledBookShelfBlockEntity blockEntity, ItemStack bookStack, int slot) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
player.awardStat(Stats.ITEM_USED.get(bookStack.getItem()));
|
|
SoundEvent soundEvent = bookStack.is(Items.ENCHANTED_BOOK)
|
|
? SoundEvents.CHISELED_BOOKSHELF_INSERT_ENCHANTED
|
|
: SoundEvents.CHISELED_BOOKSHELF_INSERT;
|
|
blockEntity.setItem(slot, bookStack.consumeAndReturn(1, player));
|
|
level.playSound(null, pos, soundEvent, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
- }
|
|
+ //}
|
|
}
|
|
|
|
private static void removeBook(Level level, BlockPos pos, Player player, ChiseledBookShelfBlockEntity blockEntity, int slot) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ItemStack itemStack = blockEntity.removeItem(slot, 1);
|
|
SoundEvent soundEvent = itemStack.is(Items.ENCHANTED_BOOK)
|
|
? SoundEvents.CHISELED_BOOKSHELF_PICKUP_ENCHANTED
|
|
@@ -164,7 +164,7 @@ public class ChiseledBookShelfBlock extends BaseEntityBlock {
|
|
}
|
|
|
|
level.gameEvent(player, GameEvent.BLOCK_CHANGE, pos);
|
|
- }
|
|
+ //}
|
|
}
|
|
|
|
@Nullable
|
|
@@ -226,12 +226,6 @@ public class ChiseledBookShelfBlock extends BaseEntityBlock {
|
|
|
|
@Override
|
|
protected int getAnalogOutputSignal(BlockState state, Level level, BlockPos pos) {
|
|
- if (level.isClientSide()) {
|
|
- return 0;
|
|
- } else {
|
|
- return level.getBlockEntity(pos) instanceof ChiseledBookShelfBlockEntity chiseledBookShelfBlockEntity
|
|
- ? chiseledBookShelfBlockEntity.getLastInteractedSlot() + 1
|
|
- : 0;
|
|
- }
|
|
+ return (level.getBlockEntity(pos) instanceof ChiseledBookShelfBlockEntity entity) ? entity.getLastInteractedSlot() + 1 : 0; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/CommandBlock.java b/net/minecraft/world/level/block/CommandBlock.java
|
|
index 318ecbf276c7b37b399bd4d43baabed7311d0844..ff8f19efaab5c17d66a4ad44dd732f6963c1899e 100644
|
|
--- a/net/minecraft/world/level/block/CommandBlock.java
|
|
+++ b/net/minecraft/world/level/block/CommandBlock.java
|
|
@@ -61,11 +61,11 @@ public class CommandBlock extends BaseEntityBlock implements GameMasterBlock {
|
|
|
|
@Override
|
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (level.getBlockEntity(pos) instanceof CommandBlockEntity commandBlockEntity) {
|
|
this.setPoweredAndUpdate(level, pos, commandBlockEntity, level.hasNeighborSignal(pos));
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private void setPoweredAndUpdate(Level level, BlockPos pos, CommandBlockEntity blockEntity, boolean powered) {
|
|
diff --git a/net/minecraft/world/level/block/ComposterBlock.java b/net/minecraft/world/level/block/ComposterBlock.java
|
|
index eeca7debca49b8a1f602399cb9bb237e471b7df0..de5656210a490ebf813732912c420eec439d5c54 100644
|
|
--- a/net/minecraft/world/level/block/ComposterBlock.java
|
|
+++ b/net/minecraft/world/level/block/ComposterBlock.java
|
|
@@ -189,6 +189,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
|
this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, 0));
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static void handleFill(Level level, BlockPos pos, boolean success) {
|
|
BlockState blockState = level.getBlockState(pos);
|
|
level.playLocalSound(pos, success ? SoundEvents.COMPOSTER_FILL_SUCCESS : SoundEvents.COMPOSTER_FILL, SoundSource.BLOCKS, 1.0F, 1.0F, false);
|
|
@@ -212,6 +213,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
|
);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
|
|
@@ -271,7 +273,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
|
|
|
// Purpur start - sneak to bulk process composter
|
|
private static @Nullable BlockState process(int levelValue, Player player, BlockState state, Level level, BlockPos pos, ItemStack stack) {
|
|
- if (levelValue < 7 && !level.isClientSide) {
|
|
+ if (levelValue < 7 /*&& !level.isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockState iblockdata1 = ComposterBlock.addItem(player, state, level, pos, stack);
|
|
// Paper start - handle cancelled events
|
|
if (iblockdata1 == null) {
|
|
@@ -331,12 +333,12 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
|
}
|
|
}
|
|
// CraftBukkit end
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
Vec3 vec3 = Vec3.atLowerCornerWithOffset(pos, 0.5, 1.01, 0.5).offsetRandom(level.random, 0.7F);
|
|
ItemEntity itemEntity = new ItemEntity(level, vec3.x(), vec3.y(), vec3.z(), new ItemStack(Items.BONE_MEAL));
|
|
itemEntity.setDefaultPickUpDelay();
|
|
level.addFreshEntity(itemEntity);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
BlockState blockState = empty(entity, state, level, pos);
|
|
level.playSound(null, pos, SoundEvents.COMPOSTER_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
diff --git a/net/minecraft/world/level/block/ConduitBlock.java b/net/minecraft/world/level/block/ConduitBlock.java
|
|
index 5fb139633fa05d733f4ea4f3f203ca51d8de6e72..9968b7964810cfcbe4f8b4c45332fe2af01c2e7e 100644
|
|
--- a/net/minecraft/world/level/block/ConduitBlock.java
|
|
+++ b/net/minecraft/world/level/block/ConduitBlock.java
|
|
@@ -55,9 +55,7 @@ public class ConduitBlock extends BaseEntityBlock implements SimpleWaterloggedBl
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return createTickerHelper(
|
|
- blockEntityType, BlockEntityType.CONDUIT, level.isClientSide ? ConduitBlockEntity::clientTick : ConduitBlockEntity::serverTick
|
|
- );
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.CONDUIT, ConduitBlockEntity::serverTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/CrafterBlock.java b/net/minecraft/world/level/block/CrafterBlock.java
|
|
index 13c8d883bda63b0981bbde8ac123ec5dd138eb8c..e1918337690a48b9b1ff2b46e929e2aa3b4137f9 100644
|
|
--- a/net/minecraft/world/level/block/CrafterBlock.java
|
|
+++ b/net/minecraft/world/level/block/CrafterBlock.java
|
|
@@ -99,7 +99,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return level.isClientSide ? null : createTickerHelper(blockEntityType, BlockEntityType.CRAFTER, CrafterBlockEntity::serverTick);
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.CRAFTER, CrafterBlockEntity::serverTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private void setBlockEntityTriggered(@Nullable BlockEntity blockEntity, boolean triggered) {
|
|
@@ -144,7 +144,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide && level.getBlockEntity(pos) instanceof CrafterBlockEntity crafterBlockEntity) {
|
|
+ if (/*!level.isClientSide &&*/ level.getBlockEntity(pos) instanceof CrafterBlockEntity crafterBlockEntity) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
player.openMenu(crafterBlockEntity);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/level/block/CraftingTableBlock.java b/net/minecraft/world/level/block/CraftingTableBlock.java
|
|
index c4331bf37e134396020606177a584c908e78088c..fc7782f1f5f4a15dfeb56ea24a3b4414400b5093 100644
|
|
--- a/net/minecraft/world/level/block/CraftingTableBlock.java
|
|
+++ b/net/minecraft/world/level/block/CraftingTableBlock.java
|
|
@@ -30,11 +30,7 @@ public class CraftingTableBlock extends Block {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide) {
|
|
- if (player.openMenu(state.getMenuProvider(level, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
- player.awardStat(Stats.INTERACT_WITH_CRAFTING_TABLE);
|
|
- } // Paper - Fix InventoryOpenEvent cancellation
|
|
- }
|
|
+ player.openMenu(state.getMenuProvider(level, pos)).ifPresent(ignore -> player.awardStat(Stats.INTERACT_WITH_CRAFTING_TABLE)); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/CreakingHeartBlock.java b/net/minecraft/world/level/block/CreakingHeartBlock.java
|
|
index fa83f4a23be30244c9cde0e2995a9baab60db427..4a8e45f4089bc19d3265a66ad22294c0ee5beff7 100644
|
|
--- a/net/minecraft/world/level/block/CreakingHeartBlock.java
|
|
+++ b/net/minecraft/world/level/block/CreakingHeartBlock.java
|
|
@@ -56,17 +56,14 @@ public class CreakingHeartBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- if (level.isClientSide) {
|
|
- return null;
|
|
- } else {
|
|
- return state.getValue(ACTIVE) ? createTickerHelper(blockEntityType, BlockEntityType.CREAKING_HEART, CreakingHeartBlockEntity::serverTick) : null;
|
|
- }
|
|
+ return state.getValue(ACTIVE) ? createTickerHelper(blockEntityType, BlockEntityType.CREAKING_HEART, CreakingHeartBlockEntity::serverTick) : null; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public static boolean isNaturalNight(Level level) {
|
|
return level.dimensionType().natural() && level.isNight();
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (isNaturalNight(level)) {
|
|
@@ -77,6 +74,7 @@ public class CreakingHeartBlock extends BaseEntityBlock {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected BlockState updateShape(
|
|
@@ -112,6 +110,7 @@ public class CreakingHeartBlock extends BaseEntityBlock {
|
|
return true;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private static boolean isSurroundedByLogs(LevelAccessor level, BlockPos pos) {
|
|
for (Direction direction : Direction.values()) {
|
|
BlockPos blockPos = pos.relative(direction);
|
|
@@ -123,6 +122,7 @@ public class CreakingHeartBlock extends BaseEntityBlock {
|
|
|
|
return true;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Nullable
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/CryingObsidianBlock.java b/net/minecraft/world/level/block/CryingObsidianBlock.java
|
|
index 668daf9850b972a1b4681bc87d296ff184153f24..6cb7037d0a6ebe96892e13f781c42aa728974a27 100644
|
|
--- a/net/minecraft/world/level/block/CryingObsidianBlock.java
|
|
+++ b/net/minecraft/world/level/block/CryingObsidianBlock.java
|
|
@@ -21,6 +21,7 @@ public class CryingObsidianBlock extends Block {
|
|
super(properties);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (random.nextInt(5) == 0) {
|
|
@@ -37,4 +38,5 @@ public class CryingObsidianBlock extends Block {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/DaylightDetectorBlock.java b/net/minecraft/world/level/block/DaylightDetectorBlock.java
|
|
index 7d78ac98e9b0b60607877de967b9d21827731054..478019c91bfb5e01e1003adbfb1824bce3ca3dca 100644
|
|
--- a/net/minecraft/world/level/block/DaylightDetectorBlock.java
|
|
+++ b/net/minecraft/world/level/block/DaylightDetectorBlock.java
|
|
@@ -80,12 +80,12 @@ public class DaylightDetectorBlock extends BaseEntityBlock {
|
|
if (!player.mayBuild()) {
|
|
return super.useWithoutItem(state, level, pos, player, hitResult);
|
|
} else {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockState blockState = state.cycle(INVERTED);
|
|
level.setBlock(pos, blockState, 2);
|
|
level.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(player, blockState));
|
|
updateSignalStrength(blockState, level, pos);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
@@ -104,7 +104,7 @@ public class DaylightDetectorBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return !level.isClientSide && level.dimensionType().hasSkyLight()
|
|
+ return /*!level.isClientSide &&*/ level.dimensionType().hasSkyLight() // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
? createTickerHelper(blockEntityType, BlockEntityType.DAYLIGHT_DETECTOR, DaylightDetectorBlock::tickEntity)
|
|
: null;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/DecoratedPotBlock.java b/net/minecraft/world/level/block/DecoratedPotBlock.java
|
|
index 2eac8a64b16be732f60bc34d43982b3f37058257..4abbc8b7025d2a30aaefe218b9a4c27cd59efaab 100644
|
|
--- a/net/minecraft/world/level/block/DecoratedPotBlock.java
|
|
+++ b/net/minecraft/world/level/block/DecoratedPotBlock.java
|
|
@@ -109,40 +109,39 @@ public class DecoratedPotBlock extends BaseEntityBlock implements SimpleWaterlog
|
|
protected InteractionResult useItemOn(
|
|
ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult
|
|
) {
|
|
- if (level.getBlockEntity(pos) instanceof DecoratedPotBlockEntity decoratedPotBlockEntity) {
|
|
- if (level.isClientSide) {
|
|
- return InteractionResult.SUCCESS;
|
|
- } else {
|
|
- ItemStack theItem = decoratedPotBlockEntity.getTheItem();
|
|
- if (!stack.isEmpty()
|
|
- && (theItem.isEmpty() || ItemStack.isSameItemSameComponents(theItem, stack) && theItem.getCount() < theItem.getMaxStackSize())) {
|
|
- decoratedPotBlockEntity.wobble(DecoratedPotBlockEntity.WobbleStyle.POSITIVE);
|
|
- player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
|
|
- ItemStack itemStack = stack.consumeAndReturn(1, player);
|
|
- float f;
|
|
- if (decoratedPotBlockEntity.isEmpty()) {
|
|
- decoratedPotBlockEntity.setTheItem(itemStack);
|
|
- f = (float)itemStack.getCount() / itemStack.getMaxStackSize();
|
|
- } else {
|
|
- theItem.grow(1);
|
|
- f = (float)theItem.getCount() / theItem.getMaxStackSize();
|
|
- }
|
|
-
|
|
- level.playSound(null, pos, SoundEvents.DECORATED_POT_INSERT, SoundSource.BLOCKS, 1.0F, 0.7F + 0.5F * f);
|
|
- if (level instanceof ServerLevel serverLevel) {
|
|
- serverLevel.sendParticles(ParticleTypes.DUST_PLUME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 7, 0.0, 0.0, 0.0, 0.0);
|
|
- }
|
|
-
|
|
- decoratedPotBlockEntity.setChanged();
|
|
- level.gameEvent(player, GameEvent.BLOCK_CHANGE, pos);
|
|
- return InteractionResult.SUCCESS;
|
|
- } else {
|
|
- return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
- }
|
|
- }
|
|
- } else {
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (!(level.getBlockEntity(pos) instanceof DecoratedPotBlockEntity blockEntity)) {
|
|
return InteractionResult.PASS;
|
|
}
|
|
+
|
|
+ ItemStack storedItem = blockEntity.getTheItem();
|
|
+ if (stack.isEmpty() || (!storedItem.isEmpty() && (!ItemStack.isSameItemSameComponents(storedItem, stack) || storedItem.getCount() >= storedItem.getMaxStackSize()))) {
|
|
+ return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
+ }
|
|
+
|
|
+ blockEntity.wobble(DecoratedPotBlockEntity.WobbleStyle.POSITIVE);
|
|
+ player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
|
|
+ ItemStack itemStack = stack.consumeAndReturn(1, player);
|
|
+
|
|
+ final float pitch;
|
|
+ if (blockEntity.isEmpty()) {
|
|
+ blockEntity.setTheItem(itemStack);
|
|
+ pitch = (float) itemStack.getCount() / itemStack.getMaxStackSize();
|
|
+ } else {
|
|
+ storedItem.grow(1);
|
|
+ pitch = (float) storedItem.getCount() / storedItem.getMaxStackSize();
|
|
+ }
|
|
+
|
|
+ level.playSound(null, pos, SoundEvents.DECORATED_POT_INSERT, SoundSource.BLOCKS, 1.0F, 0.7F + 0.5F * pitch);
|
|
+ if (level instanceof ServerLevel serverLevel) {
|
|
+ serverLevel.sendParticles(ParticleTypes.DUST_PLUME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 7, 0.0, 0.0, 0.0, 0.0);
|
|
+ }
|
|
+
|
|
+ blockEntity.setChanged();
|
|
+ level.gameEvent(player, GameEvent.BLOCK_CHANGE, pos);
|
|
+
|
|
+ return InteractionResult.SUCCESS;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/DetectorRailBlock.java b/net/minecraft/world/level/block/DetectorRailBlock.java
|
|
index 0c8b2c6b6bddd82bb2da866b58691e46c9b5788e..307928a7fbaff2314f3f4e8195cd101691462107 100644
|
|
--- a/net/minecraft/world/level/block/DetectorRailBlock.java
|
|
+++ b/net/minecraft/world/level/block/DetectorRailBlock.java
|
|
@@ -55,11 +55,7 @@ public class DetectorRailBlock extends BaseRailBlock {
|
|
@Override
|
|
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
|
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
|
- if (!level.isClientSide) {
|
|
- if (!state.getValue(POWERED)) {
|
|
- this.checkPressed(level, pos, state);
|
|
- }
|
|
- }
|
|
+ if (!state.getValue(POWERED)) this.checkPressed(level, pos, state); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/DispenserBlock.java b/net/minecraft/world/level/block/DispenserBlock.java
|
|
index f0afe65913f9c65ac2b8866a9b9100837b9d1f31..3f60359b173332235317404996a13b2fc5637793 100644
|
|
--- a/net/minecraft/world/level/block/DispenserBlock.java
|
|
+++ b/net/minecraft/world/level/block/DispenserBlock.java
|
|
@@ -72,7 +72,7 @@ public class DispenserBlock extends BaseEntityBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide && level.getBlockEntity(pos) instanceof DispenserBlockEntity dispenserBlockEntity && player.openMenu(dispenserBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
+ if (/*!level.isClientSide &&*/ level.getBlockEntity(pos) instanceof DispenserBlockEntity dispenserBlockEntity && player.openMenu(dispenserBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
player.awardStat(dispenserBlockEntity instanceof DropperBlockEntity ? Stats.INSPECT_DROPPER : Stats.INSPECT_DISPENSER);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/level/block/DoorBlock.java b/net/minecraft/world/level/block/DoorBlock.java
|
|
index 70f4877e232329226a0160f3bc774b2dddd81819..3dd42c67e357282fa2f1a334b09591ef2298c555 100644
|
|
--- a/net/minecraft/world/level/block/DoorBlock.java
|
|
+++ b/net/minecraft/world/level/block/DoorBlock.java
|
|
@@ -125,7 +125,7 @@ public class DoorBlock extends Block {
|
|
|
|
@Override
|
|
public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) {
|
|
- if (!level.isClientSide && (player.isCreative() || !player.hasCorrectToolForDrops(state))) {
|
|
+ if (/*!level.isClientSide &&*/ (player.isCreative() || !player.hasCorrectToolForDrops(state))) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
DoublePlantBlock.preventDropFromBottomPart(level, pos, state, player);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/level/block/DoublePlantBlock.java b/net/minecraft/world/level/block/DoublePlantBlock.java
|
|
index 6b1e88d40a8494cec762ff2e3ecb94643bbd7721..00e3919b01fe41a5106f570fabcf5fc57a5acd1e 100644
|
|
--- a/net/minecraft/world/level/block/DoublePlantBlock.java
|
|
+++ b/net/minecraft/world/level/block/DoublePlantBlock.java
|
|
@@ -100,13 +100,13 @@ public class DoublePlantBlock extends BushBlock {
|
|
|
|
@Override
|
|
public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (player.isCreative()) {
|
|
preventDropFromBottomPart(level, pos, state, player);
|
|
} else {
|
|
dropResources(state, level, pos, null, player, player.getMainHandItem());
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return super.playerWillDestroy(level, pos, state, player);
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/DragonEggBlock.java b/net/minecraft/world/level/block/DragonEggBlock.java
|
|
index e72c0f252138858f44e423b28d6e26fcab53a17e..befc32649d5b2e4809c3530e20925b8d9ea84aad 100644
|
|
--- a/net/minecraft/world/level/block/DragonEggBlock.java
|
|
+++ b/net/minecraft/world/level/block/DragonEggBlock.java
|
|
@@ -66,21 +66,10 @@ public class DragonEggBlock extends FallingBlock {
|
|
|
|
blockPos = new BlockPos(event.getToBlock().getX(), event.getToBlock().getY(), event.getToBlock().getZ());
|
|
// CraftBukkit end
|
|
- if (level.isClientSide) {
|
|
- for (int i1 = 0; i1 < 128; i1++) {
|
|
- double randomDouble = level.random.nextDouble();
|
|
- float f = (level.random.nextFloat() - 0.5F) * 0.2F;
|
|
- float f1 = (level.random.nextFloat() - 0.5F) * 0.2F;
|
|
- float f2 = (level.random.nextFloat() - 0.5F) * 0.2F;
|
|
- double d = Mth.lerp(randomDouble, (double)blockPos.getX(), (double)pos.getX()) + (level.random.nextDouble() - 0.5) + 0.5;
|
|
- double d1 = Mth.lerp(randomDouble, (double)blockPos.getY(), (double)pos.getY()) + level.random.nextDouble() - 0.5;
|
|
- double d2 = Mth.lerp(randomDouble, (double)blockPos.getZ(), (double)pos.getZ()) + (level.random.nextDouble() - 0.5) + 0.5;
|
|
- level.addParticle(ParticleTypes.PORTAL, d, d1, d2, f, f1, f2);
|
|
- }
|
|
- } else {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
level.setBlock(blockPos, state, 2);
|
|
level.removeBlock(pos, false);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/EnchantingTableBlock.java b/net/minecraft/world/level/block/EnchantingTableBlock.java
|
|
index 92c75217860f1fca706f4e7105589f0f67ba81f4..23aa4a9f5bb33f29527f7bfdd2432f21b2a32b3d 100644
|
|
--- a/net/minecraft/world/level/block/EnchantingTableBlock.java
|
|
+++ b/net/minecraft/world/level/block/EnchantingTableBlock.java
|
|
@@ -61,6 +61,7 @@ public class EnchantingTableBlock extends BaseEntityBlock {
|
|
return SHAPE;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
super.animateTick(state, level, pos, random);
|
|
@@ -79,23 +80,24 @@ public class EnchantingTableBlock extends BaseEntityBlock {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
|
|
return new EnchantingTableBlockEntity(pos, state);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
return level.isClientSide ? createTickerHelper(blockEntityType, BlockEntityType.ENCHANTING_TABLE, EnchantingTableBlockEntity::bookAnimationTick) : null;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide) {
|
|
- player.openMenu(state.getMenuProvider(level, pos));
|
|
- }
|
|
+ player.openMenu(state.getMenuProvider(level, pos)); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/EndGatewayBlock.java b/net/minecraft/world/level/block/EndGatewayBlock.java
|
|
index 54abeb142e119edd1c1d1c263821b95b1f05c388..70f72efdd00c39b69285f4337d4eb58a4459ddce 100644
|
|
--- a/net/minecraft/world/level/block/EndGatewayBlock.java
|
|
+++ b/net/minecraft/world/level/block/EndGatewayBlock.java
|
|
@@ -43,13 +43,10 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return createTickerHelper(
|
|
- blockEntityType,
|
|
- BlockEntityType.END_GATEWAY,
|
|
- level.isClientSide ? TheEndGatewayBlockEntity::beamAnimationTick : TheEndGatewayBlockEntity::portalTick
|
|
- );
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.END_GATEWAY, TheEndGatewayBlockEntity::portalTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
BlockEntity blockEntity = level.getBlockEntity(pos);
|
|
@@ -76,6 +73,7 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state, boolean includeData) {
|
|
@@ -91,7 +89,7 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
|
|
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
|
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
|
if (entity.canUsePortal(false)
|
|
- && !level.isClientSide
|
|
+ //&& !level.isClientSide // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
&& level.getBlockEntity(pos) instanceof TheEndGatewayBlockEntity theEndGatewayBlockEntity
|
|
&& !theEndGatewayBlockEntity.isCoolingDown()) {
|
|
// Paper start - call EntityPortalEnterEvent
|
|
diff --git a/net/minecraft/world/level/block/EndPortalBlock.java b/net/minecraft/world/level/block/EndPortalBlock.java
|
|
index 7e60bcadd2d343e00fc554dba0b85c9191f7efb6..c367739eff86ec5573ef6e3ab1375e1f60c88233 100644
|
|
--- a/net/minecraft/world/level/block/EndPortalBlock.java
|
|
+++ b/net/minecraft/world/level/block/EndPortalBlock.java
|
|
@@ -70,7 +70,7 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
|
|
level.getCraftServer().getPluginManager().callEvent(event);
|
|
if (event.isCancelled()) return; // Paper - make cancellable
|
|
// CraftBukkit end
|
|
- if (!level.isClientSide && level.dimension() == Level.END && entity instanceof ServerPlayer serverPlayer && !serverPlayer.seenCredits) {
|
|
+ if (/*!level.isClientSide &&*/ level.dimension() == Level.END && entity instanceof ServerPlayer serverPlayer && !serverPlayer.seenCredits) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (level.paperConfig().misc.disableEndCredits) {serverPlayer.seenCredits = true; return;} // Paper - Option to disable end credits
|
|
serverPlayer.showEndCredits();
|
|
} else {
|
|
@@ -120,6 +120,7 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
double d = pos.getX() + random.nextDouble();
|
|
@@ -127,6 +128,7 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
|
|
double d2 = pos.getZ() + random.nextDouble();
|
|
level.addParticle(ParticleTypes.SMOKE, d, d1, d2, 0.0, 0.0, 0.0);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state, boolean includeData) {
|
|
diff --git a/net/minecraft/world/level/block/EndRodBlock.java b/net/minecraft/world/level/block/EndRodBlock.java
|
|
index 590a4068e9a7cd26e0a763e9476c87a4bd0ec6a0..0ac4f641b38f18201b981b8d688563326c7de8d2 100644
|
|
--- a/net/minecraft/world/level/block/EndRodBlock.java
|
|
+++ b/net/minecraft/world/level/block/EndRodBlock.java
|
|
@@ -33,6 +33,7 @@ public class EndRodBlock extends RodBlock {
|
|
: this.defaultBlockState().setValue(FACING, clickedFace);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
Direction direction = state.getValue(FACING);
|
|
@@ -52,6 +53,7 @@ public class EndRodBlock extends RodBlock {
|
|
);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
|
diff --git a/net/minecraft/world/level/block/EnderChestBlock.java b/net/minecraft/world/level/block/EnderChestBlock.java
|
|
index 730dc33afd8ac3efadefd410265bd23121abc27b..b80d4eac296f97fbce84b76949beb2dd0ad5a7f3 100644
|
|
--- a/net/minecraft/world/level/block/EnderChestBlock.java
|
|
+++ b/net/minecraft/world/level/block/EnderChestBlock.java
|
|
@@ -134,6 +134,7 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
|
|
return new EnderChestBlockEntity(pos, state);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
@@ -154,6 +155,7 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
|
|
level.addParticle(ParticleTypes.PORTAL, d, d1, d2, d3, d4, d5);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected BlockState rotate(BlockState state, Rotation rot) {
|
|
diff --git a/net/minecraft/world/level/block/EyeblossomBlock.java b/net/minecraft/world/level/block/EyeblossomBlock.java
|
|
index 349ab10db5a2c3253ce2f8ec0f5f39e1dcc2f0a9..037bbe902de8f785c691b89ef0d4fc6fdb7e8289 100644
|
|
--- a/net/minecraft/world/level/block/EyeblossomBlock.java
|
|
+++ b/net/minecraft/world/level/block/EyeblossomBlock.java
|
|
@@ -47,6 +47,7 @@ public class EyeblossomBlock extends FlowerBlock {
|
|
this.type = EyeblossomBlock.Type.fromBoolean(_open);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (this.type.emitSounds() && random.nextInt(700) == 0) {
|
|
@@ -56,6 +57,7 @@ public class EyeblossomBlock extends FlowerBlock {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
|
@@ -100,8 +102,7 @@ public class EyeblossomBlock extends FlowerBlock {
|
|
@Override
|
|
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
|
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
|
- if (!level.isClientSide()
|
|
- && level.getDifficulty() != Difficulty.PEACEFUL
|
|
+ if (level.getDifficulty() != Difficulty.PEACEFUL // Plazma - Remove isClientSide on DedicatedServer
|
|
&& entity instanceof Bee bee
|
|
&& Bee.attractsBees(state)
|
|
&& !bee.hasEffect(MobEffects.POISON)) {
|
|
diff --git a/net/minecraft/world/level/block/FallingBlock.java b/net/minecraft/world/level/block/FallingBlock.java
|
|
index 1a787426acb68cf8f9491bdd8f903c7e0c00e29f..ccfa08121b70852e1ac36374576b0dd50a9bcf4f 100644
|
|
--- a/net/minecraft/world/level/block/FallingBlock.java
|
|
+++ b/net/minecraft/world/level/block/FallingBlock.java
|
|
@@ -64,6 +64,7 @@ public abstract class FallingBlock extends Block implements Fallable {
|
|
return state.isAir() || state.is(BlockTags.FIRE) || state.liquid() || state.canBeReplaced();
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (random.nextInt(16) == 0) {
|
|
@@ -73,6 +74,7 @@ public abstract class FallingBlock extends Block implements Fallable {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public int getDustColor(BlockState state, BlockGetter level, BlockPos pos) {
|
|
return -16777216;
|
|
diff --git a/net/minecraft/world/level/block/FenceBlock.java b/net/minecraft/world/level/block/FenceBlock.java
|
|
index f115a3d0237e32f3257ee4937cda6dd09495b71f..86f2b18991e316ff46124b15e7ea15c7141c6fe8 100644
|
|
--- a/net/minecraft/world/level/block/FenceBlock.java
|
|
+++ b/net/minecraft/world/level/block/FenceBlock.java
|
|
@@ -74,7 +74,7 @@ public class FenceBlock extends CrossCollisionBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- return (InteractionResult)(!level.isClientSide() ? LeadItem.bindPlayerMobs(player, level, pos) : InteractionResult.PASS);
|
|
+ return LeadItem.bindPlayerMobs(player, level, pos); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/FenceGateBlock.java b/net/minecraft/world/level/block/FenceGateBlock.java
|
|
index 54ed473bfc72775e713311c1b73732756b2b811b..038c795e1a783e755e4875ce02c4c2edf1c39931 100644
|
|
--- a/net/minecraft/world/level/block/FenceGateBlock.java
|
|
+++ b/net/minecraft/world/level/block/FenceGateBlock.java
|
|
@@ -211,7 +211,7 @@ public class FenceGateBlock extends HorizontalDirectionalBlock {
|
|
|
|
@Override
|
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean hasNeighborSignal = level.hasNeighborSignal(pos);
|
|
// CraftBukkit start
|
|
boolean oldPowered = state.getValue(FenceGateBlock.POWERED);
|
|
@@ -238,7 +238,7 @@ public class FenceGateBlock extends HorizontalDirectionalBlock {
|
|
level.gameEvent(null, hasNeighborSignal ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE, pos);
|
|
}
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/FurnaceBlock.java b/net/minecraft/world/level/block/FurnaceBlock.java
|
|
index 47dd6fa308464d5af7450d157caf58aaf8e1291e..d087809aca9dd730125cfdec6181c109da32704b 100644
|
|
--- a/net/minecraft/world/level/block/FurnaceBlock.java
|
|
+++ b/net/minecraft/world/level/block/FurnaceBlock.java
|
|
@@ -50,6 +50,7 @@ public class FurnaceBlock extends AbstractFurnaceBlock {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(LIT)) {
|
|
@@ -71,4 +72,5 @@ public class FurnaceBlock extends AbstractFurnaceBlock {
|
|
level.addParticle(ParticleTypes.FLAME, d + d5, d1 + d6, d2 + d7, 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/GrindstoneBlock.java b/net/minecraft/world/level/block/GrindstoneBlock.java
|
|
index f34d9baf1e0483240435571518282295c369ffd2..d05075340eae9ee397cacc5ccfce3e139a52897e 100644
|
|
--- a/net/minecraft/world/level/block/GrindstoneBlock.java
|
|
+++ b/net/minecraft/world/level/block/GrindstoneBlock.java
|
|
@@ -151,9 +151,7 @@ public class GrindstoneBlock extends FaceAttachedHorizontalDirectionalBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide && player.openMenu(state.getMenuProvider(level, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
- player.awardStat(Stats.INTERACT_WITH_GRINDSTONE);
|
|
- }
|
|
+ player.openMenu(state.getMenuProvider(level, pos)).ifPresent(ignore -> player.awardStat(Stats.INTERACT_WITH_GRINDSTONE)); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/HangingMossBlock.java b/net/minecraft/world/level/block/HangingMossBlock.java
|
|
index b152e69bc0c814ea9dc1078547b428987bc06d11..443604682fd1176a513b010e0592694e97e0dca8 100644
|
|
--- a/net/minecraft/world/level/block/HangingMossBlock.java
|
|
+++ b/net/minecraft/world/level/block/HangingMossBlock.java
|
|
@@ -42,6 +42,7 @@ public class HangingMossBlock extends Block implements BonemealableBlock {
|
|
return state.getValue(TIP) ? TIP_SHAPE : BASE_SHAPE;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer)
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (random.nextInt(500) == 0) {
|
|
@@ -51,6 +52,7 @@ public class HangingMossBlock extends Block implements BonemealableBlock {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected boolean propagatesSkylightDown(BlockState state) {
|
|
diff --git a/net/minecraft/world/level/block/HoneyBlock.java b/net/minecraft/world/level/block/HoneyBlock.java
|
|
index bab3ac2c4be08ea7589752b8472c1e13bcaab76a..109e07db86dfdc21d8a718018a3ebba23b02d072 100644
|
|
--- a/net/minecraft/world/level/block/HoneyBlock.java
|
|
+++ b/net/minecraft/world/level/block/HoneyBlock.java
|
|
@@ -49,9 +49,7 @@ public class HoneyBlock extends HalfTransparentBlock {
|
|
@Override
|
|
public void fallOn(Level level, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
|
|
entity.playSound(SoundEvents.HONEY_BLOCK_SLIDE, 1.0F, 1.0F);
|
|
- if (!level.isClientSide) {
|
|
- level.broadcastEntityEvent(entity, (byte)54);
|
|
- }
|
|
+ level.broadcastEntityEvent(entity, (byte)54); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (entity.causeFallDamage(fallDistance, 0.2F, level.damageSources().fall())) {
|
|
entity.playSound(this.soundType.getFallSound(), this.soundType.getVolume() * 0.5F, this.soundType.getPitch() * 0.75F);
|
|
@@ -117,12 +115,13 @@ public class HoneyBlock extends HalfTransparentBlock {
|
|
entity.playSound(SoundEvents.HONEY_BLOCK_SLIDE, 1.0F, 1.0F);
|
|
}
|
|
|
|
- if (!level.isClientSide && level.random.nextInt(5) == 0) {
|
|
+ if (/*!level.isClientSide &&*/ level.random.nextInt(5) == 0) { // Plazma - Remove isClientSide on DedicatedServer
|
|
level.broadcastEntityEvent(entity, (byte)53);
|
|
}
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static void showSlideParticles(Entity entity) {
|
|
showParticles(entity, 5);
|
|
}
|
|
@@ -141,4 +140,5 @@ public class HoneyBlock extends HalfTransparentBlock {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/HopperBlock.java b/net/minecraft/world/level/block/HopperBlock.java
|
|
index 910adca428765f5fc82c1346a4cee4b2038b0028..c8ae31b9a0f71e19cbe6750e2161e0964b478557 100644
|
|
--- a/net/minecraft/world/level/block/HopperBlock.java
|
|
+++ b/net/minecraft/world/level/block/HopperBlock.java
|
|
@@ -113,7 +113,7 @@ public class HopperBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return level.isClientSide ? null : createTickerHelper(blockEntityType, BlockEntityType.HOPPER, HopperBlockEntity::pushItemsTick);
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.HOPPER, HopperBlockEntity::pushItemsTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -125,7 +125,7 @@ public class HopperBlock extends BaseEntityBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide && level.getBlockEntity(pos) instanceof HopperBlockEntity hopperBlockEntity && player.openMenu(hopperBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
+ if (/*!level.isClientSide &&*/ level.getBlockEntity(pos) instanceof HopperBlockEntity hopperBlockEntity && player.openMenu(hopperBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
player.awardStat(Stats.INSPECT_HOPPER);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/level/block/LeavesBlock.java b/net/minecraft/world/level/block/LeavesBlock.java
|
|
index 06be7c717e4c7490069a7e3bf4852c7f71c2de18..6606e4a96127e0e4fe5e85c9d216fbcccecae77e 100644
|
|
--- a/net/minecraft/world/level/block/LeavesBlock.java
|
|
+++ b/net/minecraft/world/level/block/LeavesBlock.java
|
|
@@ -145,6 +145,7 @@ public class LeavesBlock extends Block implements SimpleWaterloggedBlock {
|
|
return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (level.isRainingAt(pos.above())) {
|
|
@@ -157,6 +158,7 @@ public class LeavesBlock extends Block implements SimpleWaterloggedBlock {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
|
diff --git a/net/minecraft/world/level/block/LecternBlock.java b/net/minecraft/world/level/block/LecternBlock.java
|
|
index 8ebfa89d84d6dca8b71eb8a211438f28895e6ad5..0b1deeb0fee679cb4b2dbb99b5c9ecba2e85ec89 100644
|
|
--- a/net/minecraft/world/level/block/LecternBlock.java
|
|
+++ b/net/minecraft/world/level/block/LecternBlock.java
|
|
@@ -100,11 +100,11 @@ public class LecternBlock extends BaseEntityBlock {
|
|
|
|
@Override
|
|
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
|
- Level level = context.getLevel();
|
|
+ //Level level = context.getLevel(); // Plazma - Remove isClientSide on DedicatedServer
|
|
ItemStack itemInHand = context.getItemInHand();
|
|
Player player = context.getPlayer();
|
|
boolean flag = false;
|
|
- if (!level.isClientSide && player != null && player.canUseGameMasterBlocks()) {
|
|
+ if (/*!level.isClientSide &&*/ player != null && player.canUseGameMasterBlocks()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
CustomData customData = itemInHand.getOrDefault(DataComponents.BLOCK_ENTITY_DATA, CustomData.EMPTY);
|
|
if (customData.contains("Book")) {
|
|
flag = true;
|
|
@@ -157,9 +157,7 @@ public class LecternBlock extends BaseEntityBlock {
|
|
|
|
public static boolean tryPlaceBook(@Nullable LivingEntity entity, Level level, BlockPos pos, BlockState state, ItemStack stack) {
|
|
if (!state.getValue(HAS_BOOK)) {
|
|
- if (!level.isClientSide) {
|
|
- placeBook(entity, level, pos, state, stack);
|
|
- }
|
|
+ placeBook(entity, level, pos, state, stack); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return true;
|
|
} else {
|
|
@@ -306,9 +304,7 @@ public class LecternBlock extends BaseEntityBlock {
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
if (state.getValue(HAS_BOOK)) {
|
|
- if (!level.isClientSide) {
|
|
- this.openScreen(level, pos, player);
|
|
- }
|
|
+ this.openScreen(level, pos, player); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
diff --git a/net/minecraft/world/level/block/LeverBlock.java b/net/minecraft/world/level/block/LeverBlock.java
|
|
index aa97bd30f7a09b17b7d8ec075571f1279ec0a245..c6bdb7f388da2502f9d28b10c5664e6e0944f028 100644
|
|
--- a/net/minecraft/world/level/block/LeverBlock.java
|
|
+++ b/net/minecraft/world/level/block/LeverBlock.java
|
|
@@ -94,27 +94,22 @@ public class LeverBlock extends FaceAttachedHorizontalDirectionalBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (level.isClientSide) {
|
|
- BlockState blockState = state.cycle(POWERED);
|
|
- if (blockState.getValue(POWERED)) {
|
|
- makeParticle(blockState, level, pos, 1.0F);
|
|
- }
|
|
- } else {
|
|
- // CraftBukkit start - Interact Lever
|
|
- boolean powered = state.getValue(LeverBlock.POWERED); // Old powered state
|
|
- org.bukkit.block.Block block = level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
|
|
- int old = (powered) ? 15 : 0;
|
|
- int current = (!powered) ? 15 : 0;
|
|
-
|
|
- org.bukkit.event.block.BlockRedstoneEvent eventRedstone = new org.bukkit.event.block.BlockRedstoneEvent(block, old, current);
|
|
- level.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
|
-
|
|
- if ((eventRedstone.getNewCurrent() > 0) != (!powered)) {
|
|
- return InteractionResult.SUCCESS;
|
|
- }
|
|
- // CraftBukkit end
|
|
- this.pull(state, level, pos, null);
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+
|
|
+ // CraftBukkit start - Interact Lever
|
|
+ final boolean powered = state.getValue(LeverBlock.POWERED); // Old powered state
|
|
+ final org.bukkit.block.Block block = level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
|
|
+
|
|
+ final org.bukkit.event.block.BlockRedstoneEvent eventRedstone = new org.bukkit.event.block.BlockRedstoneEvent(block, powered ? 15 : 0, powered ? 0 : 15);
|
|
+ level.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
|
+
|
|
+ if ((eventRedstone.getNewCurrent() > 0) == powered) {
|
|
+ return InteractionResult.SUCCESS;
|
|
}
|
|
+ // CraftBukkit end
|
|
+
|
|
+ this.pull(state, level, pos, null);
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
@@ -150,12 +145,14 @@ public class LeverBlock extends FaceAttachedHorizontalDirectionalBlock {
|
|
level.addParticle(new DustParticleOptions(16711680, alpha), d, d1, d2, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(POWERED) && random.nextFloat() < 0.25F) {
|
|
makeParticle(state, level, pos, 0.5F);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) {
|
|
diff --git a/net/minecraft/world/level/block/LightBlock.java b/net/minecraft/world/level/block/LightBlock.java
|
|
index 4e2c0383eda3e81bbc40a724263b49151a342746..f4599b070094fefa045c147a9bd015d9df7c0679 100644
|
|
--- a/net/minecraft/world/level/block/LightBlock.java
|
|
+++ b/net/minecraft/world/level/block/LightBlock.java
|
|
@@ -59,7 +59,7 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide && player.canUseGameMasterBlocks()) {
|
|
+ if (/*!level.isClientSide &&*/ player.canUseGameMasterBlocks()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
level.setBlock(pos, state.cycle(LEVEL), 2);
|
|
return InteractionResult.SUCCESS_SERVER;
|
|
} else {
|
|
diff --git a/net/minecraft/world/level/block/LightningRodBlock.java b/net/minecraft/world/level/block/LightningRodBlock.java
|
|
index 50cb7aa3fd991e03e644323b12028f09401755c0..e616356f89644be76bd7e618bc794defda80c6f4 100644
|
|
--- a/net/minecraft/world/level/block/LightningRodBlock.java
|
|
+++ b/net/minecraft/world/level/block/LightningRodBlock.java
|
|
@@ -113,6 +113,7 @@ public class LightningRodBlock extends RodBlock implements SimpleWaterloggedBloc
|
|
this.updateNeighbours(state, level, pos);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (level.isThundering()
|
|
@@ -121,6 +122,7 @@ public class LightningRodBlock extends RodBlock implements SimpleWaterloggedBloc
|
|
ParticleUtils.spawnParticlesAlongAxis(state.getValue(FACING).getAxis(), level, pos, 0.125, ParticleTypes.ELECTRIC_SPARK, UniformInt.of(1, 2));
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean movedByPiston) {
|
|
diff --git a/net/minecraft/world/level/block/LoomBlock.java b/net/minecraft/world/level/block/LoomBlock.java
|
|
index c51ed1081ba34b6c4deb554c4165428b39beb575..4aa5148b13c7a49a0cb29e2a79e50d2faa9cfcd9 100644
|
|
--- a/net/minecraft/world/level/block/LoomBlock.java
|
|
+++ b/net/minecraft/world/level/block/LoomBlock.java
|
|
@@ -32,9 +32,7 @@ public class LoomBlock extends HorizontalDirectionalBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide && player.openMenu(state.getMenuProvider(level, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
- player.awardStat(Stats.INTERACT_WITH_LOOM);
|
|
- }
|
|
+ player.openMenu(state.getMenuProvider(level, pos)).ifPresent(ignore -> player.awardStat(Stats.INTERACT_WITH_LOOM)); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/MossyCarpetBlock.java b/net/minecraft/world/level/block/MossyCarpetBlock.java
|
|
index 8e781fe7c33ce5d78320a01731f5f6ee85dc389b..82a073102f456762d739b7d1c202f9f84a23cf0e 100644
|
|
--- a/net/minecraft/world/level/block/MossyCarpetBlock.java
|
|
+++ b/net/minecraft/world/level/block/MossyCarpetBlock.java
|
|
@@ -208,13 +208,8 @@ public class MossyCarpetBlock extends Block implements BonemealableBlock {
|
|
|
|
@Override
|
|
public void setPlacedBy(Level level, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) {
|
|
- if (!level.isClientSide) {
|
|
- RandomSource random = level.getRandom();
|
|
- BlockState blockState = createTopperWithSideChance(level, pos, random::nextBoolean);
|
|
- if (!blockState.isAir()) {
|
|
- level.setBlock(pos.above(), blockState, 3);
|
|
- }
|
|
- }
|
|
+ final BlockState blockState = createTopperWithSideChance(level, pos, level.getRandom()::nextBoolean); // Plazma - Remove isClientSide on DedicatedServer
|
|
+ if (!blockState.isAir()) level.setBlock(pos.above(), blockState, 3); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private static BlockState createTopperWithSideChance(BlockGetter level, BlockPos pos, BooleanSupplier placeSide) {
|
|
diff --git a/net/minecraft/world/level/block/MyceliumBlock.java b/net/minecraft/world/level/block/MyceliumBlock.java
|
|
index 20afd1bc11ea4bcbc76df49a1edd5392f3d95064..de8e5a3e993c22446e3f3e681746ddebeccda3f7 100644
|
|
--- a/net/minecraft/world/level/block/MyceliumBlock.java
|
|
+++ b/net/minecraft/world/level/block/MyceliumBlock.java
|
|
@@ -20,6 +20,7 @@ public class MyceliumBlock extends SpreadingSnowyDirtBlock {
|
|
super(properties);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
super.animateTick(state, level, pos, random);
|
|
@@ -27,4 +28,5 @@ public class MyceliumBlock extends SpreadingSnowyDirtBlock {
|
|
level.addParticle(ParticleTypes.MYCELIUM, pos.getX() + random.nextDouble(), pos.getY() + 1.1, pos.getZ() + random.nextDouble(), 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/NetherPortalBlock.java b/net/minecraft/world/level/block/NetherPortalBlock.java
|
|
index eb659209008209c0930770e5f9671a3d7a4abae6..63af19715ad885d866974b1989bb08f33d0eb176 100644
|
|
--- a/net/minecraft/world/level/block/NetherPortalBlock.java
|
|
+++ b/net/minecraft/world/level/block/NetherPortalBlock.java
|
|
@@ -274,6 +274,7 @@ public class NetherPortalBlock extends Block implements Portal {
|
|
return Portal.Transition.CONFUSION;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (random.nextInt(100) == 0) {
|
|
@@ -308,6 +309,7 @@ public class NetherPortalBlock extends Block implements Portal {
|
|
level.addParticle(ParticleTypes.PORTAL, d, d1, d2, d3, d4, d5);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state, boolean includeData) {
|
|
diff --git a/net/minecraft/world/level/block/NoteBlock.java b/net/minecraft/world/level/block/NoteBlock.java
|
|
index 83cacb07f7d828bac45b57b7361bb31e6d716b03..9e6ec047e23c2994b8d345a2af50b48c7d4b56db 100644
|
|
--- a/net/minecraft/world/level/block/NoteBlock.java
|
|
+++ b/net/minecraft/world/level/block/NoteBlock.java
|
|
@@ -124,22 +124,22 @@ public class NoteBlock extends Block {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) state = state.cycle(NoteBlock.NOTE); // Paper - prevent noteblock note from updating
|
|
level.setBlock(pos, state, 3);
|
|
this.playNote(player, state, level, pos);
|
|
player.awardStat(Stats.TUNE_NOTEBLOCK);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
|
|
@Override
|
|
protected void attack(BlockState state, Level level, BlockPos pos, Player player) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.playNote(player, state, level, pos);
|
|
player.awardStat(Stats.PLAY_NOTEBLOCK);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public static float getPitchFromNote(int note) {
|
|
diff --git a/net/minecraft/world/level/block/ObserverBlock.java b/net/minecraft/world/level/block/ObserverBlock.java
|
|
index 69f4baf508b6e0015190fba5bdded2f45f3ebf6b..73b8aa16bb9eaaeabd99d8e12cb00e0d49666998 100644
|
|
--- a/net/minecraft/world/level/block/ObserverBlock.java
|
|
+++ b/net/minecraft/world/level/block/ObserverBlock.java
|
|
@@ -89,7 +89,7 @@ public class ObserverBlock extends DirectionalBlock {
|
|
}
|
|
|
|
private void startSignal(LevelReader level, ScheduledTickAccess scheduledTickAccess, BlockPos pos) {
|
|
- if (!level.isClientSide() && !scheduledTickAccess.getBlockTicks().hasScheduledTick(pos, this)) {
|
|
+ if (/*!level.isClientSide() &&*/ !scheduledTickAccess.getBlockTicks().hasScheduledTick(pos, this)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
scheduledTickAccess.scheduleTick(pos, this, 2);
|
|
}
|
|
}
|
|
@@ -120,7 +120,7 @@ public class ObserverBlock extends DirectionalBlock {
|
|
@Override
|
|
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) {
|
|
if (!state.is(oldState.getBlock())) {
|
|
- if (!level.isClientSide() && state.getValue(POWERED) && !level.getBlockTicks().hasScheduledTick(pos, this)) {
|
|
+ if (/*!level.isClientSide() &&*/ state.getValue(POWERED) && !level.getBlockTicks().hasScheduledTick(pos, this)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockState blockState = state.setValue(POWERED, false);
|
|
level.setBlock(pos, blockState, 18);
|
|
this.updateNeighborsInFront(level, pos, blockState);
|
|
@@ -131,7 +131,7 @@ public class ObserverBlock extends DirectionalBlock {
|
|
@Override
|
|
protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) {
|
|
if (!state.is(newState.getBlock())) {
|
|
- if (!level.isClientSide && state.getValue(POWERED) && level.getBlockTicks().hasScheduledTick(pos, this)) {
|
|
+ if (/*!level.isClientSide &&*/ state.getValue(POWERED) && level.getBlockTicks().hasScheduledTick(pos, this)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.updateNeighborsInFront(level, pos, state.setValue(POWERED, false));
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/ParticleLeavesBlock.java b/net/minecraft/world/level/block/ParticleLeavesBlock.java
|
|
index ba9e2da881898e1d1f9590ec00f6c58d60b38349..fccfdbd5e5fc0c56c01aa4edbe21cdff36750dc0 100644
|
|
--- a/net/minecraft/world/level/block/ParticleLeavesBlock.java
|
|
+++ b/net/minecraft/world/level/block/ParticleLeavesBlock.java
|
|
@@ -36,6 +36,7 @@ public class ParticleLeavesBlock extends LeavesBlock {
|
|
this.particle = particle;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
super.animateTick(state, level, pos, random);
|
|
@@ -47,4 +48,5 @@ public class ParticleLeavesBlock extends LeavesBlock {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/PointedDripstoneBlock.java b/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
|
index a23d0b503e0a0139517ad0856d5c8d5f56ec8dbe..eb21ddc3f9714faea90ce676620806528da018fe 100644
|
|
--- a/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
|
+++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
|
@@ -140,7 +140,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
|
|
|
@Override
|
|
protected void onProjectileHit(Level level, BlockState state, BlockHitResult hit, Projectile projectile) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockPos blockPos = hit.getBlockPos();
|
|
if (level instanceof ServerLevel serverLevel
|
|
&& projectile.mayInteract(serverLevel, blockPos)
|
|
@@ -154,7 +154,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
|
// CraftBukkit end
|
|
level.destroyBlock(blockPos, true);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -166,6 +166,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (canDrip(state)) {
|
|
@@ -177,6 +178,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
|
@@ -414,6 +416,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
|
createDripstone(level, blockPos, Direction.UP, DripstoneThickness.TIP_MERGE, pos); // CraftBukkit
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static void spawnDripParticle(Level level, BlockPos pos, BlockState state) {
|
|
getFluidAboveStalactite(level, pos, state).ifPresent(fluidInfo -> spawnDripParticle(level, pos, state, fluidInfo.fluid));
|
|
}
|
|
@@ -428,6 +431,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
|
ParticleOptions particleOptions = dripFluid.is(FluidTags.LAVA) ? ParticleTypes.DRIPPING_DRIPSTONE_LAVA : ParticleTypes.DRIPPING_DRIPSTONE_WATER;
|
|
level.addParticle(particleOptions, d1, d2, d3, 0.0, 0.0, 0.0);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Nullable
|
|
private static BlockPos findTip(BlockState state, LevelAccessor level, BlockPos pos, int maxIterations, boolean isTipMerge) {
|
|
@@ -580,6 +584,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
|
return dripstoneState.is(Blocks.DRIPSTONE_BLOCK) && state.is(Blocks.WATER) && state.getFluidState().isSource();
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private static Fluid getDripFluid(Level level, Fluid fluid) {
|
|
if (fluid.isSame(Fluids.EMPTY)) {
|
|
return level.dimensionType().ultraWarm() ? Fluids.LAVA : Fluids.WATER;
|
|
@@ -587,6 +592,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
|
return fluid;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
private static Optional<BlockPos> findBlockVertical(
|
|
LevelAccessor level,
|
|
diff --git a/net/minecraft/world/level/block/PowderSnowBlock.java b/net/minecraft/world/level/block/PowderSnowBlock.java
|
|
index 4f3646961beb877520e257e11224c3045467d351..adea7093677e5b04021c50b86b442dce3063070e 100644
|
|
--- a/net/minecraft/world/level/block/PowderSnowBlock.java
|
|
+++ b/net/minecraft/world/level/block/PowderSnowBlock.java
|
|
@@ -61,7 +61,7 @@ public class PowderSnowBlock extends Block implements BucketPickup {
|
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
|
if (!(entity instanceof LivingEntity) || entity.getInBlockState().is(this)) {
|
|
entity.makeStuckInBlock(state, new Vec3(0.9F, 1.5, 0.9F));
|
|
- if (level.isClientSide) {
|
|
+ /*if (level.isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
RandomSource random = level.getRandom();
|
|
boolean flag = entity.xOld != entity.getX() || entity.zOld != entity.getZ();
|
|
if (flag && random.nextBoolean()) {
|
|
@@ -76,6 +76,7 @@ public class PowderSnowBlock extends Block implements BucketPickup {
|
|
);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
entity.setIsInPowderSnow(true);
|
|
@@ -136,9 +137,7 @@ public class PowderSnowBlock extends Block implements BucketPickup {
|
|
@Override
|
|
public ItemStack pickupBlock(@Nullable Player player, LevelAccessor level, BlockPos pos, BlockState state) {
|
|
level.setBlock(pos, Blocks.AIR.defaultBlockState(), 11);
|
|
- if (!level.isClientSide()) {
|
|
- level.levelEvent(2001, pos, Block.getId(state));
|
|
- }
|
|
+ level.levelEvent(2001, pos, Block.getId(state)); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return new ItemStack(Items.POWDER_SNOW_BUCKET);
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/PumpkinBlock.java b/net/minecraft/world/level/block/PumpkinBlock.java
|
|
index 3dad6091e45ae28ae718790a6e411a05215df538..dfad0398792a720a44dc92f72545938c63d4810f 100644
|
|
--- a/net/minecraft/world/level/block/PumpkinBlock.java
|
|
+++ b/net/minecraft/world/level/block/PumpkinBlock.java
|
|
@@ -37,8 +37,10 @@ public class PumpkinBlock extends Block {
|
|
) {
|
|
if (!stack.is(Items.SHEARS)) {
|
|
return super.useItemOn(stack, state, level, pos, player, hand, hitResult);
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
} else if (level.isClientSide) {
|
|
return InteractionResult.SUCCESS;
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
} else {
|
|
// Paper start - Add PlayerShearBlockEvent
|
|
io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(stack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>());
|
|
diff --git a/net/minecraft/world/level/block/RedStoneOreBlock.java b/net/minecraft/world/level/block/RedStoneOreBlock.java
|
|
index dea17f0130cc37ce5b4330f47e05e138eb898b2f..2a1d5a5d8103ccef1bb5f8709ece6aee363768f4 100644
|
|
--- a/net/minecraft/world/level/block/RedStoneOreBlock.java
|
|
+++ b/net/minecraft/world/level/block/RedStoneOreBlock.java
|
|
@@ -67,11 +67,7 @@ public class RedStoneOreBlock extends Block {
|
|
protected InteractionResult useItemOn(
|
|
ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult
|
|
) {
|
|
- if (level.isClientSide) {
|
|
- spawnParticles(level, pos);
|
|
- } else {
|
|
- interact(state, level, pos, player); // CraftBukkit - add entityhuman
|
|
- }
|
|
+ interact(state, level, pos, player); // CraftBukkit - add entityhuman // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return (InteractionResult)(stack.getItem() instanceof BlockItem && new BlockPlaceContext(player, hand, stack, hitResult).canPlace()
|
|
? InteractionResult.PASS
|
|
@@ -123,12 +119,14 @@ public class RedStoneOreBlock extends Block {
|
|
// CraftBukkit end
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(LIT)) {
|
|
spawnParticles(level, pos);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
private static void spawnParticles(Level level, BlockPos pos) {
|
|
//double d = 0.5625; // Plazma - Remove unused variables
|
|
diff --git a/net/minecraft/world/level/block/RedStoneWireBlock.java b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
index ed07fb978743726d2ebb5f18b5359241a3d7c9d2..e87405287e52e805c734ccd8cd1c7e91a4b258da 100644
|
|
--- a/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
+++ b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
@@ -371,7 +371,7 @@ public class RedStoneWireBlock extends Block {
|
|
|
|
@Override
|
|
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) {
|
|
- if (!oldState.is(state.getBlock()) && !level.isClientSide) {
|
|
+ if (!oldState.is(state.getBlock()) /*&& !level.isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// Paper start - optimize redstone - replace call to updatePowerStrength
|
|
if (level.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) {
|
|
level.getWireHandler().onWireAdded(pos, state); // Alternate Current
|
|
@@ -392,7 +392,7 @@ public class RedStoneWireBlock extends Block {
|
|
protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) {
|
|
if (!isMoving && !state.is(newState.getBlock())) {
|
|
super.onRemove(state, level, pos, newState, isMoving);
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
for (Direction direction : Direction.values()) {
|
|
level.updateNeighborsAt(pos.relative(direction), this);
|
|
}
|
|
@@ -405,7 +405,7 @@ public class RedStoneWireBlock extends Block {
|
|
}
|
|
// Paper end - optimize redstone
|
|
this.updateNeighborsOfNeighboringWires(level, pos);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
|
|
@@ -426,7 +426,7 @@ public class RedStoneWireBlock extends Block {
|
|
|
|
@Override
|
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
// Paper start - optimize redstone (Alternate Current)
|
|
// Alternate Current handles breaking of redstone wires in the WireHandler.
|
|
if (level.paperConfig().misc.redstoneImplementation == io.papermc.paper.configuration.WorldConfiguration.Misc.RedstoneImplementation.ALTERNATE_CURRENT) {
|
|
@@ -441,7 +441,7 @@ public class RedStoneWireBlock extends Block {
|
|
level.removeBlock(pos, false);
|
|
}
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private static boolean useExperimentalEvaluator(Level level) {
|
|
@@ -490,6 +490,7 @@ public class RedStoneWireBlock extends Block {
|
|
return this.shouldSignal;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static int getColorForPower(int power) {
|
|
return COLORS[power];
|
|
}
|
|
@@ -527,6 +528,7 @@ public class RedStoneWireBlock extends Block {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected BlockState rotate(BlockState state, Rotation rotation) {
|
|
diff --git a/net/minecraft/world/level/block/RedstoneLampBlock.java b/net/minecraft/world/level/block/RedstoneLampBlock.java
|
|
index 83bca10b52c23ea935c5fa441b0a2213ad7f77ab..97f0208b7b110520d0a8007ae5f7264d7cc98d9f 100644
|
|
--- a/net/minecraft/world/level/block/RedstoneLampBlock.java
|
|
+++ b/net/minecraft/world/level/block/RedstoneLampBlock.java
|
|
@@ -35,7 +35,7 @@ public class RedstoneLampBlock extends Block {
|
|
|
|
@Override
|
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean litValue = state.getValue(LIT);
|
|
if (litValue != level.hasNeighborSignal(pos)) {
|
|
if (litValue) {
|
|
@@ -49,7 +49,7 @@ public class RedstoneLampBlock extends Block {
|
|
level.setBlock(pos, state.cycle(LIT), 2);
|
|
}
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/RedstoneTorchBlock.java b/net/minecraft/world/level/block/RedstoneTorchBlock.java
|
|
index 3489d0069ada5d0e0829ade0e6a209454c7ae7d7..4125396853304f394d40fc9dac468064fbf241ef 100644
|
|
--- a/net/minecraft/world/level/block/RedstoneTorchBlock.java
|
|
+++ b/net/minecraft/world/level/block/RedstoneTorchBlock.java
|
|
@@ -137,6 +137,7 @@ public class RedstoneTorchBlock extends BaseTorchBlock {
|
|
return true;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(LIT)) {
|
|
@@ -146,6 +147,7 @@ public class RedstoneTorchBlock extends BaseTorchBlock {
|
|
level.addParticle(DustParticleOptions.REDSTONE, d, d1, d2, 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
|
diff --git a/net/minecraft/world/level/block/RedstoneWallTorchBlock.java b/net/minecraft/world/level/block/RedstoneWallTorchBlock.java
|
|
index 0ebd9f3088e3a9294b5ce20f97aa1130cf35e879..250fcb6627bf2e8ae468df3b608be1cc5fe0d7b5 100644
|
|
--- a/net/minecraft/world/level/block/RedstoneWallTorchBlock.java
|
|
+++ b/net/minecraft/world/level/block/RedstoneWallTorchBlock.java
|
|
@@ -67,6 +67,7 @@ public class RedstoneWallTorchBlock extends RedstoneTorchBlock {
|
|
return stateForPlacement == null ? null : this.defaultBlockState().setValue(FACING, stateForPlacement.getValue(FACING));
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(LIT)) {
|
|
@@ -78,6 +79,7 @@ public class RedstoneWallTorchBlock extends RedstoneTorchBlock {
|
|
level.addParticle(DustParticleOptions.REDSTONE, d1, d2, d3, 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected boolean hasNeighborSignal(Level level, BlockPos pos, BlockState state) {
|
|
diff --git a/net/minecraft/world/level/block/RepeaterBlock.java b/net/minecraft/world/level/block/RepeaterBlock.java
|
|
index ea4f738f949e46d3f0e581758b8e539ddf48327c..12a9d0fb8ea094692ceb8382983b9de2e7dd6905 100644
|
|
--- a/net/minecraft/world/level/block/RepeaterBlock.java
|
|
+++ b/net/minecraft/world/level/block/RepeaterBlock.java
|
|
@@ -76,7 +76,7 @@ public class RepeaterBlock extends DiodeBlock {
|
|
if (direction == Direction.DOWN && !this.canSurviveOn(level, neighborPos, neighborState)) {
|
|
return Blocks.AIR.defaultBlockState();
|
|
} else {
|
|
- return !level.isClientSide() && direction.getAxis() != state.getValue(FACING).getAxis()
|
|
+ return /*!level.isClientSide() &&*/ direction.getAxis() != state.getValue(FACING).getAxis() // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
? state.setValue(LOCKED, this.isLocked(level, pos, state))
|
|
: super.updateShape(state, level, scheduledTickAccess, pos, direction, neighborPos, neighborState, random);
|
|
}
|
|
@@ -92,6 +92,7 @@ public class RepeaterBlock extends DiodeBlock {
|
|
return true;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(POWERED)) {
|
|
@@ -110,6 +111,7 @@ public class RepeaterBlock extends DiodeBlock {
|
|
level.addParticle(DustParticleOptions.REDSTONE, d + d3, d1, d2 + d4, 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
|
diff --git a/net/minecraft/world/level/block/RespawnAnchorBlock.java b/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
|
index 167bb36fa80030a0c0f9724f1ff7688322773fb2..deffccafa8034434b9301a15c1f240d28f0fab1e 100644
|
|
--- a/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
|
+++ b/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
|
@@ -93,13 +93,11 @@ public class RespawnAnchorBlock extends Block {
|
|
if (state.getValue(CHARGE) == 0) {
|
|
return InteractionResult.PASS;
|
|
} else if (!canSetSpawn(level)) {
|
|
- if (!level.isClientSide) {
|
|
- this.explode(state, level, pos);
|
|
- }
|
|
+ this.explode(state, level, pos); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
} else {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ServerPlayer serverPlayer = (ServerPlayer)player;
|
|
if (serverPlayer.getRespawnDimension() != level.dimension() || !pos.equals(serverPlayer.getRespawnPosition())) {
|
|
if (serverPlayer.setRespawnPosition(level.dimension(), pos, 0.0F, false, true, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.RESPAWN_ANCHOR)) { // Paper - Add PlayerSetSpawnEvent
|
|
@@ -113,7 +111,7 @@ public class RespawnAnchorBlock extends Block {
|
|
}
|
|
// Paper end - Add PlayerSetSpawnEvent
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.CONSUME;
|
|
}
|
|
@@ -174,6 +172,7 @@ public class RespawnAnchorBlock extends Block {
|
|
level.playSound(null, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, SoundEvents.RESPAWN_ANCHOR_CHARGE, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(CHARGE) != 0) {
|
|
@@ -188,6 +187,7 @@ public class RespawnAnchorBlock extends Block {
|
|
level.addParticle(ParticleTypes.REVERSE_PORTAL, d, d1, d2, 0.0, d3, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
|
diff --git a/net/minecraft/world/level/block/ScaffoldingBlock.java b/net/minecraft/world/level/block/ScaffoldingBlock.java
|
|
index b846efc0ec43cccd2b60c0ad0d2f9493ebedf5d8..ea87f4c11853417032d1c95f430a1f4f2dc84045 100644
|
|
--- a/net/minecraft/world/level/block/ScaffoldingBlock.java
|
|
+++ b/net/minecraft/world/level/block/ScaffoldingBlock.java
|
|
@@ -88,9 +88,7 @@ public class ScaffoldingBlock extends Block implements SimpleWaterloggedBlock {
|
|
|
|
@Override
|
|
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) {
|
|
- if (!level.isClientSide) {
|
|
- level.scheduleTick(pos, this, 1);
|
|
- }
|
|
+ level.scheduleTick(pos, this, 1); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -108,9 +106,7 @@ public class ScaffoldingBlock extends Block implements SimpleWaterloggedBlock {
|
|
scheduledTickAccess.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level));
|
|
}
|
|
|
|
- if (!level.isClientSide()) {
|
|
- scheduledTickAccess.scheduleTick(pos, this, 1);
|
|
- }
|
|
+ scheduledTickAccess.scheduleTick(pos, this, 1); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return state;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/SculkCatalystBlock.java b/net/minecraft/world/level/block/SculkCatalystBlock.java
|
|
index 459d6ee0de5e1680d5505039a67216006af994fe..c8d32cd0738dc4d0507dd822a106a7f9637e865c 100644
|
|
--- a/net/minecraft/world/level/block/SculkCatalystBlock.java
|
|
+++ b/net/minecraft/world/level/block/SculkCatalystBlock.java
|
|
@@ -55,7 +55,7 @@ public class SculkCatalystBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return level.isClientSide ? null : createTickerHelper(blockEntityType, BlockEntityType.SCULK_CATALYST, SculkCatalystBlockEntity::serverTick);
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.SCULK_CATALYST, SculkCatalystBlockEntity::serverTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/SculkSensorBlock.java b/net/minecraft/world/level/block/SculkSensorBlock.java
|
|
index 430cdf1442e6a2fe9cb91b7002881c013617622a..b3e696a83fa448a2f51e0c25c95de943bc096607 100644
|
|
--- a/net/minecraft/world/level/block/SculkSensorBlock.java
|
|
+++ b/net/minecraft/world/level/block/SculkSensorBlock.java
|
|
@@ -102,8 +102,7 @@ public class SculkSensorBlock extends BaseEntityBlock implements SimpleWaterlogg
|
|
|
|
@Override
|
|
public void stepOn(Level level, BlockPos pos, BlockState state, Entity entity) {
|
|
- if (!level.isClientSide()
|
|
- && canActivate(state)
|
|
+ if (canActivate(state) // Plazma - Remove isClientSide on DedicatedServer
|
|
&& entity.getType() != EntityType.WARDEN
|
|
&& level.getBlockEntity(pos) instanceof SculkSensorBlockEntity sculkSensorBlockEntity
|
|
&& level instanceof ServerLevel serverLevel
|
|
@@ -128,7 +127,7 @@ public class SculkSensorBlock extends BaseEntityBlock implements SimpleWaterlogg
|
|
|
|
@Override
|
|
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) {
|
|
- if (!level.isClientSide() && !state.is(oldState.getBlock())) {
|
|
+ if (/*!level.isClientSide() &&*/ !state.is(oldState.getBlock())) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (state.getValue(POWER) > 0 && !level.getBlockTicks().hasScheduledTick(pos, this)) {
|
|
level.setBlock(pos, state.setValue(POWER, 0), 18);
|
|
}
|
|
@@ -178,13 +177,7 @@ public class SculkSensorBlock extends BaseEntityBlock implements SimpleWaterlogg
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return !level.isClientSide
|
|
- ? createTickerHelper(
|
|
- blockEntityType,
|
|
- BlockEntityType.SCULK_SENSOR,
|
|
- (level1, pos, state1, blockEntity) -> VibrationSystem.Ticker.tick(level1, blockEntity.getVibrationData(), blockEntity.getVibrationUser())
|
|
- )
|
|
- : null;
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.SCULK_SENSOR, (level1, pos, state1, blockEntity) -> VibrationSystem.Ticker.tick(level1, blockEntity.getVibrationData(), blockEntity.getVibrationUser())); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
@@ -276,6 +269,7 @@ public class SculkSensorBlock extends BaseEntityBlock implements SimpleWaterlogg
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (getPhase(state) == SculkSensorPhase.ACTIVE) {
|
|
@@ -289,6 +283,7 @@ public class SculkSensorBlock extends BaseEntityBlock implements SimpleWaterlogg
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
|
diff --git a/net/minecraft/world/level/block/SculkShriekerBlock.java b/net/minecraft/world/level/block/SculkShriekerBlock.java
|
|
index 6fea9f31231ff5d1131786881880172ccd8f955d..b3ac5f15c426b62510858cbd89c93a6a09c500f8 100644
|
|
--- a/net/minecraft/world/level/block/SculkShriekerBlock.java
|
|
+++ b/net/minecraft/world/level/block/SculkShriekerBlock.java
|
|
@@ -160,12 +160,6 @@ public class SculkShriekerBlock extends BaseEntityBlock implements SimpleWaterlo
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return !level.isClientSide
|
|
- ? BaseEntityBlock.createTickerHelper(
|
|
- blockEntityType,
|
|
- BlockEntityType.SCULK_SHRIEKER,
|
|
- (level1, pos, state1, blockEntity) -> VibrationSystem.Ticker.tick(level1, blockEntity.getVibrationData(), blockEntity.getVibrationUser())
|
|
- )
|
|
- : null;
|
|
+ return BaseEntityBlock.createTickerHelper(blockEntityType, BlockEntityType.SCULK_SHRIEKER, (level1, pos, state1, blockEntity) -> VibrationSystem.Ticker.tick(level1, blockEntity.getVibrationData(), blockEntity.getVibrationUser())); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/ShulkerBoxBlock.java b/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
|
index cdf835ff107bc1eadde706d69384e687626fce70..7fedffe3fa69d900db22eaa046c31d2b5e22e604 100644
|
|
--- a/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
|
+++ b/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
|
@@ -132,7 +132,7 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
|
|
public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) {
|
|
BlockEntity blockEntity = level.getBlockEntity(pos);
|
|
if (blockEntity instanceof ShulkerBoxBlockEntity shulkerBoxBlockEntity) {
|
|
- if (!level.isClientSide && player.isCreative() && !shulkerBoxBlockEntity.isEmpty()) {
|
|
+ if (/*!level.isClientSide &&*/ player.isCreative() && !shulkerBoxBlockEntity.isEmpty()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ItemStack coloredItemStack = getColoredItemStack(this.getColor());
|
|
coloredItemStack.applyComponents(blockEntity.collectComponents());
|
|
ItemEntity itemEntity = new ItemEntity(level, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, coloredItemStack);
|
|
diff --git a/net/minecraft/world/level/block/SignBlock.java b/net/minecraft/world/level/block/SignBlock.java
|
|
index f33a42b4888dbf46175e0be409aa6c8688d552b9..a62a25abf9401812e7f02e6bf87d92c6249fafe4 100644
|
|
--- a/net/minecraft/world/level/block/SignBlock.java
|
|
+++ b/net/minecraft/world/level/block/SignBlock.java
|
|
@@ -90,39 +90,38 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
|
protected InteractionResult useItemOn(
|
|
ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult
|
|
) {
|
|
- if (level.getBlockEntity(pos) instanceof SignBlockEntity signBlockEntity) {
|
|
- SignApplicator signApplicator1 = stack.getItem() instanceof SignApplicator signApplicator ? signApplicator : null;
|
|
- boolean flag = signApplicator1 != null && player.mayBuild();
|
|
- if (!level.isClientSide) {
|
|
- if (flag && !signBlockEntity.isWaxed() && !this.otherPlayerIsEditingSign(player, signBlockEntity)) {
|
|
- boolean isFacingFrontText = signBlockEntity.isFacingFrontText(player);
|
|
- if (signApplicator1.canApplyToSign(signBlockEntity.getText(isFacingFrontText), player)
|
|
- && signApplicator1.tryApplyToSign(level, signBlockEntity, isFacingFrontText, player)) {
|
|
- signBlockEntity.executeClickCommandsIfPresent(player, level, pos, isFacingFrontText);
|
|
- player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
|
|
- level.gameEvent(GameEvent.BLOCK_CHANGE, signBlockEntity.getBlockPos(), GameEvent.Context.of(player, signBlockEntity.getBlockState()));
|
|
- stack.consume(1, player);
|
|
- return InteractionResult.SUCCESS;
|
|
- } else {
|
|
- return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
- }
|
|
- } else {
|
|
- return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
- }
|
|
- } else {
|
|
- return !flag && !signBlockEntity.isWaxed() ? InteractionResult.CONSUME : InteractionResult.SUCCESS;
|
|
- }
|
|
- } else {
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (!(level.getBlockEntity(pos) instanceof SignBlockEntity signBlockEntity)) {
|
|
return InteractionResult.PASS;
|
|
}
|
|
+
|
|
+ final SignApplicator applicator = stack.getItem() instanceof SignApplicator i ? i : null;
|
|
+ final boolean canUse = applicator != null && player.mayBuild();
|
|
+
|
|
+ if (!canUse || signBlockEntity.isWaxed() || this.otherPlayerIsEditingSign(player, signBlockEntity)) {
|
|
+ return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
+ }
|
|
+
|
|
+ final boolean facingFront = signBlockEntity.isFacingFrontText(player);
|
|
+ if (applicator.canApplyToSign(signBlockEntity.getText(facingFront), player) && applicator.tryApplyToSign(level, signBlockEntity, facingFront, player)) {
|
|
+ signBlockEntity.executeClickCommandsIfPresent(player, level, pos, facingFront);
|
|
+ player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
|
|
+ level.gameEvent(GameEvent.BLOCK_CHANGE, signBlockEntity.getBlockPos(), GameEvent.Context.of(player, signBlockEntity.getBlockState()));
|
|
+ stack.consume(1, player);
|
|
+ return InteractionResult.SUCCESS;
|
|
+ }
|
|
+
|
|
+ return InteractionResult.TRY_WITH_EMPTY_HAND;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
if (level.getBlockEntity(pos) instanceof SignBlockEntity signBlockEntity) {
|
|
- if (level.isClientSide) {
|
|
+ /*if (level.isClientSide) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
Util.pauseInIde(new IllegalStateException("Expected to only call this on server"));
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
boolean isFacingFrontText = signBlockEntity.isFacingFrontText(player);
|
|
boolean flag = signBlockEntity.executeClickCommandsIfPresent(player, level, pos, isFacingFrontText);
|
|
diff --git a/net/minecraft/world/level/block/SimpleWaterloggedBlock.java b/net/minecraft/world/level/block/SimpleWaterloggedBlock.java
|
|
index 24e4d918b0c3c4fabbd16d1e99612f7e67adfa70..45b358593a9a69aada1616525c9faaf259a3813f 100644
|
|
--- a/net/minecraft/world/level/block/SimpleWaterloggedBlock.java
|
|
+++ b/net/minecraft/world/level/block/SimpleWaterloggedBlock.java
|
|
@@ -24,10 +24,10 @@ public interface SimpleWaterloggedBlock extends BucketPickup, LiquidBlockContain
|
|
@Override
|
|
default boolean placeLiquid(LevelAccessor level, BlockPos pos, BlockState state, FluidState fluidState) {
|
|
if (!state.getValue(BlockStateProperties.WATERLOGGED) && fluidState.getType() == Fluids.WATER) {
|
|
- if (!level.isClientSide()) {
|
|
+ //if (!level.isClientSide()) { // Plazma - Remove isClientSide on DedicatedServer
|
|
level.setBlock(pos, state.setValue(BlockStateProperties.WATERLOGGED, true), 3);
|
|
level.scheduleTick(pos, fluidState.getType(), fluidState.getType().getTickDelay(level));
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
return true;
|
|
} else {
|
|
diff --git a/net/minecraft/world/level/block/SmallDripleafBlock.java b/net/minecraft/world/level/block/SmallDripleafBlock.java
|
|
index 97b648c5b163ad623579e0899829231f7fdb7649..13b9b786062ce13567cf6140394ca2a641df2bb2 100644
|
|
--- a/net/minecraft/world/level/block/SmallDripleafBlock.java
|
|
+++ b/net/minecraft/world/level/block/SmallDripleafBlock.java
|
|
@@ -67,13 +67,13 @@ public class SmallDripleafBlock extends DoublePlantBlock implements Bonemealable
|
|
|
|
@Override
|
|
public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
|
|
- if (!level.isClientSide()) {
|
|
+ //if (!level.isClientSide()) { // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockPos blockPos = pos.above();
|
|
BlockState blockState = DoublePlantBlock.copyWaterloggedFrom(
|
|
level, blockPos, this.defaultBlockState().setValue(HALF, DoubleBlockHalf.UPPER).setValue(FACING, state.getValue(FACING))
|
|
);
|
|
level.setBlock(blockPos, blockState, 3);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/SmithingTableBlock.java b/net/minecraft/world/level/block/SmithingTableBlock.java
|
|
index aa751d5d55524189ef1a9d09417b798b78de3c47..d43674bfc1234244f50f9776f9499d52db802d94 100644
|
|
--- a/net/minecraft/world/level/block/SmithingTableBlock.java
|
|
+++ b/net/minecraft/world/level/block/SmithingTableBlock.java
|
|
@@ -37,11 +37,7 @@ public class SmithingTableBlock extends CraftingTableBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide) {
|
|
- if (player.openMenu(state.getMenuProvider(level, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
- player.awardStat(Stats.INTERACT_WITH_SMITHING_TABLE);
|
|
- } // Paper - Fix InventoryOpenEvent cancellation
|
|
- }
|
|
+ player.openMenu(state.getMenuProvider(level, pos)).ifPresent(ignore -> player.awardStat(Stats.INTERACT_WITH_SMITHING_TABLE)); // Paper - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/SmokerBlock.java b/net/minecraft/world/level/block/SmokerBlock.java
|
|
index be2310171d2e6168886795758f415a7af3a00808..90356c642cd5cf841517293a0f516bf128ac4efa 100644
|
|
--- a/net/minecraft/world/level/block/SmokerBlock.java
|
|
+++ b/net/minecraft/world/level/block/SmokerBlock.java
|
|
@@ -49,6 +49,7 @@ public class SmokerBlock extends AbstractFurnaceBlock {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
if (state.getValue(LIT)) {
|
|
@@ -62,4 +63,5 @@ public class SmokerBlock extends AbstractFurnaceBlock {
|
|
level.addParticle(ParticleTypes.SMOKE, d, d1 + 1.1, d2, 0.0, 0.0, 0.0);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/SnifferEggBlock.java b/net/minecraft/world/level/block/SnifferEggBlock.java
|
|
index 60e0604b72347a3d2bf7624752372f1c16ab8b8f..05d7afd61780150f5212d630a9b802f972fb0d8a 100644
|
|
--- a/net/minecraft/world/level/block/SnifferEggBlock.java
|
|
+++ b/net/minecraft/world/level/block/SnifferEggBlock.java
|
|
@@ -101,9 +101,7 @@ public class SnifferEggBlock extends Block {
|
|
@Override
|
|
public void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) {
|
|
boolean flag = hatchBoost(level, pos);
|
|
- if (!level.isClientSide() && flag) {
|
|
- level.levelEvent(3009, pos, 0);
|
|
- }
|
|
+ level.levelEvent(3009, pos, 0); // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
int i = flag ? level.paperConfig().entities.sniffer.boostedHatchTime.or(BOOSTED_HATCH_TIME_TICKS) : level.paperConfig().entities.sniffer.hatchTime.or(REGULAR_HATCH_TIME_TICKS); // Paper
|
|
int i1 = i / 3;
|
|
diff --git a/net/minecraft/world/level/block/SpawnerBlock.java b/net/minecraft/world/level/block/SpawnerBlock.java
|
|
index 1121843e9db120ef02818369a1fe5f487342a49b..9602083bf24bb58fcdada772ebddf4f947ad6b5e 100644
|
|
--- a/net/minecraft/world/level/block/SpawnerBlock.java
|
|
+++ b/net/minecraft/world/level/block/SpawnerBlock.java
|
|
@@ -38,9 +38,7 @@ public class SpawnerBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return createTickerHelper(
|
|
- blockEntityType, BlockEntityType.MOB_SPAWNER, level.isClientSide ? SpawnerBlockEntity::clientTick : SpawnerBlockEntity::serverTick
|
|
- );
|
|
+ return createTickerHelper(blockEntityType, BlockEntityType.MOB_SPAWNER, SpawnerBlockEntity::serverTick); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
// Purpur start - Silk touch spawners
|
|
diff --git a/net/minecraft/world/level/block/SporeBlossomBlock.java b/net/minecraft/world/level/block/SporeBlossomBlock.java
|
|
index 8347554ee5ab4c08d13a6e5513f965304f218f12..5d874276e576abbb4d3ac222d552c7e39ee65560 100644
|
|
--- a/net/minecraft/world/level/block/SporeBlossomBlock.java
|
|
+++ b/net/minecraft/world/level/block/SporeBlossomBlock.java
|
|
@@ -52,6 +52,7 @@ public class SporeBlossomBlock extends Block {
|
|
: super.updateShape(state, level, scheduledTickAccess, pos, direction, neighborPos, neighborState, random);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
int x = pos.getX();
|
|
@@ -79,6 +80,7 @@ public class SporeBlossomBlock extends Block {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
|
|
diff --git a/net/minecraft/world/level/block/StonecutterBlock.java b/net/minecraft/world/level/block/StonecutterBlock.java
|
|
index 9dc7c3d0d6f8bcbc670fe10e594fa9c5495cffab..f2f98e4550cbc25d41cac5c561c9739dd0bd23a5 100644
|
|
--- a/net/minecraft/world/level/block/StonecutterBlock.java
|
|
+++ b/net/minecraft/world/level/block/StonecutterBlock.java
|
|
@@ -47,11 +47,7 @@ public class StonecutterBlock extends Block {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide) {
|
|
- if (player.openMenu(state.getMenuProvider(level, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
|
- player.awardStat(Stats.INTERACT_WITH_STONECUTTER);
|
|
- } // Paper - Fix InventoryOpenEvent cancellation
|
|
- }
|
|
+ player.openMenu(state.getMenuProvider(level, pos)).ifPresent(ignore -> player.awardStat(Stats.INTERACT_WITH_STONECUTTER)); // Paper - Remove isClientSide on DedicatedServer
|
|
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/StructureBlock.java b/net/minecraft/world/level/block/StructureBlock.java
|
|
index 7bd305a0555d160595ecf8cb227445adcd59a334..9f4d44649270317acf730b9d2d41f1e70e8898dd 100644
|
|
--- a/net/minecraft/world/level/block/StructureBlock.java
|
|
+++ b/net/minecraft/world/level/block/StructureBlock.java
|
|
@@ -51,14 +51,7 @@ public class StructureBlock extends BaseEntityBlock implements GameMasterBlock {
|
|
|
|
@Override
|
|
public void setPlacedBy(Level level, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) {
|
|
- if (!level.isClientSide) {
|
|
- if (placer != null) {
|
|
- BlockEntity blockEntity = level.getBlockEntity(pos);
|
|
- if (blockEntity instanceof StructureBlockEntity) {
|
|
- ((StructureBlockEntity)blockEntity).createdBy(placer);
|
|
- }
|
|
- }
|
|
- }
|
|
+ if (placer != null && (level.getBlockEntity(pos) instanceof StructureBlockEntity structure)) structure.createdBy(placer); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/TargetBlock.java b/net/minecraft/world/level/block/TargetBlock.java
|
|
index e993d3c54ffea72a3f16ba652f2d41ec5d8547fa..6f5047052eab4f9a8b29082be99f327f6ac94061 100644
|
|
--- a/net/minecraft/world/level/block/TargetBlock.java
|
|
+++ b/net/minecraft/world/level/block/TargetBlock.java
|
|
@@ -129,7 +129,7 @@ public class TargetBlock extends Block {
|
|
|
|
@Override
|
|
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) {
|
|
- if (!level.isClientSide() && !state.is(oldState.getBlock())) {
|
|
+ if (/*!level.isClientSide() &&*/ !state.is(oldState.getBlock())) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
if (state.getValue(OUTPUT_POWER) > 0 && !level.getBlockTicks().hasScheduledTick(pos, this)) {
|
|
level.setBlock(pos, state.setValue(OUTPUT_POWER, 0), 18);
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/TntBlock.java b/net/minecraft/world/level/block/TntBlock.java
|
|
index 58a54803a9dd31157fb9b337cf0dc5ad4e52b2b7..9124ba1148f6bfee92a2d9c48f54afd1c6b7498f 100644
|
|
--- a/net/minecraft/world/level/block/TntBlock.java
|
|
+++ b/net/minecraft/world/level/block/TntBlock.java
|
|
@@ -74,7 +74,7 @@ public class TntBlock extends Block {
|
|
|
|
@Override
|
|
public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) {
|
|
- if (!level.isClientSide() && !player.isCreative() && state.getValue(UNSTABLE) && org.bukkit.craftbukkit.event.CraftEventFactory.callTNTPrimeEvent(level, pos, org.bukkit.event.block.TNTPrimeEvent.PrimeCause.BLOCK_BREAK, player, null)) { // CraftBukkit - TNTPrimeEvent
|
|
+ if (/*!level.isClientSide() &&*/ !player.isCreative() && state.getValue(UNSTABLE) && org.bukkit.craftbukkit.event.CraftEventFactory.callTNTPrimeEvent(level, pos, org.bukkit.event.block.TNTPrimeEvent.PrimeCause.BLOCK_BREAK, player, null)) { // CraftBukkit - TNTPrimeEvent // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
explode(level, pos);
|
|
}
|
|
|
|
@@ -101,12 +101,12 @@ public class TntBlock extends Block {
|
|
}
|
|
|
|
private static void explode(Level level, BlockPos pos, @Nullable LivingEntity entity) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
PrimedTnt primedTnt = new PrimedTnt(level, pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, entity);
|
|
level.addFreshEntity(primedTnt);
|
|
level.playSound(null, primedTnt.getX(), primedTnt.getY(), primedTnt.getZ(), SoundEvents.TNT_PRIMED, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
level.gameEvent(entity, GameEvent.PRIME_FUSE, pos);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/TorchBlock.java b/net/minecraft/world/level/block/TorchBlock.java
|
|
index 3ebfb4da3d6f10719e73fe6824eb17f0b347acb9..c1be93c85ba2088ccbb8e2f5112df5ea99041131 100644
|
|
--- a/net/minecraft/world/level/block/TorchBlock.java
|
|
+++ b/net/minecraft/world/level/block/TorchBlock.java
|
|
@@ -39,6 +39,7 @@ public class TorchBlock extends BaseTorchBlock {
|
|
this.flameParticle = flameParticle;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
double d = pos.getX() + 0.5;
|
|
@@ -47,4 +48,5 @@ public class TorchBlock extends BaseTorchBlock {
|
|
level.addParticle(ParticleTypes.SMOKE, d, d1, d2, 0.0, 0.0, 0.0);
|
|
level.addParticle(this.flameParticle, d, d1, d2, 0.0, 0.0, 0.0);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/TrapDoorBlock.java b/net/minecraft/world/level/block/TrapDoorBlock.java
|
|
index 879ec40ae17c6625911c20c92f44d0b95f072b88..00441fcaf09e22caf9367fe9bba3cef9f74ab7c7 100644
|
|
--- a/net/minecraft/world/level/block/TrapDoorBlock.java
|
|
+++ b/net/minecraft/world/level/block/TrapDoorBlock.java
|
|
@@ -143,53 +143,56 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
|
|
|
|
@Override
|
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
|
- if (!level.isClientSide) {
|
|
- boolean hasNeighborSignal = level.hasNeighborSignal(pos);
|
|
- if (hasNeighborSignal != state.getValue(POWERED)) {
|
|
- // if (state.getValue(OPEN) != hasNeighborSignal) {
|
|
- // CraftBukkit start
|
|
- org.bukkit.World bworld = level.getWorld();
|
|
- org.bukkit.block.Block bblock = bworld.getBlockAt(pos.getX(), pos.getY(), pos.getZ());
|
|
-
|
|
- int power = bblock.getBlockPower();
|
|
- int oldPower = state.getValue(TrapDoorBlock.OPEN) ? 15 : 0;
|
|
-
|
|
- if (oldPower == 0 ^ power == 0 || neighborBlock.defaultBlockState().isSignalSource()) {
|
|
- org.bukkit.event.block.BlockRedstoneEvent eventRedstone = new org.bukkit.event.block.BlockRedstoneEvent(bblock, oldPower, power);
|
|
- level.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
|
- hasNeighborSignal = eventRedstone.getNewCurrent() > 0;
|
|
- }
|
|
- // CraftBukkit end
|
|
- // Paper start - break redstone on trapdoors early
|
|
- boolean open = state.getValue(TrapDoorBlock.OPEN) != hasNeighborSignal;
|
|
- // note: this must run before any state for this block/its neighborus are written to the world
|
|
- // we allow the redstone event to fire so that plugins can block
|
|
- if (hasNeighborSignal && open) { // if we are now powered and it caused the trap door to open
|
|
- // in this case, first check for the redstone on top first
|
|
- BlockPos abovePos = pos.above();
|
|
- BlockState above = level.getBlockState(abovePos);
|
|
- if (above.getBlock() instanceof RedStoneWireBlock) {
|
|
- level.setBlock(abovePos, Blocks.AIR.defaultBlockState(), Block.UPDATE_CLIENTS | Block.UPDATE_NEIGHBORS);
|
|
- Block.popResource(level, abovePos, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.REDSTONE));
|
|
- // now check that this didn't change our state
|
|
- if (level.getBlockState(pos) != state) {
|
|
- // our state was changed, so we cannot propagate this update
|
|
- return;
|
|
- }
|
|
- }
|
|
- }
|
|
- if (open) {
|
|
- // Paper end - break redstone on trapdoors early
|
|
- state = state.setValue(OPEN, Boolean.valueOf(hasNeighborSignal));
|
|
- this.playSound(null, level, pos, hasNeighborSignal);
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ boolean hasNeighborSignal = level.hasNeighborSignal(pos);
|
|
+ if (hasNeighborSignal == state.getValue(POWERED)) {
|
|
+ return;
|
|
+ }
|
|
|
|
- level.setBlock(pos, state.setValue(POWERED, Boolean.valueOf(hasNeighborSignal)), 2);
|
|
- if (state.getValue(WATERLOGGED)) {
|
|
- level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level));
|
|
+ // CraftBukkit start
|
|
+ final org.bukkit.World world = level.getWorld();
|
|
+ final org.bukkit.block.Block block = world.getBlockAt(pos.getX(), pos.getY(), pos.getZ());
|
|
+
|
|
+ final int power = block.getBlockPower();
|
|
+ final int oldPower = state.getValue(TrapDoorBlock.OPEN) ? 15 : 0;
|
|
+
|
|
+ if (oldPower == 0 ^ power == 0 || neighborBlock.defaultBlockState().isSignalSource()) {
|
|
+ org.bukkit.event.block.BlockRedstoneEvent eventRedstone = new org.bukkit.event.block.BlockRedstoneEvent(block, oldPower, power);
|
|
+ level.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
|
+ hasNeighborSignal = eventRedstone.getNewCurrent() > 0;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
+ // Paper start - break redstone on trapdoors early
|
|
+ final boolean open = state.getValue(TrapDoorBlock.OPEN) != hasNeighborSignal;
|
|
+ // note: this must run before any state for this block/its neighborus are written to the world
|
|
+ // we allow the redstone event to fire so that plugins can block
|
|
+ if (hasNeighborSignal && open) { // if we are now powered and it caused the trap door to open
|
|
+ // in this case, first check for the redstone on top first
|
|
+ BlockPos abovePos = pos.above();
|
|
+ BlockState above = level.getBlockState(abovePos);
|
|
+ if (above.getBlock() instanceof RedStoneWireBlock) {
|
|
+ level.setBlock(abovePos, Blocks.AIR.defaultBlockState(), Block.UPDATE_CLIENTS | Block.UPDATE_NEIGHBORS);
|
|
+ Block.popResource(level, abovePos, new ItemStack(net.minecraft.world.item.Items.REDSTONE));
|
|
+ // now check that this didn't change our state
|
|
+ if (level.getBlockState(pos) != state) {
|
|
+ // our state was changed, so we cannot propagate this update
|
|
+ return;
|
|
}
|
|
}
|
|
}
|
|
+
|
|
+ if (open) {
|
|
+ // Paper end - break redstone on trapdoors early
|
|
+ state = state.setValue(OPEN, hasNeighborSignal);
|
|
+ this.playSound(null, level, pos, hasNeighborSignal);
|
|
+ }
|
|
+
|
|
+ level.setBlock(pos, state.setValue(POWERED, hasNeighborSignal), 2);
|
|
+ if (state.getValue(WATERLOGGED)) {
|
|
+ level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level));
|
|
+ }
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/TrialSpawnerBlock.java b/net/minecraft/world/level/block/TrialSpawnerBlock.java
|
|
index b4907fd7d2d3ad717665141232c9df9f7be5fb19..84df08f5d58c8ad13874c5b712311b8a0e5fc992 100644
|
|
--- a/net/minecraft/world/level/block/TrialSpawnerBlock.java
|
|
+++ b/net/minecraft/world/level/block/TrialSpawnerBlock.java
|
|
@@ -52,18 +52,11 @@ public class TrialSpawnerBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return level instanceof ServerLevel serverLevel
|
|
- ? createTickerHelper(
|
|
+ return createTickerHelper( // Plazma - Remove isClientSide on DedicatedServer
|
|
blockEntityType,
|
|
BlockEntityType.TRIAL_SPAWNER,
|
|
(level1, pos, state1, blockEntity) -> blockEntity.getTrialSpawner()
|
|
- .tickServer(serverLevel, pos, state1.getOptionalValue(BlockStateProperties.OMINOUS).orElse(false))
|
|
- )
|
|
- : createTickerHelper(
|
|
- blockEntityType,
|
|
- BlockEntityType.TRIAL_SPAWNER,
|
|
- (level1, pos, state1, blockEntity) -> blockEntity.getTrialSpawner()
|
|
- .tickClient(level1, pos, state1.getOptionalValue(BlockStateProperties.OMINOUS).orElse(false))
|
|
+ .tickServer((ServerLevel) level, pos, state1.getOptionalValue(BlockStateProperties.OMINOUS).orElse(false)) // Plazma - Remove isClientSide on DedicatedServer
|
|
);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/level/block/TripWireBlock.java b/net/minecraft/world/level/block/TripWireBlock.java
|
|
index f80283f7453ddf5abd75e825dd546b00d10c230b..130fc38d39c7495bb8e27314375760d85782cb23 100644
|
|
--- a/net/minecraft/world/level/block/TripWireBlock.java
|
|
+++ b/net/minecraft/world/level/block/TripWireBlock.java
|
|
@@ -118,7 +118,7 @@ public class TripWireBlock extends Block {
|
|
@Override
|
|
public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) {
|
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent disarming tripwires
|
|
- if (!level.isClientSide && !player.getMainHandItem().isEmpty() && player.getMainHandItem().is(Items.SHEARS)) {
|
|
+ if (/*!level.isClientSide &&*/ !player.getMainHandItem().isEmpty() && player.getMainHandItem().is(Items.SHEARS)) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
level.setBlock(pos, state.setValue(DISARMED, true), 4);
|
|
level.gameEvent(player, GameEvent.SHEAR, pos);
|
|
}
|
|
@@ -155,11 +155,7 @@ public class TripWireBlock extends Block {
|
|
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
|
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent tripwires from detecting collision
|
|
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
|
- if (!level.isClientSide) {
|
|
- if (!state.getValue(POWERED)) {
|
|
- this.checkPressed(level, pos, List.of(entity));
|
|
- }
|
|
- }
|
|
+ if (!state.getValue(POWERED)) this.checkPressed(level, pos, java.util.Collections.singletonList(entity)); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/TurtleEggBlock.java b/net/minecraft/world/level/block/TurtleEggBlock.java
|
|
index ae2c1bb8b6321b686e201c89e3e6fb3d3db3cb1f..0e9cd6bae86919fbda42d3e8180479bd2e2fb2d1 100644
|
|
--- a/net/minecraft/world/level/block/TurtleEggBlock.java
|
|
+++ b/net/minecraft/world/level/block/TurtleEggBlock.java
|
|
@@ -150,7 +150,7 @@ public class TurtleEggBlock extends Block {
|
|
|
|
@Override
|
|
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) {
|
|
- if (onSand(level, pos) && !level.isClientSide) {
|
|
+ if (onSand(level, pos) /*&& !level.isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
level.levelEvent(2012, pos, 15);
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/VaultBlock.java b/net/minecraft/world/level/block/VaultBlock.java
|
|
index 89ce9eaa1db0f324168648774b18c00046623d85..ee0f217accedf98787a8bdb63276d94176bdc039 100644
|
|
--- a/net/minecraft/world/level/block/VaultBlock.java
|
|
+++ b/net/minecraft/world/level/block/VaultBlock.java
|
|
@@ -78,21 +78,13 @@ public class VaultBlock extends BaseEntityBlock {
|
|
@Nullable
|
|
@Override
|
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
|
- return level instanceof ServerLevel serverLevel
|
|
- ? createTickerHelper(
|
|
+ return createTickerHelper(
|
|
blockEntityType,
|
|
BlockEntityType.VAULT,
|
|
(level1, pos, state1, blockEntity) -> VaultBlockEntity.Server.tick(
|
|
- serverLevel, pos, state1, blockEntity.getConfig(), blockEntity.getServerData(), blockEntity.getSharedData()
|
|
+ (ServerLevel) level, pos, state1, blockEntity.getConfig(), blockEntity.getServerData(), blockEntity.getSharedData()
|
|
)
|
|
- )
|
|
- : createTickerHelper(
|
|
- blockEntityType,
|
|
- BlockEntityType.VAULT,
|
|
- (level1, pos, state1, blockEntity) -> VaultBlockEntity.Client.tick(
|
|
- level1, pos, state1, blockEntity.getClientData(), blockEntity.getSharedData()
|
|
- )
|
|
- );
|
|
+ ); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/WallTorchBlock.java b/net/minecraft/world/level/block/WallTorchBlock.java
|
|
index 58c6c7d740b353644e35055cc52cb874bd3fbfa8..1a3753f284854474451fcc87ba56ce5cf9f01a43 100644
|
|
--- a/net/minecraft/world/level/block/WallTorchBlock.java
|
|
+++ b/net/minecraft/world/level/block/WallTorchBlock.java
|
|
@@ -108,6 +108,7 @@ public class WallTorchBlock extends TorchBlock {
|
|
return direction.getOpposite() == state.getValue(FACING) && !state.canSurvive(level, pos) ? Blocks.AIR.defaultBlockState() : state;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
Direction direction = state.getValue(FACING);
|
|
@@ -120,6 +121,7 @@ public class WallTorchBlock extends TorchBlock {
|
|
level.addParticle(ParticleTypes.SMOKE, d + 0.27 * opposite.getStepX(), d1 + 0.22, d2 + 0.27 * opposite.getStepZ(), 0.0, 0.0, 0.0);
|
|
level.addParticle(this.flameParticle, d + 0.27 * opposite.getStepX(), d1 + 0.22, d2 + 0.27 * opposite.getStepZ(), 0.0, 0.0, 0.0);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected BlockState rotate(BlockState state, Rotation rotation) {
|
|
diff --git a/net/minecraft/world/level/block/WetSpongeBlock.java b/net/minecraft/world/level/block/WetSpongeBlock.java
|
|
index 3a24eed10a5da13628fe19c0b26399ee60ebd03d..019a007a7b9fa4d2c9ab3073057e2c22c8bf53cb 100644
|
|
--- a/net/minecraft/world/level/block/WetSpongeBlock.java
|
|
+++ b/net/minecraft/world/level/block/WetSpongeBlock.java
|
|
@@ -32,6 +32,7 @@ public class WetSpongeBlock extends Block {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
Direction random1 = Direction.getRandom(random);
|
|
@@ -69,4 +70,5 @@ public class WetSpongeBlock extends Block {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/WitherRoseBlock.java b/net/minecraft/world/level/block/WitherRoseBlock.java
|
|
index 969519f357e5a4b88f2f695cf0b1b4903365fc3d..374092269a92ded692f63dd4c56c8bc985cd7732 100644
|
|
--- a/net/minecraft/world/level/block/WitherRoseBlock.java
|
|
+++ b/net/minecraft/world/level/block/WitherRoseBlock.java
|
|
@@ -45,6 +45,7 @@ public class WitherRoseBlock extends FlowerBlock {
|
|
return super.mayPlaceOn(state, level, pos) || state.is(Blocks.NETHERRACK) || state.is(Blocks.SOUL_SAND) || state.is(Blocks.SOUL_SOIL);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
|
|
VoxelShape shape = this.getShape(state, level, pos, CollisionContext.empty());
|
|
@@ -60,6 +61,7 @@ public class WitherRoseBlock extends FlowerBlock {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
|
|
diff --git a/net/minecraft/world/level/block/WitherSkullBlock.java b/net/minecraft/world/level/block/WitherSkullBlock.java
|
|
index 31d776ce04a8035977ad82527e90ab3b215940c1..fb1cd664fd92765c3e273bd42eca9781f38059f2 100644
|
|
--- a/net/minecraft/world/level/block/WitherSkullBlock.java
|
|
+++ b/net/minecraft/world/level/block/WitherSkullBlock.java
|
|
@@ -51,51 +51,54 @@ public class WitherSkullBlock extends SkullBlock {
|
|
}
|
|
|
|
public static void checkSpawn(Level level, BlockPos pos, SkullBlockEntity blockEntity) {
|
|
- if (level.captureBlockStates) return; // CraftBukkit
|
|
- if (!level.isClientSide) {
|
|
- BlockState blockState = blockEntity.getBlockState();
|
|
- boolean flag = blockState.is(Blocks.WITHER_SKELETON_SKULL) || blockState.is(Blocks.WITHER_SKELETON_WALL_SKULL);
|
|
- if (flag && pos.getY() >= level.getMinY() && level.getDifficulty() != Difficulty.PEACEFUL) {
|
|
- BlockPattern.BlockPatternMatch blockPatternMatch = getOrCreateWitherFull().find(level, pos);
|
|
- if (blockPatternMatch != null) {
|
|
- WitherBoss witherBoss = EntityType.WITHER.create(level, EntitySpawnReason.TRIGGERED);
|
|
- if (witherBoss != null) {
|
|
- // CarvedPumpkinBlock.clearPatternBlocks(level, blockPatternMatch); // CraftBukkit - move down
|
|
- BlockPos pos1 = blockPatternMatch.getBlock(1, 2, 0).getPos();
|
|
- witherBoss.moveTo(
|
|
- pos1.getX() + 0.5,
|
|
- pos1.getY() + 0.55,
|
|
- pos1.getZ() + 0.5,
|
|
- blockPatternMatch.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F,
|
|
- 0.0F
|
|
- );
|
|
- witherBoss.yBodyRot = blockPatternMatch.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F;
|
|
- witherBoss.makeInvulnerable();
|
|
- witherBoss.setSummoner(blockState.getBlock().placer == null ? null : blockState.getBlock().placer.getUUID()); // Purpur - Summoner API
|
|
- // CraftBukkit start
|
|
- if (!level.addFreshEntity(witherBoss, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BUILD_WITHER)) {
|
|
- return;
|
|
- }
|
|
- CarvedPumpkinBlock.clearPatternBlocks(level, blockPatternMatch); // CraftBukkit - from above
|
|
- // CraftBukkit end
|
|
-
|
|
- for (ServerPlayer serverPlayer : level.getEntitiesOfClass(ServerPlayer.class, witherBoss.getBoundingBox().inflate(50.0))) {
|
|
- CriteriaTriggers.SUMMONED_ENTITY.trigger(serverPlayer, witherBoss);
|
|
- }
|
|
-
|
|
- // level.addFreshEntity(witherBoss); // CraftBukkit - moved up
|
|
- CarvedPumpkinBlock.updatePatternBlocks(level, blockPatternMatch);
|
|
- }
|
|
- }
|
|
- }
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (level.captureBlockStates) { // CraftBukkit
|
|
+ return;
|
|
}
|
|
+
|
|
+ final BlockState blockState = blockEntity.getBlockState();
|
|
+ final boolean isSkull = blockState.is(Blocks.WITHER_SKELETON_SKULL) || blockState.is(Blocks.WITHER_SKELETON_WALL_SKULL);
|
|
+ if (!isSkull || pos.getY() < level.getMinY() || level.getDifficulty() == Difficulty.PEACEFUL) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ final BlockPattern.BlockPatternMatch blockPatternMatch = getOrCreateWitherFull().find(level, pos);
|
|
+ if (blockPatternMatch == null) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ final WitherBoss witherBoss = EntityType.WITHER.create(level, EntitySpawnReason.TRIGGERED);
|
|
+ if (witherBoss == null) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ final BlockPos pos1 = blockPatternMatch.getBlock(1, 2, 0).getPos();
|
|
+ witherBoss.moveTo(pos1.getX() + 0.5, pos1.getY() + 0.55, pos1.getZ() + 0.5, blockPatternMatch.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F, 0.0F);
|
|
+ witherBoss.yBodyRot = blockPatternMatch.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F;
|
|
+ witherBoss.makeInvulnerable();
|
|
+ witherBoss.setSummoner(blockState.getBlock().placer == null ? null : blockState.getBlock().placer.getUUID()); // Purpur - Summoner API
|
|
+
|
|
+ // CraftBukkit start
|
|
+ if (!level.addFreshEntity(witherBoss, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BUILD_WITHER)) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ CarvedPumpkinBlock.clearPatternBlocks(level, blockPatternMatch); // CraftBukkit - from above
|
|
+ // CraftBukkit end
|
|
+
|
|
+ for (ServerPlayer serverPlayer : level.getEntitiesOfClass(ServerPlayer.class, witherBoss.getBoundingBox().inflate(50.0))) {
|
|
+ CriteriaTriggers.SUMMONED_ENTITY.trigger(serverPlayer, witherBoss);
|
|
+ }
|
|
+
|
|
+ CarvedPumpkinBlock.updatePatternBlocks(level, blockPatternMatch);
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public static boolean canSpawnMob(Level level, BlockPos pos, ItemStack stack) {
|
|
return stack.is(Items.WITHER_SKELETON_SKULL)
|
|
&& pos.getY() >= level.getMinY() + 2
|
|
&& level.getDifficulty() != Difficulty.PEACEFUL
|
|
- && !level.isClientSide
|
|
+ //&& !level.isClientSide // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
&& getOrCreateWitherBase().find(level, pos) != null;
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
|
index cfcedf485ae2aeb8d767854fec74239aa8e2a1e2..7a3c73fafaea95499cc26a57d1155727c027212f 100644
|
|
--- a/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
|
@@ -90,7 +90,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
|
BeaconBlockEntity.this.levels = value;
|
|
break;
|
|
case 1:
|
|
- if (!BeaconBlockEntity.this.level.isClientSide && !BeaconBlockEntity.this.beamSections.isEmpty()) {
|
|
+ if (/*!BeaconBlockEntity.this.level.isClientSide &&*/ !BeaconBlockEntity.this.beamSections.isEmpty()) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BeaconBlockEntity.playSound(BeaconBlockEntity.this.level, BeaconBlockEntity.this.worldPosition, SoundEvents.BEACON_POWER_SELECT);
|
|
}
|
|
|
|
@@ -247,7 +247,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
|
blockEntity.lastCheckY = level.getMinY() - 1;
|
|
boolean flag = i > 0;
|
|
blockEntity.beamSections = blockEntity.checkingBeamSections;
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean flag1 = blockEntity.levels > 0;
|
|
if (!flag && flag1) {
|
|
playSound(level, pos, SoundEvents.BEACON_ACTIVATE);
|
|
@@ -258,7 +258,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
|
} else if (flag && !flag1) {
|
|
playSound(level, pos, SoundEvents.BEACON_DEACTIVATE);
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
}
|
|
|
|
@@ -315,7 +315,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
|
Level level, BlockPos pos, int beaconLevel, @Nullable Holder<MobEffect> primaryEffect, @Nullable Holder<MobEffect> secondaryEffect, @Nullable BeaconBlockEntity blockEntity
|
|
) {
|
|
// Paper emd - pass beacon block entity
|
|
- if (!level.isClientSide && primaryEffect != null) {
|
|
+ if (/*!level.isClientSide &&*/ primaryEffect != null) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
//double d = computeBeaconRange(beaconLevel); // Paper - diff out applyEffects logic components - see below // Plazma - Remove unused variables
|
|
int i = computeEffectAmplifier(beaconLevel, primaryEffect, secondaryEffect); // Paper - diff out applyEffects logic components - see below
|
|
|
|
diff --git a/net/minecraft/world/level/block/entity/BellBlockEntity.java b/net/minecraft/world/level/block/entity/BellBlockEntity.java
|
|
index ff63952c10d4642d5c14f470a18bea3066aa7ab0..044cc629d34abe1ec96bbba7b10d66a57708f05c 100644
|
|
--- a/net/minecraft/world/level/block/entity/BellBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/BellBlockEntity.java
|
|
@@ -84,9 +84,11 @@ public class BellBlockEntity extends BlockEntity {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static void clientTick(Level level, BlockPos pos, BlockState state, BellBlockEntity blockEntity) {
|
|
tick(level, pos, state, blockEntity, BellBlockEntity::showBellParticles);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static void serverTick(Level level, BlockPos pos, BlockState state, BellBlockEntity blockEntity) {
|
|
tick(level, pos, state, blockEntity, BellBlockEntity::makeRaidersGlow);
|
|
@@ -112,13 +114,13 @@ public class BellBlockEntity extends BlockEntity {
|
|
this.nearbyEntities = this.level.getEntitiesOfClass(LivingEntity.class, aabb);
|
|
}
|
|
|
|
- if (!this.level.isClientSide) {
|
|
+ //if (!this.level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
for (LivingEntity livingEntity : this.nearbyEntities) {
|
|
if (livingEntity.isAlive() && !livingEntity.isRemoved() && blockPos.closerToCenterThan(livingEntity.position(), 32.0)) {
|
|
livingEntity.getBrain().setMemory(MemoryModuleType.HEARD_BELL_TIME, this.level.getGameTime());
|
|
}
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
this.nearbyEntities.removeIf(e -> !e.isAlive()); // Paper - Fix bell block entity memory leak
|
|
}
|
|
@@ -143,6 +145,7 @@ public class BellBlockEntity extends BlockEntity {
|
|
// Paper end - call bell resonate event and bell reveal raider event
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private static void showBellParticles(Level level, BlockPos pos, List<LivingEntity> raiders) {
|
|
MutableInt mutableInt = new MutableInt(16700985);
|
|
int i = (int)raiders.stream().filter(raider -> pos.closerToCenterThan(raider.position(), 48.0)).count();
|
|
@@ -165,6 +168,7 @@ public class BellBlockEntity extends BlockEntity {
|
|
}
|
|
);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
private static boolean isRaiderWithinRange(BlockPos pos, LivingEntity raider) {
|
|
return raider.isAlive() && !raider.isRemoved() && pos.closerToCenterThan(raider.position(), 48.0) && raider.getType().is(EntityTypeTags.RAIDERS);
|
|
diff --git a/net/minecraft/world/level/block/entity/ConduitBlockEntity.java b/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
|
|
index 00b2d069c6eb26742f0fd74ac1103e428873248a..91ec4b229219d27afbdd6b5b66d19e58aa7853f5 100644
|
|
--- a/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
|
|
@@ -37,7 +37,7 @@ public class ConduitBlockEntity extends BlockEntity {
|
|
private static final int KILL_RANGE = 8;
|
|
private static final Block[] VALID_BLOCKS = new Block[]{Blocks.PRISMARINE, Blocks.PRISMARINE_BRICKS, Blocks.SEA_LANTERN, Blocks.DARK_PRISMARINE};
|
|
public int tickCount;
|
|
- private float activeRotation;
|
|
+ //private float activeRotation; // Plazma - Remove isClientSide on DedicatedServer
|
|
private boolean isActive;
|
|
private boolean isHunting;
|
|
public final List<BlockPos> effectBlocks = Lists.newArrayList();
|
|
@@ -79,6 +79,7 @@ public class ConduitBlockEntity extends BlockEntity {
|
|
return this.saveCustomOnly(registries);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static void clientTick(Level level, BlockPos pos, BlockState state, ConduitBlockEntity blockEntity) {
|
|
blockEntity.tickCount++;
|
|
long gameTime = level.getGameTime();
|
|
@@ -94,6 +95,7 @@ public class ConduitBlockEntity extends BlockEntity {
|
|
blockEntity.activeRotation++;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static void serverTick(Level level, BlockPos pos, BlockState state, ConduitBlockEntity blockEntity) {
|
|
blockEntity.tickCount++;
|
|
@@ -241,6 +243,7 @@ public class ConduitBlockEntity extends BlockEntity {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private static void updateClientTarget(Level level, BlockPos pos, ConduitBlockEntity blockEntity) {
|
|
if (blockEntity.destroyTargetUUID == null) {
|
|
blockEntity.destroyTarget = null;
|
|
@@ -251,6 +254,7 @@ public class ConduitBlockEntity extends BlockEntity {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static AABB getDestroyRangeAABB(BlockPos pos) {
|
|
// Purpur start - Conduit behavior configuration
|
|
@@ -273,6 +277,7 @@ public class ConduitBlockEntity extends BlockEntity {
|
|
return entitiesOfClass.size() == 1 ? entitiesOfClass.get(0) : null;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
private static void animationTick(Level level, BlockPos pos, List<BlockPos> positions, @Nullable Entity entity, int tickCount) {
|
|
RandomSource randomSource = level.random;
|
|
double d = Mth.sin((tickCount + 35) * 0.1F) / 2.0F + 0.5F;
|
|
@@ -298,6 +303,7 @@ public class ConduitBlockEntity extends BlockEntity {
|
|
level.addParticle(ParticleTypes.NAUTILUS, vec31.x, vec31.y, vec31.z, vec32.x, vec32.y, vec32.z);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public boolean isActive() {
|
|
return this.isActive;
|
|
@@ -311,7 +317,9 @@ public class ConduitBlockEntity extends BlockEntity {
|
|
this.isHunting = isHunting;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public float getActiveRotation(float partialTick) {
|
|
return (this.activeRotation + partialTick) * -0.0375F;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java b/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
|
|
index dc47bb2ec3a8a4d3fbd1f64abbad1f293c57ae52..8dd3549cedcd0270cee2f96ca9e37425ee9c70fa 100644
|
|
--- a/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java
|
|
@@ -201,7 +201,7 @@ public class DecoratedPotBlockEntity extends BlockEntity implements Randomizable
|
|
}
|
|
|
|
public void wobble(DecoratedPotBlockEntity.WobbleStyle style) {
|
|
- if (this.level != null && !this.level.isClientSide()) {
|
|
+ if (this.level != null /*&& !this.level.isClientSide()*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.level.blockEvent(this.getBlockPos(), this.getBlockState().getBlock(), 1, style.ordinal());
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
index 5cd1326ad5d046c88b2b3449d610a78fa880b4cd..2d26de7888e86be189f77f3b67a52199179a1cb1 100644
|
|
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
@@ -177,29 +177,29 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
|
// Paper end - Perf: Optimize Hoppers
|
|
|
|
private static boolean tryMoveItems(Level level, BlockPos pos, BlockState state, HopperBlockEntity blockEntity, BooleanSupplier validator) {
|
|
- if (level.isClientSide) {
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (blockEntity.isOnCooldown() || !state.getValue(HopperBlock.ENABLED)) {
|
|
return false;
|
|
- } else {
|
|
- if (!blockEntity.isOnCooldown() && state.getValue(HopperBlock.ENABLED)) {
|
|
- boolean flag = false;
|
|
- final int fullState = getFullState(blockEntity); // Paper - Perf: Optimize Hoppers
|
|
- if (fullState != HOPPER_EMPTY) { // Paper - Perf: Optimize Hoppers
|
|
- flag = ejectItems(level, pos, blockEntity);
|
|
- }
|
|
+ }
|
|
|
|
- if (fullState != HOPPER_IS_FULL || flag) { // Paper - Perf: Optimize Hoppers
|
|
- flag |= validator.getAsBoolean(); // Paper - note: this is not a validator, it's what adds/sucks in items
|
|
- }
|
|
+ boolean flag = false;
|
|
+ final int fullState = getFullState(blockEntity); // Paper - Perf: Optimize Hoppers
|
|
+ if (fullState != HOPPER_EMPTY) { // Paper - Perf: Optimize Hoppers
|
|
+ flag = ejectItems(level, pos, blockEntity);
|
|
+ }
|
|
|
|
- if (flag) {
|
|
- blockEntity.setCooldown(level.spigotConfig.hopperTransfer); // Spigot
|
|
- setChanged(level, pos, state);
|
|
- return true;
|
|
- }
|
|
- }
|
|
+ if (fullState != HOPPER_IS_FULL || flag) { // Paper - Perf: Optimize Hoppers
|
|
+ flag |= validator.getAsBoolean(); // Paper - note: this is not a validator, it's what adds/sucks in items
|
|
+ }
|
|
|
|
- return false;
|
|
+ if (flag) {
|
|
+ blockEntity.setCooldown(level.spigotConfig.hopperTransfer); // Spigot
|
|
+ setChanged(level, pos, state);
|
|
+ return true;
|
|
}
|
|
+
|
|
+ return false;
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
private boolean inventoryFull() {
|
|
diff --git a/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java b/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java
|
|
index a58105f509a5128276d856e2123b7523f2dd7069..c553a608ba5c458cad41ce04cc115d9f5097458e 100644
|
|
--- a/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java
|
|
@@ -84,7 +84,7 @@ public class JukeboxBlockEntity extends BlockEntity implements ContainerSingleIt
|
|
}
|
|
|
|
public void popOutTheItem() {
|
|
- if (this.level != null && !this.level.isClientSide) {
|
|
+ if (this.level != null /*&& !this.level.isClientSide*/) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockPos blockPos = this.getBlockPos();
|
|
ItemStack theItem = this.getTheItem();
|
|
if (!theItem.isEmpty()) {
|
|
diff --git a/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java b/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java
|
|
index 30b490bb19d9c0194140f1ad1c843e324110b87b..f8164ed160d6c08bd8fcf94b6b8a3026341f1f19 100644
|
|
--- a/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java
|
|
@@ -48,9 +48,11 @@ public class SpawnerBlockEntity extends BlockEntity implements Spawner {
|
|
this.spawner.save(tag);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static void clientTick(Level level, BlockPos pos, BlockState state, SpawnerBlockEntity blockEntity) {
|
|
blockEntity.spawner.clientTick(level, pos);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static void serverTick(Level level, BlockPos pos, BlockState state, SpawnerBlockEntity blockEntity) {
|
|
blockEntity.spawner.serverTick((ServerLevel)level, pos);
|
|
diff --git a/net/minecraft/world/level/block/entity/StructureBlockEntity.java b/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
|
index ccbc38506cd11272fd01c5dbceee4d0e0fff1ed7..b5a53706e86275f8401f74ab042d88ccf5f055fd 100644
|
|
--- a/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/StructureBlockEntity.java
|
|
@@ -148,15 +148,7 @@ public class StructureBlockEntity extends BlockEntity {
|
|
}
|
|
|
|
public boolean usedBy(Player player) {
|
|
- if (!player.canUseGameMasterBlocks()) {
|
|
- return false;
|
|
- } else {
|
|
- if (player.getCommandSenderWorld().isClientSide) {
|
|
- player.openStructureBlock(this);
|
|
- }
|
|
-
|
|
- return true;
|
|
- }
|
|
+ return player.canUseGameMasterBlocks(); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public String getStructureName() {
|
|
@@ -422,7 +414,7 @@ public class StructureBlockEntity extends BlockEntity {
|
|
}
|
|
|
|
public boolean isStructureLoadable() {
|
|
- if (this.mode == StructureMode.LOAD && !this.level.isClientSide && this.structureName != null) {
|
|
+ if (this.mode == StructureMode.LOAD /*&& !this.level.isClientSide*/ && this.structureName != null) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
ServerLevel serverLevel = (ServerLevel)this.level;
|
|
StructureTemplateManager structureManager = serverLevel.getStructureManager();
|
|
|
|
diff --git a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
|
index 5bf39c542757bf97da8909b65c22786a8a30385a..2f0bc1829977ccb358512b257a7db53ed75bf406 100644
|
|
--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
|
@@ -63,12 +63,14 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
|
this.exactTeleport = tag.getBoolean("ExactTeleport");
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static void beamAnimationTick(Level level, BlockPos pos, BlockState state, TheEndGatewayBlockEntity blockEntity) {
|
|
blockEntity.age++;
|
|
if (blockEntity.isCoolingDown()) {
|
|
blockEntity.teleportCooldown--;
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static void portalTick(Level level, BlockPos pos, BlockState state, TheEndGatewayBlockEntity blockEntity) {
|
|
boolean isSpawning = blockEntity.isSpawning();
|
|
@@ -112,11 +114,11 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
|
}
|
|
|
|
public static void triggerCooldown(Level level, BlockPos pos, BlockState state, TheEndGatewayBlockEntity blockEntity) {
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
blockEntity.teleportCooldown = 40;
|
|
level.blockEvent(pos, state.getBlock(), 1, 0);
|
|
setChanged(level, pos, state);
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
|
|
index 72657b958f9949911918a2a513b75ecd3e1eef4d..12eb374c732d65bc41e3004f0564c056c80daf8a 100644
|
|
--- a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
|
|
+++ b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
|
|
@@ -288,6 +288,7 @@ public final class TrialSpawner {
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public void tickClient(Level level, BlockPos pos, boolean isOminous) {
|
|
TrialSpawnerState state = this.getState();
|
|
state.emitParticles(level, pos, isOminous);
|
|
@@ -305,6 +306,7 @@ public final class TrialSpawner {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public void tickServer(ServerLevel level, BlockPos pos, boolean isOminous) {
|
|
this.isOminous = isOminous;
|
|
@@ -334,6 +336,7 @@ public final class TrialSpawner {
|
|
return blockHitResult.getBlockPos().equals(BlockPos.containing(spawnerPos)) || blockHitResult.getType() == HitResult.Type.MISS;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static void addSpawnParticles(Level level, BlockPos pos, RandomSource random, SimpleParticleType particleType) {
|
|
for (int i = 0; i < 20; i++) {
|
|
double d = pos.getX() + 0.5 + (random.nextDouble() - 0.5) * 2.0;
|
|
@@ -380,6 +383,7 @@ public final class TrialSpawner {
|
|
level.addParticle(ParticleTypes.SMOKE, d, d1, d2, d3, d4, d5);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public void overrideEntityToSpawn(EntityType<?> entityType, Level level) {
|
|
this.data.reset();
|
|
diff --git a/net/minecraft/world/level/block/entity/vault/VaultBlockEntity.java b/net/minecraft/world/level/block/entity/vault/VaultBlockEntity.java
|
|
index 517786b0a3002559beabf1673adc7a15f542405c..f1934382a98ede563a74c30774481225056833ff 100644
|
|
--- a/net/minecraft/world/level/block/entity/vault/VaultBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/vault/VaultBlockEntity.java
|
|
@@ -95,7 +95,7 @@ public class VaultBlockEntity extends BlockEntity {
|
|
|
|
@Nullable
|
|
public VaultServerData getServerData() {
|
|
- return this.level != null && !this.level.isClientSide ? this.serverData : null;
|
|
+ return this.level != null ? this.serverData : null; // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
public VaultSharedData getSharedData() {
|
|
@@ -115,6 +115,7 @@ public class VaultBlockEntity extends BlockEntity {
|
|
this.config = config;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public static final class Client {
|
|
private static final int PARTICLE_TICK_RATE = 20;
|
|
private static final float IDLE_PARTICLE_CHANCE = 0.5F;
|
|
@@ -220,6 +221,7 @@ public class VaultBlockEntity extends BlockEntity {
|
|
return Vec3.atBottomCenterOf(pos).add(facing.getStepX() * 0.5, 1.75, facing.getStepZ() * 0.5);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public static final class Server {
|
|
private static final int UNLOCKING_DELAY_TICKS = 14;
|
|
diff --git a/net/minecraft/world/level/block/piston/MovingPistonBlock.java b/net/minecraft/world/level/block/piston/MovingPistonBlock.java
|
|
index f14e84e67746208dd188525fb91ab30b190d332b..157eca546267ccff62a7ed7923938f69885914c5 100644
|
|
--- a/net/minecraft/world/level/block/piston/MovingPistonBlock.java
|
|
+++ b/net/minecraft/world/level/block/piston/MovingPistonBlock.java
|
|
@@ -88,7 +88,7 @@ public class MovingPistonBlock extends BaseEntityBlock {
|
|
|
|
@Override
|
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
|
- if (!level.isClientSide && level.getBlockEntity(pos) == null) {
|
|
+ if (/*!level.isClientSide &&*/ level.getBlockEntity(pos) == null) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
level.removeBlock(pos, false);
|
|
return InteractionResult.CONSUME;
|
|
} else {
|
|
diff --git a/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
|
index 24e460cf00d6d83b57ac71bcb70dc117cf4ece3d..b791ade901e785264152f93875446c767d9bf075 100644
|
|
--- a/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
|
+++ b/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
|
@@ -96,22 +96,18 @@ public class PistonBaseBlock extends DirectionalBlock {
|
|
|
|
@Override
|
|
public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
|
|
- if (!level.isClientSide) {
|
|
- this.checkIfExtend(level, pos, state);
|
|
- }
|
|
+ this.checkIfExtend(level, pos, state); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
|
- if (!level.isClientSide) {
|
|
- this.checkIfExtend(level, pos, state);
|
|
- }
|
|
+ this.checkIfExtend(level, pos, state); // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) {
|
|
if (!oldState.is(state.getBlock())) {
|
|
- if (!level.isClientSide && level.getBlockEntity(pos) == null) {
|
|
+ if (/*!level.isClientSide &&*/ level.getBlockEntity(pos) == null) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
this.checkIfExtend(level, pos, state);
|
|
}
|
|
}
|
|
@@ -181,7 +177,7 @@ public class PistonBaseBlock extends DirectionalBlock {
|
|
}
|
|
// Paper end - Protect Bedrock and End Portal/Frames from being destroyed
|
|
BlockState blockState = state.setValue(EXTENDED, true);
|
|
- if (!level.isClientSide) {
|
|
+ //if (!level.isClientSide) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
boolean neighborSignal = this.getNeighborSignal(level, pos, direction);
|
|
if (neighborSignal && (id == 1 || id == 2)) {
|
|
level.setBlock(pos, blockState, 2);
|
|
@@ -191,7 +187,7 @@ public class PistonBaseBlock extends DirectionalBlock {
|
|
if (!neighborSignal && id == 0) {
|
|
return false;
|
|
}
|
|
- }
|
|
+ //} // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
if (id == 0) {
|
|
if (!this.moveBlocks(level, pos, direction, true)) {
|
|
diff --git a/net/minecraft/world/level/block/piston/PistonHeadBlock.java b/net/minecraft/world/level/block/piston/PistonHeadBlock.java
|
|
index a0e8123a281632ee47b8a937d60e716375e04a8b..c8b544ecb147669d7a56e3ac93062d24e9011270 100644
|
|
--- a/net/minecraft/world/level/block/piston/PistonHeadBlock.java
|
|
+++ b/net/minecraft/world/level/block/piston/PistonHeadBlock.java
|
|
@@ -111,7 +111,7 @@ public class PistonHeadBlock extends DirectionalBlock {
|
|
|
|
@Override
|
|
public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) {
|
|
- if (!level.isClientSide && player.getAbilities().instabuild) {
|
|
+ if (/*!level.isClientSide &&*/ player.getAbilities().instabuild) { // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
BlockPos blockPos = pos.relative(state.getValue(FACING).getOpposite());
|
|
if (this.isFittingBase(state, level.getBlockState(blockPos))) {
|
|
level.destroyBlock(blockPos, false);
|
|
diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
|
index 8f38522bb89c56e9592b86e0bda448ee02cc3de0..449f017c900949ca5694eacfd6a18f4c6c1de880 100644
|
|
--- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
|
@@ -265,7 +265,7 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
|
}
|
|
|
|
public void finalTick() {
|
|
- if (this.level != null && (this.progressO < 1.0F || this.level.isClientSide)) {
|
|
+ if (this.level != null && (this.progressO < 1.0F /*|| this.level.isClientSide*/)) { // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
this.progress = 1.0F;
|
|
this.progressO = this.progress;
|
|
this.level.removeBlockEntity(this.worldPosition);
|
|
@@ -294,30 +294,8 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
|
public static void tick(Level level, BlockPos pos, BlockState state, PistonMovingBlockEntity blockEntity) {
|
|
blockEntity.lastTicked = level.getGameTime();
|
|
blockEntity.progressO = blockEntity.progress;
|
|
- if (blockEntity.progressO >= 1.0F) {
|
|
- if (level.isClientSide && blockEntity.deathTicks < 5) {
|
|
- blockEntity.deathTicks++;
|
|
- } else {
|
|
- level.removeBlockEntity(pos);
|
|
- blockEntity.setRemoved();
|
|
- if (level.getBlockState(pos).is(Blocks.MOVING_PISTON)) {
|
|
- BlockState blockState = Block.updateFromNeighbourShapes(blockEntity.movedState, level, pos);
|
|
- if (blockState.isAir()) {
|
|
- level.setBlock(pos, blockEntity.movedState, io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPistonDuplication ? 84 : (84 | Block.UPDATE_CLIENTS)); // Paper - fix a variety of piston desync dupes; force notify (flag 2), it's possible the set type by the piston block (which doesn't notify) set this block to air
|
|
- Block.updateOrDestroy(blockEntity.movedState, blockState, level, pos, 3);
|
|
- } else {
|
|
- if (blockState.hasProperty(BlockStateProperties.WATERLOGGED) && blockState.getValue(BlockStateProperties.WATERLOGGED)) {
|
|
- blockState = blockState.setValue(BlockStateProperties.WATERLOGGED, false);
|
|
- }
|
|
-
|
|
- level.setBlock(pos, blockState, 67);
|
|
- level.neighborChanged(
|
|
- pos, blockState.getBlock(), ExperimentalRedstoneUtils.initialOrientation(level, blockEntity.getPushDirection(), null)
|
|
- );
|
|
- }
|
|
- }
|
|
- }
|
|
- } else {
|
|
+ // Plazma start - Remove isClientSide on DedicatedServer
|
|
+ if (!(blockEntity.progressO >= 1.0F)) {
|
|
float f = blockEntity.progress + 0.5F;
|
|
moveCollidedEntities(level, pos, f, blockEntity);
|
|
moveStuckEntities(level, pos, f, blockEntity);
|
|
@@ -326,6 +304,27 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
|
blockEntity.progress = 1.0F;
|
|
}
|
|
}
|
|
+
|
|
+ level.removeBlockEntity(pos);
|
|
+ blockEntity.setRemoved();
|
|
+ if (!level.getBlockState(pos).is(Blocks.MOVING_PISTON)) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ BlockState blockState = Block.updateFromNeighbourShapes(blockEntity.movedState, level, pos);
|
|
+ if (blockState.isAir()) {
|
|
+ level.setBlock(pos, blockEntity.movedState, io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPistonDuplication ? 84 : (84 | Block.UPDATE_CLIENTS)); // Paper - fix a variety of piston desync dupes; force notify (flag 2), it's possible the set type by the piston block (which doesn't notify) set this block to air
|
|
+ Block.updateOrDestroy(blockEntity.movedState, blockState, level, pos, 3);
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ if (blockState.hasProperty(BlockStateProperties.WATERLOGGED) && blockState.getValue(BlockStateProperties.WATERLOGGED)) {
|
|
+ blockState = blockState.setValue(BlockStateProperties.WATERLOGGED, false);
|
|
+ }
|
|
+
|
|
+ level.setBlock(pos, blockState, 67);
|
|
+ level.neighborChanged(pos, blockState.getBlock(), ExperimentalRedstoneUtils.initialOrientation(level, blockEntity.getPushDirection(), null));
|
|
+ // Plazma end - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
|
index 761fdcd4a4e18f45547afd8edff44f61c6eeacb4..9a064bae123b18c097af7f9fef470b5e799c7a56 100644
|
|
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
|
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
|
@@ -395,7 +395,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
}
|
|
|
|
boolean hasBlockEntity = blockState.hasBlockEntity();
|
|
- if (!this.level.isClientSide && !this.level.isBlockPlaceCancelled) { // Paper - prevent calling cleanup logic when undoing a block place upon a cancelled BlockPlaceEvent
|
|
+ if (/*!this.level.isClientSide &&*/ !this.level.isBlockPlaceCancelled) { // Paper - prevent calling cleanup logic when undoing a block place upon a cancelled BlockPlaceEvent // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
blockState.onRemove(this.level, pos, state, isMoving);
|
|
} else if (!blockState.is(block) && hasBlockEntity) {
|
|
this.removeBlockEntity(pos);
|
|
@@ -404,7 +404,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
if (!section.getBlockState(i, i1, i2).is(block)) {
|
|
return null;
|
|
} else {
|
|
- if (!this.level.isClientSide && doPlace && (!this.level.captureBlockStates || block instanceof net.minecraft.world.level.block.BaseEntityBlock)) { // CraftBukkit - Don't place while processing the BlockPlaceEvent, unless it's a BlockContainer. Prevents blocks such as TNT from activating when cancelled.
|
|
+ if (/*!this.level.isClientSide &&*/ doPlace && (!this.level.captureBlockStates || block instanceof net.minecraft.world.level.block.BaseEntityBlock)) { // CraftBukkit - Don't place while processing the BlockPlaceEvent, unless it's a BlockContainer. Prevents blocks such as TNT from activating when cancelled. // == true // Plazma - Remove isClientSide on DedicatedServer
|
|
state.onPlace(this.level, pos, blockState, isMoving);
|
|
}
|
|
|
|
@@ -501,7 +501,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
}
|
|
|
|
private boolean isInLevel() {
|
|
- return this.loaded || this.level.isClientSide();
|
|
+ return this.loaded; //|| this.level.isClientSide(); // == false // Plazma - Remove isClientSide on DedicatedServer
|
|
}
|
|
|
|
boolean isTicking(BlockPos pos) {
|
|
diff --git a/net/minecraft/world/level/material/Fluid.java b/net/minecraft/world/level/material/Fluid.java
|
|
index b9abf2a8e23f7b0d10e53f684a80d6c6eff3f578..ee57b1bc55d6f1aaf21af6b9d966d95691961c5f 100644
|
|
--- a/net/minecraft/world/level/material/Fluid.java
|
|
+++ b/net/minecraft/world/level/material/Fluid.java
|
|
@@ -51,8 +51,10 @@ public abstract class Fluid {
|
|
|
|
public abstract Item getBucket();
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
protected void animateTick(Level level, BlockPos pos, FluidState state, RandomSource random) {
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
protected void tick(ServerLevel level, BlockPos pos, BlockState blockState, FluidState fluidState) {
|
|
}
|
|
diff --git a/net/minecraft/world/level/material/FluidState.java b/net/minecraft/world/level/material/FluidState.java
|
|
index 481cb46973acb9785fdee5732e98aac560c6ec08..27ca4de54e03ca58a6aa675688113eefe29f5bd7 100644
|
|
--- a/net/minecraft/world/level/material/FluidState.java
|
|
+++ b/net/minecraft/world/level/material/FluidState.java
|
|
@@ -79,6 +79,7 @@ public final class FluidState extends StateHolder<Fluid, FluidState> implements
|
|
return this.amount; // Paper - fluid method optimisations
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public boolean shouldRenderBackwardUpFace(BlockGetter level, BlockPos pos) {
|
|
for (int i = -1; i <= 1; i++) {
|
|
for (int i1 = -1; i1 <= 1; i1++) {
|
|
@@ -92,14 +93,17 @@ public final class FluidState extends StateHolder<Fluid, FluidState> implements
|
|
|
|
return false;
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public void tick(ServerLevel level, BlockPos pos, BlockState state) {
|
|
this.getType().tick(level, pos, state, this);
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
public void animateTick(Level level, BlockPos pos, RandomSource random) {
|
|
this.getType().animateTick(level, pos, this, random);
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public boolean isRandomlyTicking() {
|
|
return this.isRandomlyTicking; // Paper - fluid method optimisations
|
|
@@ -122,10 +126,12 @@ public final class FluidState extends StateHolder<Fluid, FluidState> implements
|
|
// Paper end - fluid method optimisations
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Nullable
|
|
public ParticleOptions getDripParticle() {
|
|
return this.getType().getDripParticle();
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
public boolean is(TagKey<Fluid> tag) {
|
|
return this.getType().builtInRegistryHolder().is(tag);
|
|
diff --git a/net/minecraft/world/level/material/LavaFluid.java b/net/minecraft/world/level/material/LavaFluid.java
|
|
index f748c2af98a8dcd3d73023957c32957dfc70e426..4cc354be3e1cb7c8105fb3597f551f8209502231 100644
|
|
--- a/net/minecraft/world/level/material/LavaFluid.java
|
|
+++ b/net/minecraft/world/level/material/LavaFluid.java
|
|
@@ -43,6 +43,7 @@ public abstract class LavaFluid extends FlowingFluid {
|
|
return Items.LAVA_BUCKET;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(Level level, BlockPos pos, FluidState state, RandomSource random) {
|
|
BlockPos blockPos = pos.above();
|
|
@@ -71,6 +72,7 @@ public abstract class LavaFluid extends FlowingFluid {
|
|
}
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Override
|
|
public void randomTick(ServerLevel level, BlockPos pos, FluidState state, RandomSource random) {
|
|
diff --git a/net/minecraft/world/level/material/WaterFluid.java b/net/minecraft/world/level/material/WaterFluid.java
|
|
index 9a59e23f8038e3ae539e35545a45eeb8ed710c8e..fe62c8f9905e256aaac0374f94926f306e4714a2 100644
|
|
--- a/net/minecraft/world/level/material/WaterFluid.java
|
|
+++ b/net/minecraft/world/level/material/WaterFluid.java
|
|
@@ -42,6 +42,7 @@ public abstract class WaterFluid extends FlowingFluid {
|
|
return Items.WATER_BUCKET;
|
|
}
|
|
|
|
+ /* // Plazma - Remove isClientSide on DedicatedServer
|
|
@Override
|
|
public void animateTick(Level level, BlockPos pos, FluidState state, RandomSource random) {
|
|
if (!state.isSource() && !state.getValue(FALLING)) {
|
|
@@ -63,6 +64,7 @@ public abstract class WaterFluid extends FlowingFluid {
|
|
);
|
|
}
|
|
}
|
|
+ */ // Plazma - Remove isClientSide on DedicatedServer
|
|
|
|
@Nullable
|
|
@Override
|