This commit is contained in:
Jason Penilla
2024-04-24 10:59:51 -07:00
parent c7f0919c43
commit 4a43daa012
10 changed files with 22 additions and 12 deletions

View File

@@ -135,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end - Add missing structure set seed configs + // Paper end - Add missing structure set seed configs
randomsource.setSeed(this.concentricRingsSeed); randomsource.setSeed(this.concentricRingsSeed);
+ } // Paper - Add missing structure set seed configs + } // Paper - Add missing structure set seed configs
double d0 = randomsource.nextDouble() * 3.141592653589793D * 2.0D; double d0 = randomsource.nextDouble() * Math.PI * 2.0D;
int l = 0; int l = 0;
int i1 = 0; int i1 = 0;
@@ -0,0 +0,0 @@ public class ChunkGeneratorStructureState { @@ -0,0 +0,0 @@ public class ChunkGeneratorStructureState {
@@ -171,11 +171,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end - Add missing structure set seed configs + // Paper end - Add missing structure set seed configs
return this.isPlacementChunk(calculator, chunkX, chunkZ) return this.isPlacementChunk(calculator, chunkX, chunkZ)
- && (!(this.frequency < 1.0F) || this.frequencyReductionMethod.shouldGenerate(calculator.getLevelSeed(), this.salt, chunkX, chunkZ, this.frequency)) - && this.applyAdditionalChunkRestrictions(chunkX, chunkZ, calculator.getLevelSeed())
+ && (!(this.frequency < 1.0F) || this.frequencyReductionMethod.shouldGenerate(calculator.getLevelSeed(), this.salt, chunkX, chunkZ, this.frequency, saltOverride)) // Paper - Add missing structure set seed configs + && this.applyAdditionalChunkRestrictions(chunkX, chunkZ, calculator.getLevelSeed(), saltOverride) // Paper - Add missing structure set seed configs
&& (!this.exclusionZone.isPresent() || !this.exclusionZone.get().isPlacementForbidden(calculator, chunkX, chunkZ)); && this.applyInteractionsWithOtherStructures(calculator, chunkX, chunkZ);
} }
- public boolean applyAdditionalChunkRestrictions(int chunkX, int chunkZ, long seed) {
- return !(this.frequency < 1.0F) || this.frequencyReductionMethod.shouldGenerate(seed, this.salt, chunkX, chunkZ, this.frequency);
+ // Paper start - Add missing structure set seed configs
+ public boolean applyAdditionalChunkRestrictions(int chunkX, int chunkZ, long seed, @org.jetbrains.annotations.Nullable Integer saltOverride) {
+ return !(this.frequency < 1.0F) || this.frequencyReductionMethod.shouldGenerate(seed, this.salt, chunkX, chunkZ, this.frequency, saltOverride);
+ // Paper end - Add missing structure set seed configs
}
public boolean applyInteractionsWithOtherStructures(ChunkGeneratorStructureState calculator, int centerChunkX, int centerChunkZ) {
@@ -0,0 +0,0 @@ public abstract class StructurePlacement { @@ -0,0 +0,0 @@ public abstract class StructurePlacement {
public abstract StructurePlacementType<?> type(); public abstract StructurePlacementType<?> type();

View File

@@ -25,11 +25,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit end // CraftBukkit end
+ // Paper - move NotePlayEvent call to fix instrument/note changes; TODO any way to cancel the game event? + // Paper - move NotePlayEvent call to fix instrument/note changes; TODO any way to cancel the game event?
world.blockEvent(pos, this, 0, 0); world.blockEvent(pos, this, 0, 0);
world.gameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, pos); world.gameEvent(entity, (Holder) GameEvent.NOTE_BLOCK_PLAY, pos);
} }
@@ -0,0 +0,0 @@ public class NoteBlock extends Block { @@ -0,0 +0,0 @@ public class NoteBlock extends Block {
@Override @Override
public boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) { protected boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) {
NoteBlockInstrument blockpropertyinstrument = (NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT); NoteBlockInstrument blockpropertyinstrument = (NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT);
+ // Paper start - move NotePlayEvent call to fix instrument/note changes + // Paper start - move NotePlayEvent call to fix instrument/note changes
+ org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, pos, blockpropertyinstrument, state.getValue(NOTE)); + org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, pos, blockpropertyinstrument, state.getValue(NOTE));

View File

@@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
private org.bukkit.util.Vector origin; private org.bukkit.util.Vector origin;
@javax.annotation.Nullable @javax.annotation.Nullable
private UUID originWorld; private UUID originWorld;
@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void setOrigin(@javax.annotation.Nonnull Location location) { public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector(); this.origin = location.toVector();
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setRemainingFireTicks(this.remainingFireTicks - 1); this.setRemainingFireTicks(this.remainingFireTicks - 1);
} }
@@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.setTicksFrozen(0); this.setTicksFrozen(0);
this.level().levelEvent((Player) null, 1009, this.blockPosition, 1); this.level().levelEvent((Player) null, 1009, this.blockPosition, 1);
} }
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (fromNetherPortal) { if (fromNetherPortal) {
nbttagcompound.putBoolean("Paper.FromNetherPortal", true); nbttagcompound.putBoolean("Paper.FromNetherPortal", true);
} }
@@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Paper end // Paper end
return nbttagcompound; return nbttagcompound;
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (spawnReason == null) { if (spawnReason == null) {
spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT;
} }

View File

@@ -20,9 +20,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end - Multi Block Change API + // Paper end - Multi Block Change API
+ +
@Override private void write(FriendlyByteBuf buf) {
public void write(FriendlyByteBuf buf) {
buf.writeLong(this.sectionPos.asLong()); buf.writeLong(this.sectionPos.asLong());
buf.writeVarInt(this.positions.length);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java

View File

@@ -23,6 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Reset placed block on exception + // Paper start - Reset placed block on exception
+ try { + try {
this.updateCustomBlockEntityTag(blockposition, world, entityhuman, itemstack, iblockdata1); this.updateCustomBlockEntityTag(blockposition, world, entityhuman, itemstack, iblockdata1);
BlockItem.updateBlockEntityComponents(world, blockposition, itemstack);
+ } catch (Exception e) { + } catch (Exception e) {
+ oldBlockstate.update(true, false); + oldBlockstate.update(true, false);
+ if (entityhuman instanceof ServerPlayer player) { + if (entityhuman instanceof ServerPlayer player) {