Skip to content

Commit

Permalink
Merge pull request #15 from kettingpowered/revert-13-patch-1
Browse files Browse the repository at this point in the history
Revert "FIX CraftEventFactory.java"
  • Loading branch information
JustRed23 authored Nov 17, 2023
2 parents 890e8ec + 88c4f22 commit 2b7f892
Show file tree
Hide file tree
Showing 5 changed files with 13,588 additions and 665 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
--- a/net/minecraft/server/ReloadableServerResources.java
+++ b/net/minecraft/server/ReloadableServerResources.java
@@ -28,11 +_,11 @@
private static final Logger LOGGER = LogUtils.getLogger();
@@ -29,10 +_,10 @@
private static final CompletableFuture<Unit> DATA_RELOAD_INITIAL_TASK = CompletableFuture.completedFuture(Unit.INSTANCE);
private final CommandBuildContext.Configurable commandBuildContext;
- private final Commands commands;
private final Commands commands;
- private final RecipeManager recipes = new RecipeManager();
+ public final Commands commands;
+ private final RecipeManager recipes;
private final TagManager tagManager;
private final LootDataManager lootData = new LootDataManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@

public abstract class SpellcasterIllager extends AbstractIllager {
private static final EntityDataAccessor<Byte> DATA_SPELL_CASTING_ID = SynchedEntityData.defineId(SpellcasterIllager.class, EntityDataSerializers.BYTE);
@@ -95,7 +_,7 @@

protected abstract SoundEvent getCastingSoundEvent();

- protected static enum IllagerSpell {
+ public static enum IllagerSpell {
NONE(0, 0.0D, 0.0D, 0.0D),
SUMMON_VEX(1, 0.7D, 0.7D, 0.8D),
FANGS(2, 0.4D, 0.3D, 0.35D),
@@ -183,6 +_,11 @@
public void tick() {
--this.attackWarmupDelay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
this.saturationLevel = Math.max(this.saturationLevel - 1.0F, 0.0F);
} else if (difficulty != Difficulty.PEACEFUL) {
+ // CraftBukkit start
+ org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.v1_20_R2.event.CraftEventFactory.callFoodLevelChangeEvent(entityhuman, Math.max(this.foodLevel - 1, 0));
+ org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(entityhuman, Math.max(this.foodLevel - 1, 0));
+
+ if (!event.isCancelled()) {
+ this.foodLevel = event.getFoodLevel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
import org.slf4j.Logger;

public class LootDataManager implements PreparableReloadListener, LootDataResolver {
@@ -27,7 +_,6 @@
public static final LootDataId<LootTable> EMPTY_LOOT_TABLE_KEY = new LootDataId<>(LootDataType.TABLE, BuiltInLootTables.EMPTY);
private Map<LootDataId<?>, ?> elements = Map.of();
private Multimap<LootDataType<?>, ResourceLocation> typeKeys = ImmutableMultimap.of();
-
public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier p_279240_, ResourceManager p_279377_, ProfilerFiller p_279135_, ProfilerFiller p_279088_, Executor p_279148_, Executor p_279169_) {
Map<LootDataType<?>, Map<ResourceLocation, ?>> map = new HashMap<>();
CompletableFuture<?>[] completablefuture = LootDataType.values().map((p_279242_) -> {
@@ -82,6 +_,13 @@
validationcontext.getProblems().forEach((p_279487_, p_279312_) -> {
LOGGER.warn("Found loot table element validation problem in {}: {}", p_279487_, p_279312_);
Expand Down
Loading

0 comments on commit 2b7f892

Please sign in to comment.