Commit graph

5430 commits

Author SHA1 Message Date
Jake Potrebic
0b5d7ad8d6 Custom Potion Mixes
== AT ==
public-f net.minecraft.server.MinecraftServer potionBrewing
2021-10-07 14:34:55 -07:00
Spottedleaf
299d7beee0 Put world into worldlist before initing the world
Some parts of legacy conversion will need the overworld
to get the legacy structure data storage
2022-02-22 14:21:35 -08:00
Jake Potrebic
b854576e5d Option to have default CustomSpawners in custom worlds
By default, only LevelStem's that specifically match the ResourceKey for
OVERWORLD will have the 5 (currently) impls of CustomSpawner (for
phantoms, wandering traders, etc.). This adds an option to instead of
just looking at the LevelStem key, look at the DimensionType key which
is one level below that. Defaults to off to keep vanilla behavior.
2022-02-19 20:15:41 -08:00
Jake Potrebic
0037bf388d Add missing block data API
General purpose patch adding missing getters/setters to BlockData and
its child types.

Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
Co-authored-by: Fabrizio La Rosa <lr.fabrizio@gmail.com>
2021-10-16 22:57:31 -07:00
Jake Potrebic
c21f27243d Configurable sculk sensor listener range
== AT ==
public-f net.minecraft.world.level.gameevent.vibrations.VibrationListener listenerRange
2021-08-19 18:45:42 -07:00
Jake Potrebic
2a974d288d Furnace RecipesUsed API 2022-01-13 15:20:47 -08:00
Spottedleaf
62d962ce01 Execute chunk tasks fairly for worlds while waiting for next tick
Currently, only the first world would have had tasks executed.
This might result in chunks loading far slower in the nether,
for example.
2021-12-28 07:19:01 -08:00
Jake Potrebic
809e0ae069 Add GameEvent tags 2021-01-03 20:03:35 -08:00
Jason Penilla
fd7f4e0d1a Add missing Validate calls to CraftServer#getSpawnLimit
Copies appropriate checks from CraftWorld#getSpawnLimit
2022-02-12 12:40:50 -07:00
Jake Potrebic
140e68625c Fix cancelled powdered snow bucket placement
Cancelling the placement of powdered snow from the powdered
snow bucket didn't revert grass that became snowy because of the
placement.
2021-10-08 13:12:58 -07:00
Jake Potrebic
83b4d889b7 Add missing structure set seed configs
The 4 missing structure set seed configs are strongholds, mineshafts,
buried treasure, and ancient cities.

Strongholds use a ring placement scheme which isn't random so they
utilize the world seed by default, this adds a config to override it
for just generating the ring positions.

Mineshafts and Buried Treasure structure sets are special cases
where the "salt" that can be defined for them via datapacks has 0
effect because the difference between the spacing and separation is 1
which is used as the upper bound in the random with salt. So the random
always returns the same int (0) so the salt has no effect. This adds
seeds/salts to the frequency reducer which has a similar effect.

Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
2022-01-13 23:05:53 -08:00
Jason Penilla
c0e7761df1 API for creating command sender which forwards feedback 2022-02-01 15:51:55 -07:00
Shane Freeder
0202f1788d Use a CHM for StructureTemplate.Pallete cache
fixes a CME due to this collection being shared across threads
2021-07-12 12:28:29 +01:00
Jake Potrebic
cf0525cba8 More PotionEffectType API
== AT ==
public net.minecraft.world.effect.MobEffect attributeModifiers
public net.minecraft.world.effect.MobEffect$AttributeTemplate
2021-05-27 21:58:24 -07:00
Owen1212055
0a2552a791 Freeze Tick Lock API 2021-12-26 20:27:43 -05:00
Kieran Wallbanks
e764b2b7f4 Fix NotePlayEvent
== AT ==
public org.bukkit.craftbukkit.block.data.CraftBlockData toNMS(Ljava/lang/Enum;Ljava/lang/Class;)Ljava/lang/Enum;
2021-06-21 14:23:50 +01:00
Brody Beckwith
a17ed327b3 Multi Block Change API Implementation 2022-01-14 00:41:11 -05:00
Jake Potrebic
1476dea76f Fix xp reward for baby zombies
The field that tracks the xpReward was not
getting reset if the death was cancelled
so this resets it after each call to
Zombie#getExperienceReward
2022-01-16 10:34:02 -08:00
Doc
87d0d2d557 Add configurable height for slime spawn 2021-08-02 11:24:39 -04:00
Nassim Jahnke
cbe94e7657 Reset placed block on exception 2022-01-07 11:45:15 +01:00
Cryptite
0fd1e5c650 Multiple Entries with Scoreboards 2021-09-21 18:17:33 -05:00
u9g
4ab8912b68 Add missing IAE check for PersistentDataContainer#has 2022-01-03 23:32:42 -05:00
Jake Potrebic
69548ae4ec Add config option for worlds affected by time cmd 2022-01-02 22:34:51 -08:00
Jason Penilla
25af4f1bec Expose vanilla BiomeProvider from WorldInfo 2022-01-06 15:59:06 -08:00
Brokkonaut
a6dd9f7a68 Make water animal spawn height configurable 2021-12-18 08:26:55 +01:00
Spottedleaf
5be900b223 Validate usernames 2022-01-01 05:19:37 -08:00
Owen1212055
e286abbaef Bucketable API 2021-12-26 14:03:17 -05:00
BillyGalbreath
6b1d457aea Expose isFuel and canSmelt methods to FurnaceInventory 2021-12-23 15:32:50 -06:00
Jake Potrebic
29d059d659 Fix sticky pistons and BlockPistonRetractEvent
There is an explicit check in the handling code for empty pistons that
prevents sticky pistons from firing the event. However when we look back
at the history we see that this check was originally added so that ONLY
sticky pistons would fire the retract event. I'm not sure why.
1092acbddf

Over the course of several updates, the meaning of that field appears to
have changed from "is NOT sticky" to "is sticky". So now its having the
opposite effect. Only normal pistons fire the retraction event. And like
all things in CB, it's just been carried around since.

If we are to believe the history, the correct fix for this issue is to
flip it so it only fires for sticky pistons, but that puts us in a
bind. It's already firing for non-sticky pistons, changing it now would
likely result in breakage. Furthermore, there is little documentation as
to WHY that was ever intended to be the case.

Instead we opt to remove the check entirely so that the event fires for
all piston types.

Co-authored-by: Zach Brown <1254957+zachbr@users.noreply.github.com>
Co-authored-by: Madeline Miller <mnmiller1@me.com>
2021-12-22 09:51:48 -08:00
Nassim Jahnke
929de37045 Configurable max block light for monster spawning 2021-12-16 09:40:39 +01:00
Jake Potrebic
9d08734937 Add API for item entity health
== AT ==
public net.minecraft.world.entity.item.ItemEntity health
2021-08-28 09:00:45 -07:00
Jake Potrebic
33f49c215c Entity powdered snow API
== AT ==
public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
2021-10-24 20:58:43 -07:00
Jake Potrebic
6ad7b27bb3 Improve scoreboard entries 2021-11-04 12:31:24 -07:00
Jake Potrebic
d237e02832 Forward CraftEntity in teleport command 2021-12-04 17:04:47 -08:00
LemonCaramel
c5e4146598 Add more Campfire API 2021-07-16 00:39:03 +09:00
Jason Penilla
8e42edf892 Fix ChunkSnapshot#isSectionEmpty(int) and optimize PalettedContainer copying by not using codecs 2021-12-09 00:08:11 -08:00
stonar96
71ac6d7e6a Optimize HashMapPalette
HashMapPalette uses an instance of CrudeIncrementalIntIdentityHashBiMap
internally. A Palette has a preset maximum size = 1 << bits.
CrudeIncrementalIntIdentityHashBiMap has an initial size but is
automatically resized. The CrudeIncrementalIntIdentityHashBiMap is created
with the maximum size in the constructor of HashMapPalette, with the aim
that it doesn't need to be resized anymore. However, there are two things
that I think Mojang hasn't considered here:
1) The CrudeIncrementalIntIdentityHashBiMap is resized, when its initial
size is reached and not the next time, when a further object is added.
2) HashMapPalette adds objects (unnecessarily) before checking if the
initial size of CrudeIncrementalIntIdentityHashBiMap is reached.
This means to actually avoid resize operations in
CrudeIncrementalIntIdentityHashBiMap, one has to add 2 to the initial size
or add 1 and check the size before adding objects. This commit implements
the second approach. Note that this isn't only an optimization but also
makes async reads of Palettes fail-safe. An async read while the
CrudeIncrementalIntIdentityHashBiMap is resized is fatal and can even lead
to corrupted data. This is also something that Anti-Xray is currently
relying on.
2021-01-17 01:11:36 +01:00
SamB440
24e3d1c857 Add PlayerItemFrameChangeEvent 2021-11-15 18:10:10 +00:00
Shane Freeder
c472c71eca Prevent ContainerOpenersCounter openCount from going negative 2021-11-30 05:30:35 +00:00
Jason Penilla
0919b52439 Fix Spigot growth modifiers
Fixes kelp modifier changing growth for other crops
Also add growth modifiers for glow berries, mangrove propagules,
torchflower crops and pitcher plant crops
Also fix above-mentioned modifiers from having the reverse effect

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2021-12-03 17:09:24 -08:00
Jason Penilla
22d5c6386f Remove client-side code using deprecated for removal AccessController
Fixes warnings on build
2021-11-26 15:09:58 -08:00
Nassim Jahnke
99808779a1 Prevent excessive velocity through repeated crits 2021-11-25 10:25:09 +01:00
sulu5890
16f4f7a2e0 don't attempt to teleport dead entities 2021-10-24 22:48:14 -05:00
egg82
61353ac496 Add root/admin user detection
This patch detects whether or not the server is currently executing as a privileged user and spits out a warning.
The warning serves as a sort-of PSA for newer server admins who don't understand the risks of running as root.
We've seen plenty of bad/malicious plugins hit markets, and there's been a few close-calls with exploits in the past.
Hopefully this helps mitigate some potential damage to servers, even if it is just a warning.

Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
2021-09-11 22:55:14 +02:00
Nassim Jahnke
987d596834 Configurable feature seeds
Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com>
2021-08-31 17:05:27 +02:00
Jake Potrebic
e259cfeb72 Fix upstreams block state factories
Sometimes, blocks are changed and then logic is called before the associated
tile entity is removed. When this happens, the factories were relying on the
block at the position, not the tile entity. This change prioritizes using the
tile entity type to determine the block state factory and falls back on
the material type of the block at that location.

== AT ==
public net.minecraft.world.level.block.entity.BlockEntityType validBlocks
2021-10-06 20:50:48 -07:00
Jake Potrebic
5f4779fc86 Fix CraftCriteria defaults map 2021-10-04 22:31:51 -07:00
Jake Potrebic
552c78a7a0 prevent unintended light block manipulation 2021-09-13 18:55:45 -07:00
Owen1212055
8c5582489a Update head rotation in missing places
In certain areas the player's head rotation could be desynced when teleported/moved.
This is because bukkit uses a separate head rotation field for yaw.
This issue only applies to players.
2021-06-21 21:55:23 -04:00
lexikiq
5c4d5afef1 Preserve overstacked loot
Preserves overstacked items in loot tables, such as shulker box drops, to prevent the items
from being deleted (as they'd overflow past the bounds of the container)-- or worse, causing
chunk bans via the large amount of NBT created by unstacking the items.

Fixes GH-5140 and GH-4748.
2021-06-21 23:21:58 -04:00