Delete access transformer for gamerules map (#38)

This commit is contained in:
Alexdoru authored and GitHub committed 2025-07-07 21:47:57 +02:00
1 parent e95aea0c7d
commit 0f25951e8f
2 files changed
-31

No files matched your search

@@ -16,7 +16,6 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.Explosion;
import net.minecraft.world.GameRules;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.entity.living.LivingEvent;
@@ -168,11 +167,6 @@ public class EventHandlerWorld {
TCMazeHandler.init();
}
GameRules rules = e.world.getGameRules();
rules.theGameRules.put(
"mobGriefing",
new ValueOverride(this, String.valueOf(rules.getGameRuleBooleanValue("mobGriefing"))));
}
@SubscribeEvent(priority = EventPriority.HIGH)
@@ -321,27 +315,4 @@ public class EventHandlerWorld {
}
}
}
private static class ValueOverride extends GameRules.Value {
private final EventHandlerWorld handler;
public ValueOverride(EventHandlerWorld handler, String value) {
super(value);
this.handler = handler;
}
@Override
public boolean getGameRuleBooleanValue() {
boolean mobGriefing = super.getGameRuleBooleanValue();
/*
* if(mobGriefing) { Entity lastUpdated = this.handler.lastUpdated; if(lastUpdated != null) {
* StackTraceElement[] elements = Thread.currentThread().getStackTrace(); for(StackTraceElement element :
* elements) { if(element.getClassName().equals(EntityLivingBase.class.getName()) &&
* (element.getMethodName().equals("func_70071_h") || element.getMethodName().equals("onUpdate"))) { return
* !TileBlockProtector.isSpotProtected(lastUpdated.worldObj, lastUpdated); } } } }
*/
return mobGriefing;
}
}
}
@@ -18,6 +18,4 @@ public net.minecraft.entity.ai.EntityAIFollowOwner field_75336_f #field_75336_f
public net.minecraft.entity.ai.EntityLookHelper *
public net.minecraft.entity.EntityLiving field_70749_g #lookHelper
public-f net.minecraft.potion.Potion field_76425_a #potionTypes
public net.minecraft.world.GameRules field_82771_a #theGameRules
public net.minecraft.world.GameRules$Value
public net.minecraft.entity.monster.EntityCreeper field_70833_d #timeSinceIgnited