diff --git a/patches/minecraft/net/minecraft/block/BlockNote.java.patch b/patches/minecraft/net/minecraft/block/BlockNote.java.patch index d3ec274fc1..68bc8aa6d5 100644 --- a/patches/minecraft/net/minecraft/block/BlockNote.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNote.java.patch @@ -16,7 +16,7 @@ { + net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_180648_1_, p_180648_2_, p_180648_3_, p_180648_5_, p_180648_4_); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false; -+ p_180648_4_ = e.instrument.ordinal(); ++ p_180648_4_ = e.getInstrument().ordinal(); + p_180648_5_ = e.getVanillaNoteId(); float f = (float)Math.pow(2.0D, (double)(p_180648_5_ - 12) / 12.0D); p_180648_1_.func_184133_a((EntityPlayer)null, p_180648_2_, this.func_185576_e(p_180648_4_), SoundCategory.BLOCKS, 3.0F, f); diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index f718dfd55a..7ceb60ead1 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -133,7 +133,7 @@ + + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; + -+ p_147108_1_ = event.gui; ++ p_147108_1_ = event.getGui(); + if (old != null && p_147108_1_ != old) + { + old.func_146281_b(); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch index 329f40f342..8f6fd8340d 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch @@ -55,12 +55,12 @@ + net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre event = new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.field_146292_n); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) + break; -+ guibutton = event.button; ++ guibutton = event.getButton(); this.field_146290_a = guibutton; guibutton.func_146113_a(this.field_146297_k.func_147118_V()); this.func_146284_a(guibutton); + if (this.equals(this.field_146297_k.field_71462_r)) -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, this.field_146292_n)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Post(this, event.getButton(), this.field_146292_n)); } } } diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index 6559dc9601..eec1cf045f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -64,9 +64,9 @@ + IBlockState state = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78467_1_); + net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, state, p_78467_1_, yaw, pitch, roll); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ GlStateManager.func_179114_b(event.roll, 0.0F, 0.0F, 1.0F); -+ GlStateManager.func_179114_b(event.pitch, 1.0F, 0.0F, 0.0F); -+ GlStateManager.func_179114_b(event.yaw, 0.0F, 1.0F, 0.0F); ++ GlStateManager.func_179114_b(event.getRoll(), 0.0F, 0.0F, 1.0F); ++ GlStateManager.func_179114_b(event.getPitch(), 1.0F, 0.0F, 0.0F); ++ GlStateManager.func_179114_b(event.getYaw(), 0.0F, 1.0F, 0.0F); } GlStateManager.func_179109_b(0.0F, -f, 0.0F); @@ -163,9 +163,9 @@ + net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, iblockstate, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + -+ this.field_175080_Q = event.red; -+ this.field_175082_R = event.green; -+ this.field_175081_S = event.blue; ++ this.field_175080_Q = event.getRed(); ++ this.field_175082_R = event.getGreen(); ++ this.field_175081_S = event.getBlue(); + GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F); } diff --git a/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch b/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch deleted file mode 100644 index 07b5cb7797..0000000000 --- a/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/LanguageManager.java -+++ ../src-work/minecraft/net/minecraft/client/resources/LanguageManager.java -@@ -73,6 +73,7 @@ - } - - field_135049_a.func_135022_a(p_110549_1_, list); -+ net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(field_135049_a.field_135032_a, this.field_135048_c); - LanguageMap.func_135063_a(field_135049_a.field_135032_a); - } - diff --git a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch index cc10323801..0b22b88a0d 100644 --- a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch @@ -7,9 +7,9 @@ + net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(icommand, p_71556_1_, astring); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) + { -+ if (event.exception != null) ++ if (event.getException() != null) + { -+ com.google.common.base.Throwables.propagateIfPossible(event.exception); ++ com.google.common.base.Throwables.propagateIfPossible(event.getException()); + } + return 1; + } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch index d3e4db9d7a..2e5a3e8f95 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -15,10 +15,10 @@ } - entitylivingbase.func_70634_a(this.field_70165_t, this.field_70163_u, this.field_70161_v); -+ entitylivingbase.func_70634_a(event.targetX, event.targetY, event.targetZ); ++ entitylivingbase.func_70634_a(event.getTargetX(), event.getTargetY(), event.getTargetZ()); entitylivingbase.field_70143_R = 0.0F; - entitylivingbase.func_70097_a(DamageSource.field_76379_h, 5.0F); -+ entitylivingbase.func_70097_a(DamageSource.field_76379_h, event.attackDamage); ++ entitylivingbase.func_70097_a(DamageSource.field_76379_h, event.getAttackDamage()); + } } } diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch index c4ef14e35b..e085803348 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch @@ -7,7 +7,7 @@ - boolean flag = this.func_184595_k(p_70825_1_, p_70825_3_, p_70825_5_); + net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return false; -+ boolean flag = this.func_184595_k(event.targetX, event.targetY, event.targetZ); ++ boolean flag = this.func_184595_k(event.getTargetX(), event.getTargetY(), event.getTargetZ()); if (flag) { diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch index 6fe306eb02..f40c0b6316 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -28,9 +28,9 @@ - int k = MathHelper.func_76128_c(this.field_70161_v); - EntityZombie entityzombie = new EntityZombie(this.field_70170_p); + EntityZombie entityzombie; -+ if (summonAid.customSummonedAid != null && summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) ++ if (summonAid.getCustomSummonedAid() != null && summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) + { -+ entityzombie = summonAid.customSummonedAid; ++ entityzombie = summonAid.getCustomSummonedAid(); + } + else + { diff --git a/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch index 18927e74a0..8f01382c92 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch @@ -63,7 +63,7 @@ + if (!iblockstate.func_177230_c().isAir(iblockstate, field_73092_a, p_180784_1_)) { - block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); -+ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ if (event.getUseBlock() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + { + block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); + this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_); @@ -74,7 +74,7 @@ + } f = iblockstate.func_185903_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_180784_1_); } -+ if (event.useItem == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ if (event.getUseItem() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + { + if (f >= 1.0F) + { diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch index 62e355ccee..a7c0f1850d 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch @@ -57,21 +57,21 @@ + { + net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor(this, field_76759_H); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ return event.newColor; ++ return event.getNewColor(); + } + + public int getModdedBiomeGrassColor(int original) + { + net.minecraftforge.event.terraingen.BiomeEvent.GetGrassColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetGrassColor(this, original); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ return event.newColor; ++ return event.getNewColor(); + } + + public int getModdedBiomeFoliageColor(int original) + { + net.minecraftforge.event.terraingen.BiomeEvent.GetFoliageColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetFoliageColor(this, original); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ return event.newColor; ++ return event.getNewColor(); + } + + /** diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch index f66ae2e413..2b6f415c31 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch @@ -33,6 +33,6 @@ + { + net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens event = new net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens(worldType, seed, original); + net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); -+ return event.newBiomeGens; ++ return event.getNewBiomeGens(); + } } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch index 370b21be01..27625d41d5 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch @@ -49,7 +49,7 @@ { + net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField(this, p_185963_1_, p_185963_2_, p_185963_3_, p_185963_4_, p_185963_5_, p_185963_6_, p_185963_7_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.noisefield; ++ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.getNoisefield(); + if (p_185963_1_ == null) { diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch index f54b2aa4a0..f4704abe85 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch @@ -34,7 +34,7 @@ + net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField(this, p_185938_1_, p_185938_2_, p_185938_3_, p_185938_4_, p_185938_5_, p_185938_6_, p_185938_7_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.noisefield; ++ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.getNoisefield(); + double d0 = 684.412D; double d1 = 2053.236D; diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch index e48365a9f5..3a9a317099 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch @@ -50,7 +50,7 @@ + { + net.minecraftforge.event.terraingen.WorldTypeEvent.BiomeSize event = new net.minecraftforge.event.terraingen.WorldTypeEvent.BiomeSize(worldType, original); + net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); -+ return event.newSize; ++ return event.getNewSize(); + } + /* ========================================= FORGE END ======================================*/ } diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch index 4af3d40bf4..b63848da22 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch @@ -57,7 +57,7 @@ { + net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID event = new net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID(startPiece == null ? null : startPiece.biome, p_175847_1_); + net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.replacement; ++ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.getReplacement(); if (this.field_143014_b) { if (p_175847_1_.func_177230_c() == Blocks.field_150364_r || p_175847_1_.func_177230_c() == Blocks.field_150363_s) diff --git a/src/main/java/net/minecraftforge/client/ClientCommandHandler.java b/src/main/java/net/minecraftforge/client/ClientCommandHandler.java index 6a91caa0b6..0bad50d6a6 100644 --- a/src/main/java/net/minecraftforge/client/ClientCommandHandler.java +++ b/src/main/java/net/minecraftforge/client/ClientCommandHandler.java @@ -63,9 +63,9 @@ public class ClientCommandHandler extends CommandHandler CommandEvent event = new CommandEvent(icommand, sender, args); if (MinecraftForge.EVENT_BUS.post(event)) { - if (event.exception != null) + if (event.getException() != null) { - throw event.exception; + throw event.getException(); } return 0; } diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 20e279275d..892d49b59b 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -196,7 +196,7 @@ public class ForgeHooksClient { FOVUpdateEvent fovUpdateEvent = new FOVUpdateEvent(entity, fov); MinecraftForge.EVENT_BUS.post(fovUpdateEvent); - return fovUpdateEvent.newfov; + return fovUpdateEvent.getNewfov(); } public static float getFOVModifier(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, float fov) { @@ -295,7 +295,7 @@ public class ForgeHooksClient { PlaySoundEvent e = new PlaySoundEvent(manager, sound); MinecraftForge.EVENT_BUS.post(e); - return e.result; + return e.getResultSound(); } //static RenderBlocks VertexBufferRB; @@ -316,7 +316,7 @@ public class ForgeHooksClient public static float getFogDensity(EntityRenderer renderer, Entity entity, IBlockState state, float partial, float density) { EntityViewRenderEvent.FogDensity event = new EntityViewRenderEvent.FogDensity(renderer, entity, state, partial, density); - if (MinecraftForge.EVENT_BUS.post(event)) return event.density; + if (MinecraftForge.EVENT_BUS.post(event)) return event.getDensity(); return -1; } @@ -325,31 +325,6 @@ public class ForgeHooksClient MinecraftForge.EVENT_BUS.post(new EntityViewRenderEvent.RenderFogEvent(renderer, entity, state, partial, mode, distance)); } - /* - public static void setVertexBufferRB(RenderBlocks renderBlocks) - { - VertexBufferRB = renderBlocks; - } - - public static void onPreRenderWorld(VertexBuffer VertexBuffer, int pass) - { - if(VertexBufferRB != null) - { - worldRenderPass = pass; - MinecraftForge.EVENT_BUS.post(new RenderWorldEvent.Pre(VertexBuffer, (ChunkCache)VertexBufferRB.blockAccess, VertexBufferRB, pass)); - } - } - - public static void onPostRenderWorld(VertexBuffer VertexBuffer, int pass) - { - if(VertexBufferRB != null) - { - MinecraftForge.EVENT_BUS.post(new RenderWorldEvent.Post(VertexBuffer, (ChunkCache)VertexBufferRB.blockAccess, VertexBufferRB, pass)); - worldRenderPass = -1; - } - } - */ - public static void onModelBake(ModelManager modelManager, IRegistry modelRegistry, ModelLoader modelLoader) { MinecraftForge.EVENT_BUS.post(new ModelBakeEvent(modelManager, modelRegistry, modelLoader)); diff --git a/src/main/java/net/minecraftforge/client/GuiIngameForge.java b/src/main/java/net/minecraftforge/client/GuiIngameForge.java index 6fff3a25ca..0cbcb9ec9e 100644 --- a/src/main/java/net/minecraftforge/client/GuiIngameForge.java +++ b/src/main/java/net/minecraftforge/client/GuiIngameForge.java @@ -779,7 +779,7 @@ public class GuiIngameForge extends GuiIngame if (MinecraftForge.EVENT_BUS.post(event)) return; GlStateManager.pushMatrix(); - GlStateManager.translate((float)event.posX, (float)event.posY, 0.0F); + GlStateManager.translate((float) event.getPosX(), (float) event.getPosY(), 0.0F); persistantChatGUI.drawChat(updateCounter); GlStateManager.popMatrix(); diff --git a/src/main/java/net/minecraftforge/client/event/ClientChatReceivedEvent.java b/src/main/java/net/minecraftforge/client/event/ClientChatReceivedEvent.java index 36d67987a9..4639fae3af 100644 --- a/src/main/java/net/minecraftforge/client/event/ClientChatReceivedEvent.java +++ b/src/main/java/net/minecraftforge/client/event/ClientChatReceivedEvent.java @@ -7,17 +7,32 @@ import net.minecraftforge.fml.common.eventhandler.Event; @Cancelable public class ClientChatReceivedEvent extends Event { - public ITextComponent message; + private ITextComponent message; + private final byte type; + public ClientChatReceivedEvent(byte type, ITextComponent message) + { + this.type = type; + this.setMessage(message); + } + + public ITextComponent getMessage() + { + return message; + } + + public void setMessage(ITextComponent message) + { + this.message = message; + } + /** * Introduced in 1.8: * 0 : Standard Text Message * 1 : 'System' message, displayed as standard text. * 2 : 'Status' message, displayed above action bar, where song notifications are. */ - public final byte type; - public ClientChatReceivedEvent(byte type, ITextComponent message) + public byte getType() { - this.type = type; - this.message = message; + return type; } } diff --git a/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java b/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java index 0108901947..047c2ce486 100644 --- a/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java +++ b/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java @@ -9,11 +9,11 @@ import net.minecraft.client.renderer.RenderGlobal; @Cancelable public class DrawBlockHighlightEvent extends Event { - public final RenderGlobal context; - public final EntityPlayer player; - public final RayTraceResult target; - public final int subID; - public final float partialTicks; + private final RenderGlobal context; + private final EntityPlayer player; + private final RayTraceResult target; + private final int subID; + private final float partialTicks; public DrawBlockHighlightEvent(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, float partialTicks) { @@ -24,4 +24,9 @@ public class DrawBlockHighlightEvent extends Event this.partialTicks= partialTicks; } + public RenderGlobal getContext() { return context; } + public EntityPlayer getPlayer() { return player; } + public RayTraceResult getTarget() { return target; } + public int getSubID() { return subID; } + public float getPartialTicks() { return partialTicks; } } diff --git a/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java b/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java index 9d046fa417..4f9a93aa12 100644 --- a/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java +++ b/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java @@ -52,11 +52,21 @@ public abstract class EntityViewRenderEvent extends Event @Cancelable public static class FogDensity extends EntityViewRenderEvent { - public float density; + private float density; public FogDensity(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, float density) { super(renderer, entity, state, renderPartialTicks); + this.setDensity(density); + } + + public float getDensity() + { + return density; + } + + public void setDensity(float density) + { this.density = density; } } @@ -67,8 +77,8 @@ public abstract class EntityViewRenderEvent extends Event @HasResult public static class RenderFogEvent extends EntityViewRenderEvent { - public final int fogMode; - public final float farPlaneDistance; + private final int fogMode; + private final float farPlaneDistance; public RenderFogEvent(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, int fogMode, float farPlaneDistance) { @@ -76,6 +86,16 @@ public abstract class EntityViewRenderEvent extends Event this.fogMode = fogMode; this.farPlaneDistance = farPlaneDistance; } + + public int getFogMode() + { + return fogMode; + } + + public float getFarPlaneDistance() + { + return farPlaneDistance; + } } /** @@ -84,17 +104,24 @@ public abstract class EntityViewRenderEvent extends Event */ public static class FogColors extends EntityViewRenderEvent { - public float red; - public float green; - public float blue; + private float red; + private float green; + private float blue; public FogColors(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, float red, float green, float blue) { super(renderer, entity, state, renderPartialTicks); - this.red = red; - this.green = green; - this.blue = blue; + this.setRed(red); + this.setGreen(green); + this.setBlue(blue); } + + public float getRed() { return red; } + public void setRed(float red) { this.red = red; } + public float getGreen() { return green; } + public void setGreen(float green) { this.green = green; } + public float getBlue() { return blue; } + public void setBlue(float blue) { this.blue = blue; } } /** @@ -102,17 +129,24 @@ public abstract class EntityViewRenderEvent extends Event */ public static class CameraSetup extends EntityViewRenderEvent { - public float yaw; - public float pitch; - public float roll; + private float yaw; + private float pitch; + private float roll; public CameraSetup(EntityRenderer renderer, Entity entity, IBlockState state, double renderPartialTicks, float yaw, float pitch, float roll) { super(renderer, entity, state, renderPartialTicks); - this.yaw = yaw; - this.pitch = pitch; - this.roll = roll; + this.setYaw(yaw); + this.setPitch(pitch); + this.setRoll(roll); } + + public float getYaw() { return yaw; } + public void setYaw(float yaw) { this.yaw = yaw; } + public float getPitch() { return pitch; } + public void setPitch(float pitch) { this.pitch = pitch; } + public float getRoll() { return roll; } + public void setRoll(float roll) { this.roll = roll; } } /** diff --git a/src/main/java/net/minecraftforge/client/event/FOVUpdateEvent.java b/src/main/java/net/minecraftforge/client/event/FOVUpdateEvent.java index 91863999ce..1c7bb60ffe 100644 --- a/src/main/java/net/minecraftforge/client/event/FOVUpdateEvent.java +++ b/src/main/java/net/minecraftforge/client/event/FOVUpdateEvent.java @@ -9,14 +9,34 @@ import net.minecraftforge.fml.common.eventhandler.Event; */ public class FOVUpdateEvent extends Event { - public final EntityPlayer entity; - public final float fov; - public float newfov; + private final EntityPlayer entity; + private final float fov; + private float newfov; public FOVUpdateEvent(EntityPlayer entity, float fov) { this.entity = entity; this.fov = fov; - this.newfov = fov; + this.setNewfov(fov); + } + + public EntityPlayer getEntity() + { + return entity; + } + + public float getFov() + { + return fov; + } + + public float getNewfov() + { + return newfov; + } + + public void setNewfov(float newfov) + { + this.newfov = newfov; } } diff --git a/src/main/java/net/minecraftforge/client/event/GuiOpenEvent.java b/src/main/java/net/minecraftforge/client/event/GuiOpenEvent.java index 85e2d247a4..362acfd2d5 100644 --- a/src/main/java/net/minecraftforge/client/event/GuiOpenEvent.java +++ b/src/main/java/net/minecraftforge/client/event/GuiOpenEvent.java @@ -14,8 +14,18 @@ import net.minecraft.client.gui.GuiScreen; @Cancelable public class GuiOpenEvent extends Event { - public GuiScreen gui; + private GuiScreen gui; public GuiOpenEvent(GuiScreen gui) + { + this.setGui(gui); + } + + public GuiScreen getGui() + { + return gui; + } + + public void setGui(GuiScreen gui) { this.gui = gui; } diff --git a/src/main/java/net/minecraftforge/client/event/GuiScreenEvent.java b/src/main/java/net/minecraftforge/client/event/GuiScreenEvent.java index b38feff7d0..2809ffa5f8 100644 --- a/src/main/java/net/minecraftforge/client/event/GuiScreenEvent.java +++ b/src/main/java/net/minecraftforge/client/event/GuiScreenEvent.java @@ -22,29 +22,44 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiScreenEvent extends Event { - /** - * The GuiScreen object generating this event. - */ - public final GuiScreen gui; + private final GuiScreen gui; public GuiScreenEvent(GuiScreen gui) { this.gui = gui; } + /** + * The GuiScreen object generating this event. + */ + public GuiScreen getGui() + { + return gui; + } + public static class InitGuiEvent extends GuiScreenEvent { - /** - * The {@code buttonList} field from the GuiScreen object referenced by {@code gui}. - */ - public List buttonList; + private List buttonList; public InitGuiEvent(GuiScreen gui, List buttonList) { super(gui); + this.setButtonList(buttonList); + } + + /** + * The {@code buttonList} field from the GuiScreen object referenced by {@code gui}. + */ + public List getButtonList() + { + return buttonList; + } + + public void setButtonList(List buttonList) + { this.buttonList = buttonList; } - + /** * This event fires just after initializing {@code GuiScreen.mc}, {@code GuiScreen.fontRendererObj}, * {@code GuiScreen.width}, and {@code GuiScreen.height}, and just before calling {@code GuiScreen.buttonList.clear()} @@ -78,18 +93,9 @@ public class GuiScreenEvent extends Event public static class DrawScreenEvent extends GuiScreenEvent { - /** - * The x coordinate of the mouse pointer on the screen. - */ - public final int mouseX; - /** - * The y coordinate of the mouse pointer on the screen. - */ - public final int mouseY; - /** - * Partial render ticks elapsed. - */ - public final float renderPartialTicks; + private final int mouseX; + private final int mouseY; + private final float renderPartialTicks; public DrawScreenEvent(GuiScreen gui, int mouseX, int mouseY, float renderPartialTicks) { @@ -98,7 +104,31 @@ public class GuiScreenEvent extends Event this.mouseY = mouseY; this.renderPartialTicks = renderPartialTicks; } - + + /** + * The x coordinate of the mouse pointer on the screen. + */ + public int getMouseX() + { + return mouseX; + } + + /** + * The y coordinate of the mouse pointer on the screen. + */ + public int getMouseY() + { + return mouseY; + } + + /** + * Partial render ticks elapsed. + */ + public float getRenderPartialTicks() + { + return renderPartialTicks; + } + /** * This event fires just before {@code GuiScreen.drawScreen()} is called. * Cancel this event to skip {@code GuiScreen.drawScreen()}. @@ -162,22 +192,42 @@ public class GuiScreenEvent extends Event public static class ActionPerformedEvent extends GuiScreenEvent { - /** - * The button that was clicked. - */ - public GuiButton button; - /** - * A COPY of the {@code buttonList} field from the GuiScreen referenced by {@code gui}. - */ - public List buttonList; + private GuiButton button; + private List buttonList; public ActionPerformedEvent(GuiScreen gui, GuiButton button, List buttonList) { super(gui); - this.button = button; - this.buttonList = new ArrayList(buttonList); + this.setButton(button); + this.setButtonList(new ArrayList(buttonList)); } - + + /** + * The button that was clicked. + */ + public GuiButton getButton() + { + return button; + } + + public void setButton(GuiButton button) + { + this.button = button; + } + + /** + * A COPY of the {@code buttonList} field from the GuiScreen referenced by {@code gui}. + */ + public List getButtonList() + { + return buttonList; + } + + public void setButtonList(List buttonList) + { + this.buttonList = buttonList; + } + /** * This event fires once it has been determined that a GuiButton object has been clicked. * Cancel this event to bypass {@code GuiScreen.actionPerformed()}. diff --git a/src/main/java/net/minecraftforge/client/event/MouseEvent.java b/src/main/java/net/minecraftforge/client/event/MouseEvent.java index b4e5782bf9..3652bcf2ee 100644 --- a/src/main/java/net/minecraftforge/client/event/MouseEvent.java +++ b/src/main/java/net/minecraftforge/client/event/MouseEvent.java @@ -12,14 +12,14 @@ import net.minecraftforge.fml.common.eventhandler.Event; @Cancelable public class MouseEvent extends Event { - public final int x; - public final int y; - public final int dx; - public final int dy; - public final int dwheel; - public final int button; - public final boolean buttonstate; - public final long nanoseconds; + private final int x; + private final int y; + private final int dx; + private final int dy; + private final int dwheel; + private final int button; + private final boolean buttonstate; + private final long nanoseconds; public MouseEvent() { @@ -32,4 +32,13 @@ public class MouseEvent extends Event this.buttonstate = Mouse.getEventButtonState(); this.nanoseconds = Mouse.getEventNanoseconds(); } + + public int getX() { return x; } + public int getY() { return y; } + public int getDx() { return dx; } + public int getDy() { return dy; } + public int getDwheel() { return dwheel; } + public int getButton() { return button; } + public boolean isButtonstate() { return buttonstate; } + public long getNanoseconds() { return nanoseconds; } } diff --git a/src/main/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java b/src/main/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java index 7a192802da..12cc88c534 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java @@ -12,25 +12,16 @@ import net.minecraftforge.fml.common.eventhandler.Event; */ @Cancelable public class RenderBlockOverlayEvent extends Event { - + public static enum OverlayType { FIRE, BLOCK, WATER } - /** - * The player which the overlay will apply to - */ - public final EntityPlayer player; - public final float renderPartialTicks; - /** - * The type of overlay to occur - */ - public final OverlayType overlayType; - /** - * If the overlay type is BLOCK, then this is the block which the overlay is getting it's icon from - */ - public final IBlockState blockForOverlay; - public final BlockPos blockPos; + private final EntityPlayer player; + private final float renderPartialTicks; + private final OverlayType overlayType; + private final IBlockState blockForOverlay; + private final BlockPos blockPos; @Deprecated public RenderBlockOverlayEvent(EntityPlayer player, float renderPartialTicks, OverlayType type, Block block, int x, int y, int z) @@ -48,4 +39,18 @@ public class RenderBlockOverlayEvent extends Event { } + /** + * The player which the overlay will apply to + */ + public EntityPlayer getPlayer() { return player; } + public float getRenderPartialTicks() { return renderPartialTicks; } + /** + * The type of overlay to occur + */ + public OverlayType getOverlayType() { return overlayType; } + /** + * If the overlay type is BLOCK, then this is the block which the overlay is getting it's icon from + */ + public IBlockState getBlockForOverlay() { return blockForOverlay; } + public BlockPos getBlockPos() { return blockPos; } } diff --git a/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java b/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java index f70b0f577d..a9187ff057 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java @@ -10,6 +10,21 @@ import net.minecraft.client.gui.ScaledResolution; @Cancelable public class RenderGameOverlayEvent extends Event { + public float getPartialTicks() + { + return partialTicks; + } + + public ScaledResolution getResolution() + { + return resolution; + } + + public ElementType getType() + { + return type; + } + public static enum ElementType { ALL, @@ -33,9 +48,9 @@ public class RenderGameOverlayEvent extends Event SUBTITLES } - public final float partialTicks; - public final ScaledResolution resolution; - public final ElementType type; + private final float partialTicks; + private final ScaledResolution resolution; + private final ElementType type; public RenderGameOverlayEvent(float partialTicks, ScaledResolution resolution) { @@ -46,8 +61,8 @@ public class RenderGameOverlayEvent extends Event private RenderGameOverlayEvent(RenderGameOverlayEvent parent, ElementType type) { - this.partialTicks = parent.partialTicks; - this.resolution = parent.resolution; + this.partialTicks = parent.getPartialTicks(); + this.resolution = parent.getResolution(); this.type = type; } @@ -70,25 +85,55 @@ public class RenderGameOverlayEvent extends Event public static class Text extends Pre { - public final ArrayList left; - public final ArrayList right; + private final ArrayList left; + private final ArrayList right; public Text(RenderGameOverlayEvent parent, ArrayList left, ArrayList right) { super(parent, ElementType.TEXT); this.left = left; this.right = right; } + + public ArrayList getLeft() + { + return left; + } + + public ArrayList getRight() + { + return right; + } } public static class Chat extends Pre { - public int posX; - public int posY; + private int posX; + private int posY; public Chat(RenderGameOverlayEvent parent, int posX, int posY) { super(parent, ElementType.CHAT); + this.setPosX(posX); + this.setPosY(posY); + } + + public int getPosX() + { + return posX; + } + + public void setPosX(int posX) + { this.posX = posX; + } + + public int getPosY() + { + return posY; + } + + public void setPosY(int posY) + { this.posY = posY; } } diff --git a/src/main/java/net/minecraftforge/client/event/RenderHandEvent.java b/src/main/java/net/minecraftforge/client/event/RenderHandEvent.java index 0743f8db09..9af3b47581 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderHandEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderHandEvent.java @@ -7,13 +7,28 @@ import net.minecraft.client.renderer.RenderGlobal; @Cancelable public class RenderHandEvent extends Event { - public final RenderGlobal context; - public final float partialTicks; - public final int renderPass; + private final RenderGlobal context; + private final float partialTicks; + private final int renderPass; public RenderHandEvent(RenderGlobal context, float partialTicks, int renderPass) { this.context = context; this.partialTicks = partialTicks; this.renderPass = renderPass; } + + public RenderGlobal getContext() + { + return context; + } + + public float getPartialTicks() + { + return partialTicks; + } + + public int getRenderPass() + { + return renderPass; + } } diff --git a/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java b/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java index f394ae5f46..2efabac14c 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java @@ -14,9 +14,9 @@ import net.minecraftforge.fml.common.eventhandler.Event; @Cancelable public class RenderItemInFrameEvent extends Event { - public final ItemStack item; - public final EntityItemFrame entityItemFrame; - public final RenderItemFrame renderer; + private final ItemStack item; + private final EntityItemFrame entityItemFrame; + private final RenderItemFrame renderer; public RenderItemInFrameEvent(EntityItemFrame itemFrame, RenderItemFrame renderItemFrame) { @@ -24,4 +24,19 @@ public class RenderItemInFrameEvent extends Event entityItemFrame = itemFrame; renderer = renderItemFrame; } + + public ItemStack getItem() + { + return item; + } + + public EntityItemFrame getEntityItemFrame() + { + return entityItemFrame; + } + + public RenderItemFrame getRenderer() + { + return renderer; + } } diff --git a/src/main/java/net/minecraftforge/client/event/RenderLivingEvent.java b/src/main/java/net/minecraftforge/client/event/RenderLivingEvent.java index 409917da94..9c9bc51d22 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderLivingEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderLivingEvent.java @@ -7,11 +7,11 @@ import net.minecraft.entity.EntityLivingBase; public abstract class RenderLivingEvent extends Event { - public final EntityLivingBase entity; - public final RenderLivingBase renderer; - public final double x; - public final double y; - public final double z; + private final EntityLivingBase entity; + private final RenderLivingBase renderer; + private final double x; + private final double y; + private final double z; public RenderLivingEvent(EntityLivingBase entity, RenderLivingBase renderer, double x, double y, double z) { @@ -21,7 +21,13 @@ public abstract class RenderLivingEvent extends Even this.y = y; this.z = z; } - + + public EntityLivingBase getEntity() { return entity; } + public RenderLivingBase getRenderer() { return renderer; } + public double getX() { return x; } + public double getY() { return y; } + public double getZ() { return z; } + @Cancelable public static class Pre extends RenderLivingEvent { diff --git a/src/main/java/net/minecraftforge/client/event/RenderPlayerEvent.java b/src/main/java/net/minecraftforge/client/event/RenderPlayerEvent.java index 30ec16ccec..088ac8de3c 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderPlayerEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderPlayerEvent.java @@ -8,11 +8,11 @@ import net.minecraftforge.event.entity.player.PlayerEvent; public abstract class RenderPlayerEvent extends PlayerEvent { - public final RenderPlayer renderer; - public final float partialRenderTick; - public final double x; - public final double y; - public final double z; + private final RenderPlayer renderer; + private final float partialRenderTick; + private final double x; + private final double y; + private final double z; public RenderPlayerEvent(EntityPlayer player, RenderPlayer renderer, float partialRenderTick, double x, double y, double z) { @@ -24,6 +24,12 @@ public abstract class RenderPlayerEvent extends PlayerEvent this.z = z; } + public RenderPlayer getRenderer() { return renderer; } + public float getPartialRenderTick() { return partialRenderTick; } + public double getX() { return x; } + public double getY() { return y; } + public double getZ() { return z; } + @Cancelable public static class Pre extends RenderPlayerEvent { @@ -50,10 +56,17 @@ public abstract class RenderPlayerEvent extends PlayerEvent @Cancelable public static class Pre extends Specials { - public boolean renderHelmet = true; - public boolean renderCape = true; - public boolean renderItem = true; + private boolean renderHelmet = true; + private boolean renderCape = true; + private boolean renderItem = true; public Pre(EntityPlayer player, RenderPlayer renderer, float partialTicks){ super(player, renderer, partialTicks); } + + public boolean shouldRenderHelmet() { return renderHelmet; } + public void setRenderHelmet(boolean renderHelmet) { this.renderHelmet = renderHelmet; } + public boolean shouldRenderCape() { return renderCape; } + public void setRenderCape(boolean renderCape) { this.renderCape = renderCape; } + public boolean shouldRenderItem() { return renderItem; } + public void setRenderItem(boolean renderItem) { this.renderItem = renderItem; } } public static class Post extends Specials @@ -65,18 +78,38 @@ public abstract class RenderPlayerEvent extends PlayerEvent @Deprecated public static class SetArmorModel extends RenderPlayerEvent { - /** - * Setting this to any value besides -1 will result in the function being - * Immediately exited with the return value specified. - */ - public int result = -1; - public final int slot; - public final ItemStack stack; + private int result = -1; + private final int slot; + private final ItemStack stack; public SetArmorModel(EntityPlayer player, RenderPlayer renderer, int slot, float partialTick, ItemStack stack) { super(player, renderer, partialTick, 0D, 0D, 0D); this.slot = slot; this.stack = stack; } + + /** + * Setting this to any value besides -1 will result in the function being + * Immediately exited with the return value specified. + */ + public int getResultValue() + { + return result; + } + + public void setResult(int result) + { + this.result = result; + } + + public int getSlot() + { + return slot; + } + + public ItemStack getStack() + { + return stack; + } } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/client/event/RenderWorldEvent.java b/src/main/java/net/minecraftforge/client/event/RenderWorldEvent.java deleted file mode 100644 index dbe60ff67b..0000000000 --- a/src/main/java/net/minecraftforge/client/event/RenderWorldEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.minecraftforge.client.event; - -import net.minecraftforge.fml.common.eventhandler.Event; -//import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.world.ChunkCache; - -public abstract class RenderWorldEvent extends Event -{ - public final VertexBuffer renderer; - public final ChunkCache chunkCache; - //public final RenderBlocks renderBlocks; - public final int pass; - - public RenderWorldEvent(VertexBuffer renderer, ChunkCache chunkCache, /*RenderBlocks renderBlocks,*/ int pass) - { - this.renderer = renderer; - this.chunkCache = chunkCache; - //this.renderBlocks = renderBlocks; - this.pass = pass; - } - - /** - * Fired when 16x16x16 chunk area is being redrawn. - * Fired after GL state is setup, before tessellator is started. - */ - public static class Pre extends RenderWorldEvent - { - public Pre(VertexBuffer renderer, ChunkCache chunkCache, /*RenderBlocks renderBlocks,*/ int pass){ super(renderer, chunkCache, /*renderBlocks,*/ pass); } - } - - /** - * Fired after the tessellator is stopped, before the display list is ended. - */ - public static class Post extends RenderWorldEvent - { - public Post(VertexBuffer renderer, ChunkCache chunkCache, /*RenderBlocks renderBlocks,*/ int pass){ super(renderer, chunkCache, /*renderBlocks,*/ pass); } - } -} diff --git a/src/main/java/net/minecraftforge/client/event/RenderWorldLastEvent.java b/src/main/java/net/minecraftforge/client/event/RenderWorldLastEvent.java index 0d92024e12..646fd23fbf 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderWorldLastEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderWorldLastEvent.java @@ -5,11 +5,21 @@ import net.minecraft.client.renderer.RenderGlobal; public class RenderWorldLastEvent extends Event { - public final RenderGlobal context; - public final float partialTicks; + private final RenderGlobal context; + private final float partialTicks; public RenderWorldLastEvent(RenderGlobal context, float partialTicks) { this.context = context; this.partialTicks = partialTicks; } + + public RenderGlobal getContext() + { + return context; + } + + public float getPartialTicks() + { + return partialTicks; + } } diff --git a/src/main/java/net/minecraftforge/client/event/TextureStitchEvent.java b/src/main/java/net/minecraftforge/client/event/TextureStitchEvent.java index 21af9e192d..b943b7b8d1 100644 --- a/src/main/java/net/minecraftforge/client/event/TextureStitchEvent.java +++ b/src/main/java/net/minecraftforge/client/event/TextureStitchEvent.java @@ -6,13 +6,18 @@ import net.minecraft.client.renderer.texture.TextureMap; public class TextureStitchEvent extends Event { - public final TextureMap map; + private final TextureMap map; public TextureStitchEvent(TextureMap map) { this.map = map; } + public TextureMap getMap() + { + return map; + } + /** * Fired when the TextureMap is told to refresh it's stitched texture. * Called after the Stitched list is cleared, but before any blocks or items diff --git a/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java b/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java index b7fa7d7c4c..8338d25f66 100644 --- a/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java +++ b/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java @@ -11,15 +11,35 @@ import net.minecraft.client.audio.SoundManager; */ public class PlaySoundEvent extends SoundEvent { - public final String name; - public final ISound sound; - public ISound result; + private final String name; + private final ISound sound; + private ISound result; public PlaySoundEvent(SoundManager manager, ISound sound) { super(manager); this.sound = sound; this.name = sound.getSoundLocation().getResourcePath(); - this.result = sound; + this.setResultSound(sound); + } + + public String getName() + { + return name; + } + + public ISound getSound() + { + return sound; + } + + public ISound getResultSound() + { + return result; + } + + public void setResultSound(ISound result) + { + this.result = result; } } diff --git a/src/main/java/net/minecraftforge/client/event/sound/SoundEvent.java b/src/main/java/net/minecraftforge/client/event/sound/SoundEvent.java index dbfecd03a7..e8b450a106 100644 --- a/src/main/java/net/minecraftforge/client/event/sound/SoundEvent.java +++ b/src/main/java/net/minecraftforge/client/event/sound/SoundEvent.java @@ -6,12 +6,17 @@ import net.minecraft.client.audio.SoundManager; public class SoundEvent extends Event { - public final SoundManager manager; + private final SoundManager manager; public SoundEvent(SoundManager manager) { this.manager = manager; } + public SoundManager getManager() + { + return manager; + } + public static class SoundSourceEvent extends SoundEvent { public final ISound sound; diff --git a/src/main/java/net/minecraftforge/common/ForgeChunkManager.java b/src/main/java/net/minecraftforge/common/ForgeChunkManager.java index bf17bc1dc8..66d7f7d113 100644 --- a/src/main/java/net/minecraftforge/common/ForgeChunkManager.java +++ b/src/main/java/net/minecraftforge/common/ForgeChunkManager.java @@ -370,25 +370,45 @@ public class ForgeChunkManager } public static class ForceChunkEvent extends Event { - public final Ticket ticket; - public final ChunkCoordIntPair location; + private final Ticket ticket; + private final ChunkCoordIntPair location; public ForceChunkEvent(Ticket ticket, ChunkCoordIntPair location) { this.ticket = ticket; this.location = location; } + + public Ticket getTicket() + { + return ticket; + } + + public ChunkCoordIntPair getLocation() + { + return location; + } } public static class UnforceChunkEvent extends Event { - public final Ticket ticket; - public final ChunkCoordIntPair location; + private final Ticket ticket; + private final ChunkCoordIntPair location; public UnforceChunkEvent(Ticket ticket, ChunkCoordIntPair location) { this.ticket = ticket; this.location = location; } + + public Ticket getTicket() + { + return ticket; + } + + public ChunkCoordIntPair getLocation() + { + return location; + } } diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index c7fd9f66ef..1a475e0544 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -56,7 +56,6 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.WeightedRandom; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; @@ -483,7 +482,7 @@ public class ForgeHooks public static float[] onLivingFall(EntityLivingBase entity, float distance, float damageMultiplier) { LivingFallEvent event = new LivingFallEvent(entity, distance, damageMultiplier); - return (MinecraftForge.EVENT_BUS.post(event) ? null : new float[]{event.distance, event.damageMultiplier}); + return (MinecraftForge.EVENT_BUS.post(event) ? null : new float[]{event.getDistance(), event.getDamageMultiplier()}); } public static boolean isLivingOnLadder(IBlockState state, World world, BlockPos pos, EntityLivingBase entity) @@ -544,9 +543,9 @@ public class ForgeHooks if (!player.worldObj.isRemote) { - player.getEntityWorld().spawnEntityInWorld(event.entityItem); + player.getEntityWorld().spawnEntityInWorld(event.getEntityItem()); } - return event.entityItem; + return event.getEntityItem(); } public static float getEnchantPower(World world, BlockPos pos) @@ -648,7 +647,7 @@ public class ForgeHooks { PlayerOpenContainerEvent event = new PlayerOpenContainerEvent(player, openContainer); MinecraftForge.EVENT_BUS.post(event); - return event.getResult() == Event.Result.DEFAULT ? event.canInteractWith : event.getResult() == Event.Result.ALLOW ? true : false; + return event.getResult() == Event.Result.DEFAULT ? event.isCanInteractWith() : event.getResult() == Event.Result.ALLOW ? true : false; } public static int onBlockBreakEvent(World world, GameType gameType, EntityPlayerMP entityPlayer, BlockPos pos) @@ -800,11 +799,11 @@ public class ForgeHooks { AnvilUpdateEvent e = new AnvilUpdateEvent(left, right, name, baseCost); if (MinecraftForge.EVENT_BUS.post(e)) return false; - if (e.output == null) return true; + if (e.getOutput() == null) return true; - outputSlot.setInventorySlotContents(0, e.output); - container.maximumCost = e.cost; - container.materialCost = e.materialCost; + outputSlot.setInventorySlotContents(0, e.getOutput()); + container.maximumCost = e.getCost(); + container.materialCost = e.getMaterialCost(); return false; } @@ -812,7 +811,7 @@ public class ForgeHooks { AnvilRepairEvent e = new AnvilRepairEvent(player, left, right, output); MinecraftForge.EVENT_BUS.post(e); - return e.breakChance; + return e.getBreakChance(); } public static boolean onNoteChange(TileEntityNote te, byte old) diff --git a/src/main/java/net/minecraftforge/common/ForgeInternalHandler.java b/src/main/java/net/minecraftforge/common/ForgeInternalHandler.java index 43295be8e2..7d5d5ad209 100644 --- a/src/main/java/net/minecraftforge/common/ForgeInternalHandler.java +++ b/src/main/java/net/minecraftforge/common/ForgeInternalHandler.java @@ -17,12 +17,12 @@ public class ForgeInternalHandler @SubscribeEvent(priority = EventPriority.HIGHEST) public void onEntityJoinWorld(EntityJoinWorldEvent event) { - if (!event.world.isRemote) + if (!event.getWorld().isRemote) { - ForgeChunkManager.loadEntity(event.entity); + ForgeChunkManager.loadEntity(event.getEntity()); } - Entity entity = event.entity; + Entity entity = event.getEntity(); if (entity.getClass().equals(EntityItem.class)) { ItemStack stack = ((EntityItem)entity).getEntityItem(); @@ -47,12 +47,12 @@ public class ForgeInternalHandler if (item.hasCustomEntity(stack)) { - Entity newEntity = item.createEntity(event.world, entity, stack); + Entity newEntity = item.createEntity(event.getWorld(), entity, stack); if (newEntity != null) { entity.setDead(); event.setCanceled(true); - event.world.spawnEntityInWorld(newEntity); + event.getWorld().spawnEntityInWorld(newEntity); } } } @@ -61,20 +61,20 @@ public class ForgeInternalHandler @SubscribeEvent(priority = EventPriority.HIGHEST) public void onDimensionLoad(WorldEvent.Load event) { - ForgeChunkManager.loadWorld(event.world); + ForgeChunkManager.loadWorld(event.getWorld()); } @SubscribeEvent(priority = EventPriority.HIGHEST) public void onDimensionSave(WorldEvent.Save event) { - ForgeChunkManager.saveWorld(event.world); + ForgeChunkManager.saveWorld(event.getWorld()); } @SubscribeEvent(priority = EventPriority.HIGHEST) public void onDimensionUnload(WorldEvent.Unload event) { - ForgeChunkManager.unloadWorld(event.world); - if (event.world instanceof WorldServer) - FakePlayerFactory.unloadWorld((WorldServer)event.world); + ForgeChunkManager.unloadWorld(event.getWorld()); + if (event.getWorld() instanceof WorldServer) + FakePlayerFactory.unloadWorld((WorldServer) event.getWorld()); } } diff --git a/src/main/java/net/minecraftforge/event/AnvilUpdateEvent.java b/src/main/java/net/minecraftforge/event/AnvilUpdateEvent.java index 585c5a715d..94baabc085 100644 --- a/src/main/java/net/minecraftforge/event/AnvilUpdateEvent.java +++ b/src/main/java/net/minecraftforge/event/AnvilUpdateEvent.java @@ -14,19 +14,29 @@ import net.minecraft.item.ItemStack; @Cancelable public class AnvilUpdateEvent extends Event { - public final ItemStack left; // The left side of the input - public final ItemStack right; // The right side of the input - public final String name; // The name to set the item, if the user specified one. - public ItemStack output; // Set this to set the output stack - public int cost; // The base cost, set this to change it if output != null - public int materialCost; // The number of items from the right slot to be consumed during the repair. Leave as 0 to consume the entire stack. + private final ItemStack left; // The left side of the input + private final ItemStack right; // The right side of the input + private final String name; // The name to set the item, if the user specified one. + private ItemStack output; // Set this to set the output stack + private int cost; // The base cost, set this to change it if output != null + private int materialCost; // The number of items from the right slot to be consumed during the repair. Leave as 0 to consume the entire stack. public AnvilUpdateEvent(ItemStack left, ItemStack right, String name, int cost) { this.left = left; this.right = right; this.name = name; - this.cost = cost; - this.materialCost = 0; + this.setCost(cost); + this.setMaterialCost(0); } + + public ItemStack getLeft() { return left; } + public ItemStack getRight() { return right; } + public String getName() { return name; } + public ItemStack getOutput() { return output; } + public void setOutput(ItemStack output) { this.output = output; } + public int getCost() { return cost; } + public void setCost(int cost) { this.cost = cost; } + public int getMaterialCost() { return materialCost; } + public void setMaterialCost(int materialCost) { this.materialCost = materialCost; } } diff --git a/src/main/java/net/minecraftforge/event/CommandEvent.java b/src/main/java/net/minecraftforge/event/CommandEvent.java index 5c316b5148..58f2943082 100644 --- a/src/main/java/net/minecraftforge/event/CommandEvent.java +++ b/src/main/java/net/minecraftforge/event/CommandEvent.java @@ -26,15 +26,22 @@ import net.minecraft.command.ICommandSender; public class CommandEvent extends Event { - public final ICommand command; - public final ICommandSender sender; - public String[] parameters; - public Throwable exception; + private final ICommand command; + private final ICommandSender sender; + private String[] parameters; + private Throwable exception; public CommandEvent(ICommand command, ICommandSender sender, String[] parameters) { this.command = command; this.sender = sender; - this.parameters = parameters; + this.setParameters(parameters); } + + public ICommand getCommand() { return command; } + public ICommandSender getSender() { return sender; } + public String[] getParameters() { return parameters; } + public void setParameters(String[] parameters) { this.parameters = parameters; } + public Throwable getException() { return exception; } + public void setException(Throwable exception) { this.exception = exception; } } diff --git a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java index 55c16f8cbc..99f18e3fba 100644 --- a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java +++ b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java @@ -125,7 +125,7 @@ public class ForgeEventFactory public static float getBreakSpeed(EntityPlayer player, IBlockState state, float original, BlockPos pos) { PlayerEvent.BreakSpeed event = new PlayerEvent.BreakSpeed(player, state, original, pos); - return (MinecraftForge.EVENT_BUS.post(event) ? -1 : event.newSpeed); + return (MinecraftForge.EVENT_BUS.post(event) ? -1 : event.getNewSpeed()); } @Deprecated @@ -182,28 +182,28 @@ public class ForgeEventFactory { return null; } - return event.list; + return event.getList(); } public static int getMaxSpawnPackSize(EntityLiving entity) { LivingPackSizeEvent maxCanSpawnEvent = new LivingPackSizeEvent(entity); MinecraftForge.EVENT_BUS.post(maxCanSpawnEvent); - return maxCanSpawnEvent.getResult() == Result.ALLOW ? maxCanSpawnEvent.maxPackSize : entity.getMaxSpawnedInChunk(); + return maxCanSpawnEvent.getResult() == Result.ALLOW ? maxCanSpawnEvent.getMaxPackSize() : entity.getMaxSpawnedInChunk(); } public static String getPlayerDisplayName(EntityPlayer player, String username) { PlayerEvent.NameFormat event = new PlayerEvent.NameFormat(player, username); MinecraftForge.EVENT_BUS.post(event); - return event.displayname; + return event.getDisplayname(); } public static float fireBlockHarvesting(List drops, World world, BlockPos pos, IBlockState state, int fortune, float dropChance, boolean silkTouch, EntityPlayer player) { BlockEvent.HarvestDropsEvent event = new BlockEvent.HarvestDropsEvent(world, pos, state, fortune, dropChance, drops, player, silkTouch); MinecraftForge.EVENT_BUS.post(event); - return event.dropChance; + return event.getDropChance(); } public static ItemTooltipEvent onItemTooltip(ItemStack itemStack, EntityPlayer entityPlayer, List toolTip, boolean showAdvancedItemTooltips) @@ -228,13 +228,13 @@ public class ForgeEventFactory public static int onItemUseStart(EntityLivingBase entity, ItemStack item, int duration) { LivingEntityUseItemEvent event = new LivingEntityUseItemEvent.Start(entity, item, duration); - return MinecraftForge.EVENT_BUS.post(event) ? -1 : event.duration; + return MinecraftForge.EVENT_BUS.post(event) ? -1 : event.getDuration(); } public static int onItemUseTick(EntityLivingBase entity, ItemStack item, int duration) { LivingEntityUseItemEvent event = new LivingEntityUseItemEvent.Tick(entity, item, duration); - return MinecraftForge.EVENT_BUS.post(event) ? -1 : event.duration; + return MinecraftForge.EVENT_BUS.post(event) ? -1 : event.getDuration(); } public static boolean onUseItemStop(EntityLivingBase entity, ItemStack item, int duration) @@ -246,7 +246,7 @@ public class ForgeEventFactory { LivingEntityUseItemEvent.Finish event = new LivingEntityUseItemEvent.Finish(entity, item, duration, result); MinecraftForge.EVENT_BUS.post(event); - return event.result; + return event.getResultStack(); } public static void onStartEntityTracking(Entity entity, EntityPlayer player) @@ -279,7 +279,7 @@ public class ForgeEventFactory public static ITextComponent onClientChat(byte type, ITextComponent message) { ClientChatReceivedEvent event = new ClientChatReceivedEvent(type, message); - return MinecraftForge.EVENT_BUS.post(event) ? null : event.message; + return MinecraftForge.EVENT_BUS.post(event) ? null : event.getMessage(); } public static int onHoeUse(ItemStack stack, EntityPlayer player, World worldIn, BlockPos pos) @@ -332,7 +332,7 @@ public class ForgeEventFactory { EntityEvent.CanUpdate event = new EntityEvent.CanUpdate(entity); MinecraftForge.EVENT_BUS.post(event); - return event.canUpdate; + return event.getCanUpdate(); } public static PlaySoundAtEntityEvent onPlaySoundAtEntity(Entity entity, SoundEvent name, SoundCategory category, float volume, float pitch) @@ -347,7 +347,7 @@ public class ForgeEventFactory if (item == null) return -1; ItemExpireEvent event = new ItemExpireEvent(entity, (item.getItem() == null ? 6000 : item.getItem().getEntityLifespan(item, entity.worldObj))); if (!MinecraftForge.EVENT_BUS.post(event)) return -1; - return event.extraLife; + return event.getExtraLife(); } public static int onItemPickup(EntityItem entityItem, EntityPlayer entityIn, ItemStack itemstack) @@ -391,7 +391,7 @@ public class ForgeEventFactory { PlayerSleepInBedEvent event = new PlayerSleepInBedEvent(player, pos); MinecraftForge.EVENT_BUS.post(event); - return event.result; + return event.getResultStatus(); } public static void onPlayerWakeup(EntityPlayer player, boolean wakeImmediately, boolean updateWorldFlag, boolean setSpawn) @@ -442,7 +442,7 @@ public class ForgeEventFactory public static float onLivingHeal(EntityLivingBase entity, float amount) { LivingHealEvent event = new LivingHealEvent(entity, amount); - return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.amount); + return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.getAmount()); } public static boolean onPotionAttemptBrew(ItemStack[] stacks) diff --git a/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java b/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java index 8ec9d6724c..b3c194d80c 100644 --- a/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java +++ b/src/main/java/net/minecraftforge/event/brewing/PotionBrewEvent.java @@ -73,8 +73,7 @@ public class PotionBrewEvent extends Event *
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
**/ - @SuppressWarnings("deprecation") - public static class Post extends PotionBrewedEvent + public static class Post extends PotionBrewEvent { public Post(ItemStack[] stacks) { diff --git a/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java b/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java deleted file mode 100644 index 59bf94d614..0000000000 --- a/src/main/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.minecraftforge.event.brewing; - -import net.minecraft.item.ItemStack; - -/** - * PotionBrewedEvent is fired when a potion is brewed in the brewing stand. - *
- * The event is fired during the TileEntityBrewingStand#brewPotions() method invocation.
- *
- * {@link #brewingStacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.
- *
- * This event is not {@link Cancelable}.
- *
- * This event does not have a result. {@link HasResult}
- *
- * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
- **/ -@Deprecated // remove in 1.9 -public class PotionBrewedEvent extends PotionBrewEvent -{ - /** - * The brewing stacks in the brewing stand. Each index has the possibility to be null, so make sure you check. - * Changing this array to another one has no effect. - */ - @Deprecated - public ItemStack[] brewingStacks; - public PotionBrewedEvent(ItemStack[] brewingStacks) - { - super(brewingStacks); - this.brewingStacks = brewingStacks; - } -} diff --git a/src/main/java/net/minecraftforge/event/entity/EntityEvent.java b/src/main/java/net/minecraftforge/event/entity/EntityEvent.java index 76c0415818..462de61a3d 100644 --- a/src/main/java/net/minecraftforge/event/entity/EntityEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/EntityEvent.java @@ -14,13 +14,18 @@ import net.minecraft.entity.Entity; **/ public class EntityEvent extends Event { - public final Entity entity; + private final Entity entity; public EntityEvent(Entity entity) { this.entity = entity; } - + + public Entity getEntity() + { + return entity; + } + /** * EntityConstructing is fired when an Entity is being created.
* This event is fired within the constructor of the Entity.
@@ -54,11 +59,21 @@ public class EntityEvent extends Event **/ public static class CanUpdate extends EntityEvent { - public boolean canUpdate = false; + private boolean canUpdate = false; public CanUpdate(Entity entity) { super(entity); } + + public boolean getCanUpdate() + { + return canUpdate; + } + + public void setCanUpdate(boolean canUpdate) + { + this.canUpdate = canUpdate; + } } /** @@ -74,18 +89,27 @@ public class EntityEvent extends Event **/ public static class EnteringChunk extends EntityEvent { - public int newChunkX; - public int newChunkZ; - public int oldChunkX; - public int oldChunkZ; + private int newChunkX; + private int newChunkZ; + private int oldChunkX; + private int oldChunkZ; public EnteringChunk(Entity entity, int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ) { super(entity); - this.newChunkX = newChunkX; - this.newChunkZ = newChunkZ; - this.oldChunkX = oldChunkX; - this.oldChunkZ = oldChunkZ; + this.setNewChunkX(newChunkX); + this.setNewChunkZ(newChunkZ); + this.setOldChunkX(oldChunkX); + this.setOldChunkZ(oldChunkZ); } + + public int getNewChunkX() { return newChunkX; } + public void setNewChunkX(int newChunkX) { this.newChunkX = newChunkX; } + public int getNewChunkZ() { return newChunkZ; } + public void setNewChunkZ(int newChunkZ) { this.newChunkZ = newChunkZ; } + public int getOldChunkX() { return oldChunkX; } + public void setOldChunkX(int oldChunkX) { this.oldChunkX = oldChunkX; } + public int getOldChunkZ() { return oldChunkZ; } + public void setOldChunkZ(int oldChunkZ) { this.oldChunkZ = oldChunkZ; } } } diff --git a/src/main/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java b/src/main/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java index 9882373b17..a7ac552448 100644 --- a/src/main/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java @@ -22,11 +22,16 @@ import net.minecraft.world.World; public class EntityJoinWorldEvent extends EntityEvent { - public final World world; + private final World world; public EntityJoinWorldEvent(Entity entity, World world) { super(entity); this.world = world; } + + public World getWorld() + { + return world; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/EntityMountEvent.java b/src/main/java/net/minecraftforge/event/entity/EntityMountEvent.java index c849e4792c..921917eb69 100644 --- a/src/main/java/net/minecraftforge/event/entity/EntityMountEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/EntityMountEvent.java @@ -23,9 +23,9 @@ import net.minecraftforge.fml.common.eventhandler.Event.HasResult; public class EntityMountEvent extends EntityEvent { - public final Entity entityMounting; - public final Entity entityBeingMounted; - public final World worldObj; + private final Entity entityMounting; + private final Entity entityBeingMounted; + private final World worldObj; private final boolean isMounting; @@ -48,4 +48,18 @@ public class EntityMountEvent extends EntityEvent return !isMounting; } + public Entity getEntityMounting() + { + return entityMounting; + } + + public Entity getEntityBeingMounted() + { + return entityBeingMounted; + } + + public World getWorldObj() + { + return worldObj; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java b/src/main/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java index b9fdd3f02a..24e3cc2f17 100644 --- a/src/main/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java @@ -21,11 +21,16 @@ import net.minecraft.entity.effect.EntityLightningBolt; @Cancelable public class EntityStruckByLightningEvent extends EntityEvent { - public final EntityLightningBolt lightning; + private final EntityLightningBolt lightning; public EntityStruckByLightningEvent(Entity entity, EntityLightningBolt lightning) { super(entity); this.lightning = lightning; } + + public EntityLightningBolt getLightning() + { + return lightning; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/EntityTravelToDimensionEvent.java b/src/main/java/net/minecraftforge/event/entity/EntityTravelToDimensionEvent.java index d62c2765bd..ebfc21a153 100644 --- a/src/main/java/net/minecraftforge/event/entity/EntityTravelToDimensionEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/EntityTravelToDimensionEvent.java @@ -19,11 +19,16 @@ import net.minecraftforge.fml.common.eventhandler.Event.HasResult; @Cancelable public class EntityTravelToDimensionEvent extends EntityEvent { - public final int dimension; + private final int dimension; public EntityTravelToDimensionEvent(Entity entity, int dimension) { super(entity); this.dimension = dimension; } + + public int getDimension() + { + return dimension; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/entity/item/ItemEvent.java b/src/main/java/net/minecraftforge/event/entity/item/ItemEvent.java index e9667a2e98..c41a247187 100644 --- a/src/main/java/net/minecraftforge/event/entity/item/ItemEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/item/ItemEvent.java @@ -11,10 +11,7 @@ import net.minecraftforge.event.entity.EntityEvent; */ public class ItemEvent extends EntityEvent { - /** - * The relevant EntityItem for this event, already cast for you. - */ - public final EntityItem entityItem; + private final EntityItem entityItem; /** * Creates a new event for an EntityItem. @@ -26,4 +23,12 @@ public class ItemEvent extends EntityEvent super(itemEntity); this.entityItem = itemEntity; } + + /** + * The relevant EntityItem for this event, already cast for you. + */ + public EntityItem getEntityItem() + { + return entityItem; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/entity/item/ItemExpireEvent.java b/src/main/java/net/minecraftforge/event/entity/item/ItemExpireEvent.java index 01acaf4d46..8d4de1e9e9 100644 --- a/src/main/java/net/minecraftforge/event/entity/item/ItemExpireEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/item/ItemExpireEvent.java @@ -13,7 +13,7 @@ import net.minecraft.entity.item.EntityItem; public class ItemExpireEvent extends ItemEvent { - public int extraLife; + private int extraLife; /** * Creates a new event for an expiring EntityItem. @@ -24,6 +24,16 @@ public class ItemExpireEvent extends ItemEvent public ItemExpireEvent(EntityItem entityItem, int extraLife) { super(entityItem); + this.setExtraLife(extraLife); + } + + public int getExtraLife() + { + return extraLife; + } + + public void setExtraLife(int extraLife) + { this.extraLife = extraLife; } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/entity/item/ItemTossEvent.java b/src/main/java/net/minecraftforge/event/entity/item/ItemTossEvent.java index c167ce8d0b..090a7140e4 100644 --- a/src/main/java/net/minecraftforge/event/entity/item/ItemTossEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/item/ItemTossEvent.java @@ -14,10 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; public class ItemTossEvent extends ItemEvent { - /** - * The player tossing the item. - */ - public final EntityPlayer player; + private final EntityPlayer player; /** * Creates a new event for EntityItems tossed by a player. @@ -30,4 +27,12 @@ public class ItemTossEvent extends ItemEvent super(entityItem); this.player = player; } + + /** + * The player tossing the item. + */ + public EntityPlayer getPlayer() + { + return player; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/entity/living/EnderTeleportEvent.java b/src/main/java/net/minecraftforge/event/entity/living/EnderTeleportEvent.java index d03b071a44..bc9190f4c1 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/EnderTeleportEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/EnderTeleportEvent.java @@ -12,17 +12,26 @@ import net.minecraft.entity.EntityLivingBase; public class EnderTeleportEvent extends LivingEvent { - public double targetX; - public double targetY; - public double targetZ; - public float attackDamage; + private double targetX; + private double targetY; + private double targetZ; + private float attackDamage; public EnderTeleportEvent(EntityLivingBase entity, double targetX, double targetY, double targetZ, float attackDamage) { super(entity); - this.targetX = targetX; - this.targetY = targetY; - this.targetZ = targetZ; - this.attackDamage = attackDamage; + this.setTargetX(targetX); + this.setTargetY(targetY); + this.setTargetZ(targetZ); + this.setAttackDamage(attackDamage); } + + public double getTargetX() { return targetX; } + public void setTargetX(double targetX) { this.targetX = targetX; } + public double getTargetY() { return targetY; } + public void setTargetY(double targetY) { this.targetY = targetY; } + public double getTargetZ() { return targetZ; } + public void setTargetZ(double targetZ) { this.targetZ = targetZ; } + public float getAttackDamage() { return attackDamage; } + public void setAttackDamage(float attackDamage) { this.attackDamage = attackDamage; } } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java index 307434232a..3287374798 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java @@ -25,10 +25,15 @@ import net.minecraft.entity.EntityLivingBase; @Cancelable public class LivingDeathEvent extends LivingEvent { - public final DamageSource source; + private final DamageSource source; public LivingDeathEvent(EntityLivingBase entity, DamageSource source) { super(entity); this.source = source; } + + public DamageSource getSource() + { + return source; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java index 787e51192b..4f2a82a29b 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java @@ -29,10 +29,10 @@ import net.minecraft.entity.EntityLivingBase; @Cancelable public class LivingDropsEvent extends LivingEvent { - public final DamageSource source; - public final List drops; - public final int lootingLevel; - public final boolean recentlyHit; + private final DamageSource source; + private final List drops; + private final int lootingLevel; + private final boolean recentlyHit; public LivingDropsEvent(EntityLivingBase entity, DamageSource source, List drops, int lootingLevel, boolean recentlyHit) { @@ -42,4 +42,24 @@ public class LivingDropsEvent extends LivingEvent this.lootingLevel = lootingLevel; this.recentlyHit = recentlyHit; } + + public DamageSource getSource() + { + return source; + } + + public List getDrops() + { + return drops; + } + + public int getLootingLevel() + { + return lootingLevel; + } + + public boolean isRecentlyHit() + { + return recentlyHit; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingEntityUseItemEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingEntityUseItemEvent.java index 95f01ee29e..6047e79d7b 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingEntityUseItemEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingEntityUseItemEvent.java @@ -6,13 +6,28 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable; public abstract class LivingEntityUseItemEvent extends LivingEvent { - public final ItemStack item; - public int duration; + private final ItemStack item; + private int duration; private LivingEntityUseItemEvent(EntityLivingBase entity, ItemStack item, int duration) { super(entity); this.item = item; + this.setDuration(duration); + } + + public ItemStack getItem() + { + return item; + } + + public int getDuration() + { + return duration; + } + + public void setDuration(int duration) + { this.duration = duration; } @@ -84,10 +99,20 @@ public abstract class LivingEntityUseItemEvent extends LivingEvent */ public static class Finish extends LivingEntityUseItemEvent { - public ItemStack result; + private ItemStack result; public Finish(EntityLivingBase entity, ItemStack item, int duration, ItemStack result) { super(entity, item, duration); + this.setResultStack(result); + } + + public ItemStack getResultStack() + { + return result; + } + + public void setResultStack(ItemStack result) + { this.result = result; } } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingEvent.java index b0002ce22e..0f899e6392 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingEvent.java @@ -13,13 +13,18 @@ import net.minecraftforge.event.entity.EntityEvent; **/ public class LivingEvent extends EntityEvent { - public final EntityLivingBase entityLiving; + private final EntityLivingBase entityLiving; public LivingEvent(EntityLivingBase entity) { super(entity); entityLiving = entity; } - + + public EntityLivingBase getEntityLiving() + { + return entityLiving; + } + /** * LivingUpdateEvent is fired when an Entity is updated.
* This event is fired whenever an Entity is updated in diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingExperienceDropEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingExperienceDropEvent.java index 8c96c0cbc5..a65cd6fdd2 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingExperienceDropEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingExperienceDropEvent.java @@ -12,10 +12,10 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable; @Cancelable public class LivingExperienceDropEvent extends LivingEvent { - final EntityPlayer attackingPlayer; - final int originalExperiencePoints; + private final EntityPlayer attackingPlayer; + private final int originalExperiencePoints; - int droppedExperiencePoints; + private int droppedExperiencePoints; public LivingExperienceDropEvent(EntityLivingBase entity, EntityPlayer attackingPlayer, int originalExperience) { diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java index 322325292b..0cc1d0e826 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingFallEvent.java @@ -22,12 +22,17 @@ import net.minecraft.entity.EntityLivingBase; @Cancelable public class LivingFallEvent extends LivingEvent { - public float distance; - public float damageMultiplier; + private float distance; + private float damageMultiplier; public LivingFallEvent(EntityLivingBase entity, float distance, float damageMultiplier) { super(entity); - this.distance = distance; - this.damageMultiplier = damageMultiplier; + this.setDistance(distance); + this.setDamageMultiplier(damageMultiplier); } + + public float getDistance() { return distance; } + public void setDistance(float distance) { this.distance = distance; } + public float getDamageMultiplier() { return damageMultiplier; } + public void setDamageMultiplier(float damageMultiplier) { this.damageMultiplier = damageMultiplier; } } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java index 516f708b06..04be4cc15a 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingHealEvent.java @@ -21,10 +21,20 @@ import net.minecraft.entity.EntityLivingBase; @Cancelable public class LivingHealEvent extends LivingEvent { - public float amount; + private float amount; public LivingHealEvent(EntityLivingBase entity, float amount) { super(entity); + this.setAmount(amount); + } + + public float getAmount() + { + return amount; + } + + public void setAmount(float amount) + { this.amount = amount; } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingPackSizeEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingPackSizeEvent.java index cd196a87ce..b4219a6dfd 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingPackSizeEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingPackSizeEvent.java @@ -6,18 +6,28 @@ import net.minecraft.entity.EntityLiving; @HasResult public class LivingPackSizeEvent extends LivingEvent { - /** - * This event is fired when the spawning system determines the - * maximum amount of the selected entity that can spawn at the same - * time. - * - * If you set the result to 'ALLOW', it means that you want to return - * the value of maxPackSize as the maximum pack size for current entity. - */ - public int maxPackSize; + private int maxPackSize; public LivingPackSizeEvent(EntityLiving entity) { super(entity); } + + /** + * This event is fired when the spawning system determines the + * maximum amount of the selected entity that can spawn at the same + * time. + * + * If you set the result to 'ALLOW', it means that you want to return + * the value of maxPackSize as the maximum pack size for current entity. + */ + public int getMaxPackSize() + { + return maxPackSize; + } + + public void setMaxPackSize(int maxPackSize) + { + this.maxPackSize = maxPackSize; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java index ec73c406e3..ef1a29458e 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java @@ -21,11 +21,15 @@ import net.minecraft.entity.EntityLivingBase; public class LivingSetAttackTargetEvent extends LivingEvent { - public final EntityLivingBase target; + private final EntityLivingBase target; public LivingSetAttackTargetEvent(EntityLivingBase entity, EntityLivingBase target) { super(entity); this.target = target; } + public EntityLivingBase getTarget() + { + return target; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java b/src/main/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java index 2979e4341b..6a538b21b0 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java @@ -19,10 +19,10 @@ import net.minecraft.world.World; **/ public class LivingSpawnEvent extends LivingEvent { - public final World world; - public final float x; - public final float y; - public final float z; + private final World world; + private final float x; + private final float y; + private final float z; public LivingSpawnEvent(EntityLiving entity, World world, float x, float y, float z) { @@ -33,6 +33,10 @@ public class LivingSpawnEvent extends LivingEvent this.z = z; } + public World getWorld() { return world; } + public float getX() { return x; } + public float getY() { return y; } + public float getZ() { return z; } /** * Fires before mob spawn events. * diff --git a/src/main/java/net/minecraftforge/event/entity/living/ZombieEvent.java b/src/main/java/net/minecraftforge/event/entity/living/ZombieEvent.java index 07002ddd25..f5d2ec9b76 100644 --- a/src/main/java/net/minecraftforge/event/entity/living/ZombieEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/living/ZombieEvent.java @@ -1,6 +1,5 @@ package net.minecraftforge.event.entity.living; -import net.minecraftforge.fml.common.eventhandler.Event.HasResult; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.world.World; @@ -22,7 +21,7 @@ public class ZombieEvent extends EntityEvent { public EntityZombie getSummoner() { - return (EntityZombie) entity; + return (EntityZombie) getEntity(); } /** @@ -50,17 +49,14 @@ public class ZombieEvent extends EntityEvent { **/ @HasResult public static class SummonAidEvent extends ZombieEvent { - /** - * Populate this field to have a custom zombie instead of a normal zombie summoned - */ - public EntityZombie customSummonedAid; + private EntityZombie customSummonedAid; - public final World world; - public final int x; - public final int y; - public final int z; - public final EntityLivingBase attacker; - public final double summonChance; + private final World world; + private final int x; + private final int y; + private final int z; + private final EntityLivingBase attacker; + private final double summonChance; public SummonAidEvent(EntityZombie entity, World world, int x, int y, int z, EntityLivingBase attacker, double summonChance) { @@ -72,6 +68,17 @@ public class ZombieEvent extends EntityEvent { this.attacker = attacker; this.summonChance = summonChance; } - + + /** + * Populate this field to have a custom zombie instead of a normal zombie summoned + */ + public EntityZombie getCustomSummonedAid() { return customSummonedAid; } + public void setCustomSummonedAid(EntityZombie customSummonedAid) { this.customSummonedAid = customSummonedAid; } + public World getWorld() { return world; } + public int getX() { return x; } + public int getY() { return y; } + public int getZ() { return z; } + public EntityLivingBase getAttacker() { return attacker; } + public double getSummonChance() { return summonChance; } } } diff --git a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java index 76e7cbfb58..94664fe117 100644 --- a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java @@ -18,11 +18,16 @@ import net.minecraft.entity.item.EntityMinecart; **/ public class MinecartCollisionEvent extends MinecartEvent { - public final Entity collider; + private final Entity collider; public MinecartCollisionEvent(EntityMinecart minecart, Entity collider) { super(minecart); this.collider = collider; } + + public Entity getCollider() + { + return collider; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java index 7d445fcde5..0479a067cb 100644 --- a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java @@ -14,11 +14,16 @@ import net.minecraftforge.event.entity.EntityEvent; **/ public class MinecartEvent extends EntityEvent { - public final EntityMinecart minecart; + private final EntityMinecart minecart; public MinecartEvent(EntityMinecart minecart) { super(minecart); this.minecart = minecart; } + + public EntityMinecart getMinecart() + { + return minecart; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java index 7b458958c8..6ba3f4bdf2 100644 --- a/src/main/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java @@ -18,11 +18,16 @@ import net.minecraft.util.math.BlockPos; **/ public class MinecartUpdateEvent extends MinecartEvent { - public final BlockPos pos; + private final BlockPos pos; public MinecartUpdateEvent(EntityMinecart minecart, BlockPos pos) { super(minecart); this.pos = pos; } + + public BlockPos getPos() + { + return pos; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/AchievementEvent.java b/src/main/java/net/minecraftforge/event/entity/player/AchievementEvent.java index 5a8e5c15d0..7fee0f4a42 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/AchievementEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/AchievementEvent.java @@ -10,10 +10,15 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable; @Cancelable public class AchievementEvent extends PlayerEvent { - public final Achievement achievement; + private final Achievement achievement; public AchievementEvent(EntityPlayer player, Achievement achievement) { super(player); this.achievement = achievement; } + + public Achievement getAchievement() + { + return achievement; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/AnvilRepairEvent.java b/src/main/java/net/minecraftforge/event/entity/player/AnvilRepairEvent.java index c158a5b69d..360f2e5bc5 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/AnvilRepairEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/AnvilRepairEvent.java @@ -5,18 +5,11 @@ import net.minecraft.item.ItemStack; public class AnvilRepairEvent extends PlayerEvent { - /** - * Fired when the player removes a "repaired" item from the Anvil's Output slot. - * - * breakChance specifies as a percentage the chance that the anvil will be "damaged" when used. - * - * ItemStacks are the inputs/output from the anvil. They cannot be edited. - */ - - public final ItemStack left; // The left side of the input - public final ItemStack right; // The right side of the input - public final ItemStack output; // Set this to set the output stack - public float breakChance; // Anvil's chance to break (reduced by 1 durability) when this is complete. Default is 12% (0.12f) + + private final ItemStack left; // The left side of the input + private final ItemStack right; // The right side of the input + private final ItemStack output; // Set this to set the output stack + private float breakChance; // Anvil's chance to break (reduced by 1 durability) when this is complete. Default is 12% (0.12f) public AnvilRepairEvent(EntityPlayer player, ItemStack output, ItemStack left, ItemStack right) { @@ -24,6 +17,19 @@ public class AnvilRepairEvent extends PlayerEvent this.output = output; this.left = left; this.right = right; - this.breakChance = 0.12f; + this.setBreakChance(0.12f); } + + /** + * Fired when the player removes a "repaired" item from the Anvil's Output slot. + * + * breakChance specifies as a percentage the chance that the anvil will be "damaged" when used. + * + * ItemStacks are the inputs/output from the anvil. They cannot be edited. + */ + public ItemStack getLeft() { return left; } + public ItemStack getRight() { return right; } + public ItemStack getOutput() { return output; } + public float getBreakChance() { return breakChance; } + public void setBreakChance(float breakChance) { this.breakChance = breakChance; } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java b/src/main/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java index f053ed9b41..f81f10cd7d 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java @@ -21,10 +21,15 @@ import net.minecraft.entity.player.EntityPlayer; @Cancelable public class AttackEntityEvent extends PlayerEvent { - public final Entity target; + private final Entity target; public AttackEntityEvent(EntityPlayer player, Entity target) { super(player); this.target = target; } + + public Entity getTarget() + { + return target; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/BonemealEvent.java b/src/main/java/net/minecraftforge/event/entity/player/BonemealEvent.java index d95e68fd15..bdfe08ef4a 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/BonemealEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/BonemealEvent.java @@ -7,23 +7,23 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +/** + * This event is called when a player attempts to use Bonemeal on a block. + * It can be canceled to completely prevent any further processing. + * + * You can also set the result to ALLOW to mark the event as processed + * and use up a bonemeal from the stack but do no further processing. + * + * setResult(ALLOW) is the same as the old setHandled() + */ @Cancelable @Event.HasResult public class BonemealEvent extends PlayerEvent { - /** - * This event is called when a player attempts to use Bonemeal on a block. - * It can be canceled to completely prevent any further processing. - * - * You can also set the result to ALLOW to mark the event as processed - * and use up a bonemeal from the stack but do no further processing. - * - * setResult(ALLOW) is the same as the old setHandled() - */ - public final World world; - public final BlockPos pos; - public final IBlockState block; + private final World world; + private final BlockPos pos; + private final IBlockState block; public BonemealEvent(EntityPlayer player, World world, BlockPos pos, IBlockState block) { @@ -32,4 +32,19 @@ public class BonemealEvent extends PlayerEvent this.pos = pos; this.block = block; } + + public World getWorld() + { + return world; + } + + public BlockPos getPos() + { + return pos; + } + + public IBlockState getBlock() + { + return block; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/EntityItemPickupEvent.java b/src/main/java/net/minecraftforge/event/entity/player/EntityItemPickupEvent.java index b22f7d56ca..0e9ed47346 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/EntityItemPickupEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/EntityItemPickupEvent.java @@ -5,25 +5,30 @@ import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +/** + * This event is called when a player collides with a EntityItem on the ground. + * The event can be canceled, and no further processing will be done. + * + * You can set the result of this event to ALLOW which will trigger the + * processing of achievements, FML's event, play the sound, and kill the + * entity if all the items are picked up. + * + * setResult(ALLOW) is the same as the old setHandled() + */ @Cancelable @Event.HasResult public class EntityItemPickupEvent extends PlayerEvent { - /** - * This event is called when a player collides with a EntityItem on the ground. - * The event can be canceled, and no further processing will be done. - * - * You can set the result of this event to ALLOW which will trigger the - * processing of achievements, FML's event, play the sound, and kill the - * entity if all the items are picked up. - * - * setResult(ALLOW) is the same as the old setHandled() - */ - public final EntityItem item; + private final EntityItem item; public EntityItemPickupEvent(EntityPlayer player, EntityItem item) { super(player); this.item = item; } + + public EntityItem getItem() + { + return item; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/FillBucketEvent.java b/src/main/java/net/minecraftforge/event/entity/player/FillBucketEvent.java index e452d5320e..77819d7ba2 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/FillBucketEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/FillBucketEvent.java @@ -7,19 +7,19 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +/** + * This event is fired when a player attempts to use a Empty bucket, it + * can be canceled to completely prevent any further processing. + * + * If you set the result to 'ALLOW', it means that you have processed + * the event and wants the basic functionality of adding the new + * ItemStack to your inventory and reducing the stack size to process. + * setResult(ALLOW) is the same as the old setHandled(); + */ @Cancelable @Event.HasResult public class FillBucketEvent extends PlayerEvent { - /** - * This event is fired when a player attempts to use a Empty bucket, it - * can be canceled to completely prevent any further processing. - * - * If you set the result to 'ALLOW', it means that you have processed - * the event and wants the basic functionality of adding the new - * ItemStack to your inventory and reducing the stack size to process. - * setResult(ALLOW) is the same as the old setHandled(); - */ private final ItemStack current; private final World world; diff --git a/src/main/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java b/src/main/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java index 7194abad51..f9fd61ca27 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java @@ -6,18 +6,9 @@ import net.minecraft.item.ItemStack; public class ItemTooltipEvent extends PlayerEvent { - /** - * Whether the advanced information on item tooltips is being shown, toggled by F3+H. - */ - public final boolean showAdvancedItemTooltips; - /** - * The {@link ItemStack} with the tooltip. - */ - public final ItemStack itemStack; - /** - * The {@link ItemStack} tooltip. - */ - public final List toolTip; + private final boolean showAdvancedItemTooltips; + private final ItemStack itemStack; + private final List toolTip; /** * This event is fired in {@link ItemStack#getTooltip(EntityPlayer, boolean)}, which in turn is called from it's respective GUIContainer. @@ -29,4 +20,28 @@ public class ItemTooltipEvent extends PlayerEvent this.toolTip = toolTip; this.showAdvancedItemTooltips = showAdvancedItemTooltips; } + + /** + * Whether the advanced information on item tooltips is being shown, toggled by F3+H. + */ + public boolean isShowAdvancedItemTooltips() + { + return showAdvancedItemTooltips; + } + + /** + * The {@link ItemStack} with the tooltip. + */ + public ItemStack getItemStack() + { + return itemStack; + } + + /** + * The {@link ItemStack} tooltip. + */ + public List getToolTip() + { + return toolTip; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerDropsEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerDropsEvent.java index d3f5246806..9fb1a4a590 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerDropsEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerDropsEvent.java @@ -18,7 +18,7 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent; @Cancelable public class PlayerDropsEvent extends LivingDropsEvent { - public final EntityPlayer entityPlayer; + private final EntityPlayer entityPlayer; /** * Creates a new event containing all the items that will drop into the @@ -36,4 +36,9 @@ public class PlayerDropsEvent extends LivingDropsEvent this.entityPlayer = entity; } + + public EntityPlayer getEntityPlayer() + { + return entityPlayer; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java index f460b1d165..864242dd9c 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerEvent.java @@ -18,13 +18,18 @@ import net.minecraftforge.event.entity.living.LivingEvent; **/ public class PlayerEvent extends LivingEvent { - public final EntityPlayer entityPlayer; + private final EntityPlayer entityPlayer; public PlayerEvent(EntityPlayer player) { super(player); entityPlayer = player; } + public EntityPlayer getEntityPlayer() + { + return entityPlayer; + } + /** * HarvestCheck is fired when a player attempts to harvest a block.
* This event is fired whenever a player attempts to harvest a block in @@ -80,19 +85,25 @@ public class PlayerEvent extends LivingEvent @Cancelable public static class BreakSpeed extends PlayerEvent { - public final IBlockState state; - public final float originalSpeed; - public float newSpeed = 0.0f; - public final BlockPos pos; // Y position of -1 notes unknown location + private final IBlockState state; + private final float originalSpeed; + private float newSpeed = 0.0f; + private final BlockPos pos; // Y position of -1 notes unknown location public BreakSpeed(EntityPlayer player, IBlockState state, float original, BlockPos pos) { super(player); this.state = state; this.originalSpeed = original; - this.newSpeed = original; + this.setNewSpeed(original); this.pos = pos; } + + public IBlockState getState() { return state; } + public float getOriginalSpeed() { return originalSpeed; } + public float getNewSpeed() { return newSpeed; } + public void setNewSpeed(float newSpeed) { this.newSpeed = newSpeed; } + public BlockPos getPos() { return pos; } } /** @@ -113,13 +124,28 @@ public class PlayerEvent extends LivingEvent **/ public static class NameFormat extends PlayerEvent { - public final String username; - public String displayname; + private final String username; + private String displayname; public NameFormat(EntityPlayer player, String username) { super(player); this.username = username; - this.displayname = username; + this.setDisplayname(username); + } + + public String getUsername() + { + return username; + } + + public String getDisplayname() + { + return displayname; + } + + public void setDisplayname(String displayname) + { + this.displayname = displayname; } } @@ -129,15 +155,8 @@ public class PlayerEvent extends LivingEvent */ public static class Clone extends PlayerEvent { - /** - * The old EntityPlayer that this new entity is a clone of. - */ - public final EntityPlayer original; - /** - * True if this event was fired because the player died. - * False if it was fired because the entity switched dimensions. - */ - public final boolean wasDeath; + private final EntityPlayer original; + private final boolean wasDeath; public Clone(EntityPlayer _new, EntityPlayer oldPlayer, boolean wasDeath) { @@ -145,6 +164,23 @@ public class PlayerEvent extends LivingEvent this.original = oldPlayer; this.wasDeath = wasDeath; } + + /** + * The old EntityPlayer that this new entity is a clone of. + */ + public EntityPlayer getOriginal() + { + return original; + } + + /** + * True if this event was fired because the player died. + * False if it was fired because the entity switched dimensions. + */ + public boolean isWasDeath() + { + return wasDeath; + } } /** @@ -153,10 +189,7 @@ public class PlayerEvent extends LivingEvent */ public static class StartTracking extends PlayerEvent { - /** - * The Entity now being tracked. - */ - public final Entity target; + private final Entity target; public StartTracking(EntityPlayer player, Entity target) { @@ -164,6 +197,13 @@ public class PlayerEvent extends LivingEvent this.target = target; } + /** + * The Entity now being tracked. + */ + public Entity getTarget() + { + return target; + } } /** @@ -172,10 +212,7 @@ public class PlayerEvent extends LivingEvent */ public static class StopTracking extends PlayerEvent { - /** - * The Entity no longer being tracked. - */ - public final Entity target; + private final Entity target; public StopTracking(EntityPlayer player, Entity target) { @@ -183,6 +220,13 @@ public class PlayerEvent extends LivingEvent this.target = target; } + /** + * The Entity no longer being tracked. + */ + public Entity getTarget() + { + return target; + } } /** @@ -192,16 +236,8 @@ public class PlayerEvent extends LivingEvent * containing additional mod related player data. */ public static class LoadFromFile extends PlayerEvent { - /** - * The directory where player data is being stored. Use this - * to locate your mod additional file. - */ - public final File playerDirectory; - /** - * The UUID is the standard for player related file storage. - * It is broken out here for convenience for quick file generation. - */ - public final String playerUUID; + private final File playerDirectory; + private final String playerUUID; public LoadFromFile(EntityPlayer player, File originDirectory, String playerUUID) { @@ -218,7 +254,25 @@ public class PlayerEvent extends LivingEvent public File getPlayerFile(String suffix) { if ("dat".equals(suffix)) throw new IllegalArgumentException("The suffix 'dat' is reserved"); - return new File(this.playerDirectory, this.playerUUID+"."+suffix); + return new File(this.getPlayerDirectory(), this.getPlayerUUID() +"."+suffix); + } + + /** + * The directory where player data is being stored. Use this + * to locate your mod additional file. + */ + public File getPlayerDirectory() + { + return playerDirectory; + } + + /** + * The UUID is the standard for player related file storage. + * It is broken out here for convenience for quick file generation. + */ + public String getPlayerUUID() + { + return playerUUID; } } /** @@ -235,16 +289,8 @@ public class PlayerEvent extends LivingEvent * corrupt the world state. */ public static class SaveToFile extends PlayerEvent { - /** - * The directory where player data is being stored. Use this - * to locate your mod additional file. - */ - public final File playerDirectory; - /** - * The UUID is the standard for player related file storage. - * It is broken out here for convenience for quick file generation. - */ - public final String playerUUID; + private final File playerDirectory; + private final String playerUUID; public SaveToFile(EntityPlayer player, File originDirectory, String playerUUID) { @@ -261,7 +307,25 @@ public class PlayerEvent extends LivingEvent public File getPlayerFile(String suffix) { if ("dat".equals(suffix)) throw new IllegalArgumentException("The suffix 'dat' is reserved"); - return new File(this.playerDirectory, this.playerUUID+"."+suffix); + return new File(this.getPlayerDirectory(), this.getPlayerUUID() +"."+suffix); + } + + /** + * The directory where player data is being stored. Use this + * to locate your mod additional file. + */ + public File getPlayerDirectory() + { + return playerDirectory; + } + + /** + * The UUID is the standard for player related file storage. + * It is broken out here for convenience for quick file generation. + */ + public String getPlayerUUID() + { + return playerUUID; } } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java index be81de27df..1f48512897 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java @@ -42,14 +42,14 @@ public class PlayerInteractEvent extends PlayerEvent LEFT_CLICK_BLOCK } - public final Action action; - public final World world; - public final BlockPos pos; - public final EnumFacing face; // Can be null if unknown - public final Vec3d localPos; // Can be null if unknown + private final Action action; + private final World world; + private final BlockPos pos; + private final EnumFacing face; // Can be null if unknown + private final Vec3d localPos; // Can be null if unknown - public Result useBlock = DEFAULT; - public Result useItem = DEFAULT; + private Result useBlock = DEFAULT; + private Result useItem = DEFAULT; @Deprecated public PlayerInteractEvent(EntityPlayer player, Action action, BlockPos pos, EnumFacing face, World world) @@ -63,7 +63,7 @@ public class PlayerInteractEvent extends PlayerEvent this.action = action; this.pos = pos; this.face = face; - if (face == null) useBlock = DENY; + if (face == null) setUseBlock(DENY); this.world = world; this.localPos = localPos; } @@ -72,7 +72,17 @@ public class PlayerInteractEvent extends PlayerEvent public void setCanceled(boolean cancel) { super.setCanceled(cancel); - useBlock = (cancel ? DENY : useBlock == DENY ? DEFAULT : useBlock); - useItem = (cancel ? DENY : useItem == DENY ? DEFAULT : useItem); + setUseBlock((cancel ? DENY : getUseBlock() == DENY ? DEFAULT : getUseBlock())); + setUseItem((cancel ? DENY : getUseItem() == DENY ? DEFAULT : getUseItem())); } + + public Action getAction() { return action; } + public World getWorld() { return world; } + public BlockPos getPos() { return pos; } + public EnumFacing getFace() { return face; } + public Vec3d getLocalPos() { return localPos; } + public Result getUseBlock() { return useBlock; } + public void setUseBlock(Result useBlock) { this.useBlock = useBlock; } + public Result getUseItem() { return useItem; } + public void setUseItem(Result useItem) { this.useItem = useItem; } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.java index 52358ace7c..0f39360d3b 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.java @@ -4,26 +4,30 @@ import net.minecraftforge.fml.common.eventhandler.Event.HasResult; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; +/** + * This event is fired when a player attempts to view a container during + * player tick. + * + * setResult ALLOW to allow the container to stay open + * setResult DENY to force close the container (denying access) + * + * DEFAULT is vanilla behavior + * + */ @HasResult public class PlayerOpenContainerEvent extends PlayerEvent { - public final boolean canInteractWith; - - /** - * This event is fired when a player attempts to view a container during - * player tick. - * - * setResult ALLOW to allow the container to stay open - * setResult DENY to force close the container (denying access) - * - * DEFAULT is vanilla behavior - * - */ + private final boolean canInteractWith; public PlayerOpenContainerEvent(EntityPlayer player, Container openContainer) { super(player); this.canInteractWith = openContainer.canInteractWith(player); } + + public boolean isCanInteractWith() + { + return canInteractWith; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.java index fedb6c038e..44755c4cba 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.java @@ -11,11 +11,16 @@ import net.minecraft.entity.player.EntityPlayer; @Cancelable public class PlayerPickupXpEvent extends PlayerEvent { - public final EntityXPOrb orb; + private final EntityXPOrb orb; public PlayerPickupXpEvent(EntityPlayer player, EntityXPOrb orb) { super(player); this.orb = orb; } + + public EntityXPOrb getOrb() + { + return orb; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerSetSpawnEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerSetSpawnEvent.java index b2e047eac7..bca18deca6 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerSetSpawnEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerSetSpawnEvent.java @@ -7,12 +7,8 @@ import net.minecraft.util.math.BlockPos; @Cancelable public class PlayerSetSpawnEvent extends PlayerEvent { - /** - * This event is called before a player's spawn point is changed. - * The event can be canceled, and no further processing will be done. - */ - public final boolean forced; - public final BlockPos newSpawn; + private final boolean forced; + private final BlockPos newSpawn; public PlayerSetSpawnEvent(EntityPlayer player, BlockPos newSpawn, boolean forced) { super(player); @@ -20,4 +16,17 @@ public class PlayerSetSpawnEvent extends PlayerEvent this.forced = forced; } + /** + * This event is called before a player's spawn point is changed. + * The event can be canceled, and no further processing will be done. + */ + public boolean isForced() + { + return forced; + } + + public BlockPos getNewSpawn() + { + return newSpawn; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java b/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java index d41d5abeaf..29aa31a4ad 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java @@ -20,8 +20,8 @@ import net.minecraft.util.math.BlockPos; **/ public class PlayerSleepInBedEvent extends PlayerEvent { - public EnumStatus result = null; - public final BlockPos pos; + private EnumStatus result = null; + private final BlockPos pos; public PlayerSleepInBedEvent(EntityPlayer player, BlockPos pos) { @@ -29,4 +29,18 @@ public class PlayerSleepInBedEvent extends PlayerEvent this.pos = pos; } + public EnumStatus getResultStatus() + { + return result; + } + + public void setResult(EnumStatus result) + { + this.result = result; + } + + public BlockPos getPos() + { + return pos; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/SleepingLocationCheckEvent.java b/src/main/java/net/minecraftforge/event/entity/player/SleepingLocationCheckEvent.java index c7ffaecc56..148a5f2765 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/SleepingLocationCheckEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/SleepingLocationCheckEvent.java @@ -17,7 +17,7 @@ import net.minecraftforge.fml.common.eventhandler.Event.HasResult; public class SleepingLocationCheckEvent extends PlayerEvent { - public final BlockPos sleepingLocation; + private final BlockPos sleepingLocation; public SleepingLocationCheckEvent(EntityPlayer player, BlockPos sleepingLocation) { @@ -25,4 +25,8 @@ public class SleepingLocationCheckEvent extends PlayerEvent this.sleepingLocation = sleepingLocation; } + public BlockPos getSleepingLocation() + { + return sleepingLocation; + } } diff --git a/src/main/java/net/minecraftforge/event/entity/player/UseHoeEvent.java b/src/main/java/net/minecraftforge/event/entity/player/UseHoeEvent.java index c9dad848e0..55fba10aac 100644 --- a/src/main/java/net/minecraftforge/event/entity/player/UseHoeEvent.java +++ b/src/main/java/net/minecraftforge/event/entity/player/UseHoeEvent.java @@ -7,23 +7,23 @@ import net.minecraft.world.World; import net.minecraftforge.fml.common.eventhandler.Cancelable; import net.minecraftforge.fml.common.eventhandler.Event; +/** + * This event is fired when a player attempts to use a Hoe on a block, it + * can be canceled to completely prevent any further processing. + * + * You can also set the result to ALLOW to mark the event as processed + * and damage the hoe. + * + * setResult(ALLOW) is the same as the old setHandled(); + */ @Cancelable @Event.HasResult public class UseHoeEvent extends PlayerEvent { - /** - * This event is fired when a player attempts to use a Hoe on a block, it - * can be canceled to completely prevent any further processing. - * - * You can also set the result to ALLOW to mark the event as processed - * and damage the hoe. - * - * setResult(ALLOW) is the same as the old setHandled(); - */ - public final ItemStack current; - public final World world; - public final BlockPos pos; + private final ItemStack current; + private final World world; + private final BlockPos pos; public UseHoeEvent(EntityPlayer player, ItemStack current, World world, BlockPos pos) { @@ -32,4 +32,19 @@ public class UseHoeEvent extends PlayerEvent this.world = world; this.pos = pos; } + + public ItemStack getCurrent() + { + return current; + } + + public World getWorld() + { + return world; + } + + public BlockPos getPos() + { + return pos; + } } diff --git a/src/main/java/net/minecraftforge/event/terraingen/BiomeEvent.java b/src/main/java/net/minecraftforge/event/terraingen/BiomeEvent.java index 5ee2cc5973..acf68c04a5 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/BiomeEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/BiomeEvent.java @@ -1,7 +1,6 @@ package net.minecraftforge.event.terraingen; import net.minecraftforge.fml.common.eventhandler.Event; -import net.minecraftforge.fml.common.eventhandler.Event.HasResult; import net.minecraft.block.state.IBlockState; import net.minecraft.world.biome.BiomeDecorator; import net.minecraft.world.biome.BiomeGenBase; @@ -15,13 +14,18 @@ import net.minecraft.world.biome.BiomeGenBase; **/ public class BiomeEvent extends Event { - public final BiomeGenBase biome; + private final BiomeGenBase biome; public BiomeEvent(BiomeGenBase biome) { this.biome = biome; } + public BiomeGenBase getBiome() + { + return biome; + } + /** * CreateDecorator is fired when a BiomeDecorator is created.
* This event is fired whenever a BiomeDecorator is created in @@ -38,14 +42,29 @@ public class BiomeEvent extends Event **/ public static class CreateDecorator extends BiomeEvent { - public final BiomeDecorator originalBiomeDecorator; - public BiomeDecorator newBiomeDecorator; + private final BiomeDecorator originalBiomeDecorator; + private BiomeDecorator newBiomeDecorator; public CreateDecorator(BiomeGenBase biome, BiomeDecorator original) { super(biome); originalBiomeDecorator = original; - newBiomeDecorator = original; + setNewBiomeDecorator(original); + } + + public BiomeDecorator getOriginalBiomeDecorator() + { + return originalBiomeDecorator; + } + + public BiomeDecorator getNewBiomeDecorator() + { + return newBiomeDecorator; + } + + public void setNewBiomeDecorator(BiomeDecorator newBiomeDecorator) + { + this.newBiomeDecorator = newBiomeDecorator; } } @@ -58,14 +77,29 @@ public class BiomeEvent extends Event **/ public static class BiomeColor extends BiomeEvent { - public final int originalColor; - public int newColor; + private final int originalColor; + private int newColor; public BiomeColor(BiomeGenBase biome, int original) { super(biome); originalColor = original; - newColor = original; + setNewColor(original); + } + + public int getOriginalColor() + { + return originalColor; + } + + public int getNewColor() + { + return newColor; + } + + public void setNewColor(int newColor) + { + this.newColor = newColor; } } @@ -78,14 +112,29 @@ public class BiomeEvent extends Event @HasResult public static class GetVillageBlockID extends BiomeEvent { - public final IBlockState original; - public IBlockState replacement; + private final IBlockState original; + private IBlockState replacement; public GetVillageBlockID(BiomeGenBase biome, IBlockState original) { super(biome); this.original = original; } + + public IBlockState getOriginal() + { + return original; + } + + public IBlockState getReplacement() + { + return replacement; + } + + public void setReplacement(IBlockState replacement) + { + this.replacement = replacement; + } } /** diff --git a/src/main/java/net/minecraftforge/event/terraingen/ChunkGeneratorEvent.java b/src/main/java/net/minecraftforge/event/terraingen/ChunkGeneratorEvent.java index a4e13d4e1a..96551ebbec 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/ChunkGeneratorEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/ChunkGeneratorEvent.java @@ -14,7 +14,12 @@ public class ChunkGeneratorEvent extends Event this.gen = gen; } - public IChunkGenerator getGenerator() { return this.gen; } + public IChunkGenerator getGenerator() { return this.getGen(); } + + public IChunkGenerator getGen() + { + return gen; + } /** * This event is fired when a chunks blocks are replaced by a biomes top and @@ -25,10 +30,10 @@ public class ChunkGeneratorEvent extends Event @HasResult public static class ReplaceBiomeBlocks extends ChunkGeneratorEvent { - public final int x; - public final int z; - public final ChunkPrimer primer; - public final World world; // CAN BE NULL + private final int x; + private final int z; + private final ChunkPrimer primer; + private final World world; // CAN BE NULL public ReplaceBiomeBlocks(IChunkGenerator chunkProvider, int x, int z, ChunkPrimer primer, World world) { @@ -39,6 +44,10 @@ public class ChunkGeneratorEvent extends Event this.world = world; } + public int getX() { return x; } + public int getZ() { return z; } + public ChunkPrimer getPrimer() { return primer; } + public World getWorld() { return world; } } /** @@ -49,18 +58,18 @@ public class ChunkGeneratorEvent extends Event @HasResult public static class InitNoiseField extends ChunkGeneratorEvent { - public double[] noisefield; - public final int posX; - public final int posY; - public final int posZ; - public final int sizeX; - public final int sizeY; - public final int sizeZ; + private double[] noisefield; + private final int posX; + private final int posY; + private final int posZ; + private final int sizeX; + private final int sizeY; + private final int sizeZ; public InitNoiseField(IChunkGenerator chunkProvider, double[] noisefield, int posX, int posY, int posZ, int sizeX, int sizeY, int sizeZ) { super(chunkProvider); - this.noisefield = noisefield; + this.setNoisefield(noisefield); this.posX = posX; this.posY = posY; this.posZ = posZ; @@ -69,5 +78,13 @@ public class ChunkGeneratorEvent extends Event this.sizeZ = sizeZ; } + public double[] getNoisefield() { return noisefield; } + public void setNoisefield(double[] noisefield) { this.noisefield = noisefield; } + public int getPosX() { return posX; } + public int getPosY() { return posY; } + public int getPosZ() { return posZ; } + public int getSizeX() { return sizeX; } + public int getSizeY() { return sizeY; } + public int getSizeZ() { return sizeZ; } } } diff --git a/src/main/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java b/src/main/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java index f284e21e35..ff4c0c6b75 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java @@ -23,9 +23,9 @@ import net.minecraft.world.World; **/ public class DecorateBiomeEvent extends Event { - public final World world; - public final Random rand; - public final BlockPos pos; + private final World world; + private final Random rand; + private final BlockPos pos; public DecorateBiomeEvent(World world, Random rand, BlockPos pos) { @@ -34,6 +34,21 @@ public class DecorateBiomeEvent extends Event this.pos = pos; } + public World getWorld() + { + return world; + } + + public Random getRand() + { + return rand; + } + + public BlockPos getPos() + { + return pos; + } + /** * This event is fired before a chunk is decorated with a biome feature. */ @@ -64,11 +79,16 @@ public class DecorateBiomeEvent extends Event @HasResult public static class Decorate extends DecorateBiomeEvent { + public EventType getType() + { + return type; + } + /** Use CUSTOM to filter custom event types */ public static enum EventType { BIG_SHROOM, CACTUS, CLAY, DEAD_BUSH, LILYPAD, FLOWERS, GRASS, LAKE_WATER, LAKE_LAVA, PUMPKIN, REED, SAND, SAND_PASS2, SHROOM, TREE, CUSTOM } - public final EventType type; + private final EventType type; public Decorate(World world, Random rand, BlockPos pos, EventType type) { diff --git a/src/main/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java b/src/main/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java index 05c43e4b6a..d41dde420a 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java +++ b/src/main/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java @@ -41,6 +41,6 @@ public class DeferredBiomeDecorator extends BiomeDecorator { BiomeEvent.CreateDecorator event = new BiomeEvent.CreateDecorator(biome, wrapped); MinecraftForge.TERRAIN_GEN_BUS.post(event); - biome.theBiomeDecorator = event.newBiomeDecorator; + biome.theBiomeDecorator = event.getNewBiomeDecorator(); } } diff --git a/src/main/java/net/minecraftforge/event/terraingen/InitMapGenEvent.java b/src/main/java/net/minecraftforge/event/terraingen/InitMapGenEvent.java index 914ffe208e..9113db4059 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/InitMapGenEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/InitMapGenEvent.java @@ -9,14 +9,18 @@ public class InitMapGenEvent extends Event */ public static enum EventType { CAVE, MINESHAFT, NETHER_BRIDGE, NETHER_CAVE, RAVINE, SCATTERED_FEATURE, STRONGHOLD, VILLAGE, OCEAN_MONUMENT, CUSTOM } - public final EventType type; - public final MapGenBase originalGen; - public MapGenBase newGen; + private final EventType type; + private final MapGenBase originalGen; + private MapGenBase newGen; InitMapGenEvent(EventType type, MapGenBase original) { this.type = type; this.originalGen = original; - this.newGen = original; + this.setNewGen(original); } + public EventType getType() { return type; } + public MapGenBase getOriginalGen() { return originalGen; } + public MapGenBase getNewGen() { return newGen; } + public void setNewGen(MapGenBase newGen) { this.newGen = newGen; } } diff --git a/src/main/java/net/minecraftforge/event/terraingen/OreGenEvent.java b/src/main/java/net/minecraftforge/event/terraingen/OreGenEvent.java index 32b6d5c4c7..0977129f14 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/OreGenEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/OreGenEvent.java @@ -20,9 +20,9 @@ import net.minecraft.world.gen.feature.WorldGenerator; **/ public class OreGenEvent extends Event { - public final World world; - public final Random rand; - public final BlockPos pos; + private final World world; + private final Random rand; + private final BlockPos pos; public OreGenEvent(World world, Random rand, BlockPos pos) { @@ -31,6 +31,21 @@ public class OreGenEvent extends Event this.pos = pos; } + public World getWorld() + { + return world; + } + + public Random getRand() + { + return rand; + } + + public BlockPos getPos() + { + return pos; + } + /** * OreGenEvent.Pre is fired just before a chunk is populated with ores.
* This event is fired just before ore generation in @@ -89,8 +104,8 @@ public class OreGenEvent extends Event { public static enum EventType { COAL, DIAMOND, DIRT, GOLD, GRAVEL, IRON, LAPIS, REDSTONE, QUARTZ, DIORITE, GRANITE, ANDESITE, EMERALD, SILVERFISH, CUSTOM } - public final EventType type; - public final WorldGenerator generator; + private final EventType type; + private final WorldGenerator generator; public GenerateMinable(World world, Random rand, WorldGenerator generator, BlockPos pos, EventType type) { @@ -98,5 +113,15 @@ public class OreGenEvent extends Event this.generator = generator; this.type = type; } + + public EventType getType() + { + return type; + } + + public WorldGenerator getGenerator() + { + return generator; + } } } diff --git a/src/main/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java b/src/main/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java index dda1712641..08ece413bf 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java @@ -23,11 +23,11 @@ import net.minecraftforge.fml.common.eventhandler.Event; **/ public class PopulateChunkEvent extends ChunkGeneratorEvent { - public final World world; - public final Random rand; - public final int chunkX; - public final int chunkZ; - public final boolean hasVillageGenerated; + private final World world; + private final Random rand; + private final int chunkX; + private final int chunkZ; + private final boolean hasVillageGenerated; public PopulateChunkEvent(IChunkGenerator gen, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) { @@ -39,6 +39,11 @@ public class PopulateChunkEvent extends ChunkGeneratorEvent this.hasVillageGenerated = hasVillageGenerated; } + public World getWorld() { return world; } + public Random getRand() { return rand; } + public int getChunkX() { return chunkX; } + public int getChunkZ() { return chunkZ; } + public boolean isHasVillageGenerated() { return hasVillageGenerated; } /** * PopulateChunkEvent.Pre is fired just before a chunk is populated a terrain feature.
* This event is fired just before terrain feature generation in @@ -100,11 +105,16 @@ public class PopulateChunkEvent extends ChunkGeneratorEvent @HasResult public static class Populate extends PopulateChunkEvent { + public EventType getType() + { + return type; + } + /** Use CUSTOM to filter custom event types */ public static enum EventType { DUNGEON, FIRE, GLOWSTONE, ICE, LAKE, LAVA, NETHER_LAVA, NETHER_LAVA2, ANIMALS, CUSTOM } - public final EventType type; + private final EventType type; public Populate(IChunkGenerator gen, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated, EventType type) { diff --git a/src/main/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java b/src/main/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java index af7b458d6b..e12002b250 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java @@ -24,8 +24,8 @@ import net.minecraftforge.event.world.WorldEvent; @HasResult public class SaplingGrowTreeEvent extends WorldEvent { - public final BlockPos pos; - public final Random rand; + private final BlockPos pos; + private final Random rand; public SaplingGrowTreeEvent(World world, Random rand, BlockPos pos) { @@ -33,4 +33,14 @@ public class SaplingGrowTreeEvent extends WorldEvent this.rand = rand; this.pos = pos; } + + public BlockPos getPos() + { + return pos; + } + + public Random getRand() + { + return rand; + } } diff --git a/src/main/java/net/minecraftforge/event/terraingen/TerrainGen.java b/src/main/java/net/minecraftforge/event/terraingen/TerrainGen.java index cbec1f7841..c6f4aa2d4a 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/TerrainGen.java +++ b/src/main/java/net/minecraftforge/event/terraingen/TerrainGen.java @@ -26,7 +26,7 @@ public abstract class TerrainGen { InitMapGenEvent event = new InitMapGenEvent(type, original); MinecraftForge.TERRAIN_GEN_BUS.post(event); - return event.newGen; + return event.getNewGen(); } public static boolean populate(IChunkGenerator chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated, Populate.EventType type) diff --git a/src/main/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java b/src/main/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java index 463f644cb6..cb3f21daca 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java +++ b/src/main/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java @@ -15,13 +15,18 @@ import net.minecraft.world.WorldType; **/ public class WorldTypeEvent extends Event { - public final WorldType worldType; + private final WorldType worldType; public WorldTypeEvent(WorldType worldType) { this.worldType = worldType; } + public WorldType getWorldType() + { + return worldType; + } + /** * BiomeSize is fired when vanilla Minecraft attempts to generate biomes.
* This event is fired during biome generation in @@ -39,14 +44,29 @@ public class WorldTypeEvent extends Event **/ public static class BiomeSize extends WorldTypeEvent { - public final int originalSize; - public int newSize; + private final int originalSize; + private int newSize; public BiomeSize(WorldType worldType, int original) { super(worldType); originalSize = original; - newSize = original; + setNewSize(original); + } + + public int getOriginalSize() + { + return originalSize; + } + + public int getNewSize() + { + return newSize; + } + + public void setNewSize(int newSize) + { + this.newSize = newSize; } } @@ -68,16 +88,36 @@ public class WorldTypeEvent extends Event **/ public static class InitBiomeGens extends WorldTypeEvent { - public final long seed; - public final GenLayer[] originalBiomeGens; - public GenLayer[] newBiomeGens; + private final long seed; + private final GenLayer[] originalBiomeGens; + private GenLayer[] newBiomeGens; public InitBiomeGens(WorldType worldType, long seed, GenLayer[] original) { super(worldType); this.seed = seed; originalBiomeGens = original; - newBiomeGens = original.clone(); + setNewBiomeGens(original.clone()); + } + + public long getSeed() + { + return seed; + } + + public GenLayer[] getOriginalBiomeGens() + { + return originalBiomeGens; + } + + public GenLayer[] getNewBiomeGens() + { + return newBiomeGens; + } + + public void setNewBiomeGens(GenLayer[] newBiomeGens) + { + this.newBiomeGens = newBiomeGens; } } } diff --git a/src/main/java/net/minecraftforge/event/world/BlockEvent.java b/src/main/java/net/minecraftforge/event/world/BlockEvent.java index ed37229e80..47d620bd86 100644 --- a/src/main/java/net/minecraftforge/event/world/BlockEvent.java +++ b/src/main/java/net/minecraftforge/event/world/BlockEvent.java @@ -22,9 +22,9 @@ public class BlockEvent extends Event { private static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("forge.debugBlockEvent", "false")); - public final World world; - public final BlockPos pos; - public final IBlockState state; + private final World world; + private final BlockPos pos; + private final IBlockState state; public BlockEvent(World world, BlockPos pos, IBlockState state) { this.pos = pos; @@ -32,6 +32,21 @@ public class BlockEvent extends Event this.state = state; } + public World getWorld() + { + return world; + } + + public BlockPos getPos() + { + return pos; + } + + public IBlockState getState() + { + return state; + } + /** * Fired when a block is about to drop it's harvested items. The {@link #drops} array can be amended, as can the {@link #dropChance}. * Note well: the {@link #harvester} player field is null in a variety of scenarios. Code expecting null. @@ -45,21 +60,28 @@ public class BlockEvent extends Event */ public static class HarvestDropsEvent extends BlockEvent { - public final int fortuneLevel; - public final List drops; - public final boolean isSilkTouching; - public float dropChance; // Change to e.g. 1.0f, if you manipulate the list and want to guarantee it always drops - public final EntityPlayer harvester; // May be null for non-player harvesting such as explosions or machines + private final int fortuneLevel; + private final List drops; + private final boolean isSilkTouching; + private float dropChance; // Change to e.g. 1.0f, if you manipulate the list and want to guarantee it always drops + private final EntityPlayer harvester; // May be null for non-player harvesting such as explosions or machines public HarvestDropsEvent(World world, BlockPos pos, IBlockState state, int fortuneLevel, float dropChance, List drops, EntityPlayer harvester, boolean isSilkTouching) { super(world, pos, state); this.fortuneLevel = fortuneLevel; - this.dropChance = dropChance; + this.setDropChance(dropChance); this.drops = drops; this.isSilkTouching = isSilkTouching; this.harvester = harvester; } + + public int getFortuneLevel() { return fortuneLevel; } + public List getDrops() { return drops; } + public boolean isSilkTouching() { return isSilkTouching; } + public float getDropChance() { return dropChance; } + public void setDropChance(float dropChance) { this.dropChance = dropChance; } + public EntityPlayer getHarvester() { return harvester; } } /** @@ -124,11 +146,11 @@ public class BlockEvent extends Event @Cancelable public static class PlaceEvent extends BlockEvent { - public final EntityPlayer player; - public final ItemStack itemInHand; - public final BlockSnapshot blockSnapshot; - public final IBlockState placedBlock; - public final IBlockState placedAgainst; + private final EntityPlayer player; + private final ItemStack itemInHand; + private final BlockSnapshot blockSnapshot; + private final IBlockState placedBlock; + private final IBlockState placedAgainst; public PlaceEvent(BlockSnapshot blockSnapshot, IBlockState placedAgainst, EntityPlayer player) { @@ -140,9 +162,15 @@ public class BlockEvent extends Event this.placedAgainst = placedAgainst; if (DEBUG) { - System.out.printf("Created PlaceEvent - [PlacedBlock: %s ][PlacedAgainst: %s ][ItemStack: %s ][Player: %s ]\n", placedBlock, placedAgainst, itemInHand, player); + System.out.printf("Created PlaceEvent - [PlacedBlock: %s ][PlacedAgainst: %s ][ItemStack: %s ][Player: %s ]\n", getPlacedBlock(), placedAgainst, getItemInHand(), player); } } + + public EntityPlayer getPlayer() { return player; } + public ItemStack getItemInHand() { return itemInHand; } + public BlockSnapshot getBlockSnapshot() { return blockSnapshot; } + public IBlockState getPlacedBlock() { return placedBlock; } + public IBlockState getPlacedAgainst() { return placedAgainst; } } /** @@ -163,7 +191,7 @@ public class BlockEvent extends Event this.blockSnapshots = ImmutableList.copyOf(blockSnapshots); if (DEBUG) { - System.out.printf("Created MultiPlaceEvent - [PlacedAgainst: %s ][ItemInHand: %s ][Player: %s ]\n", placedAgainst, this.itemInHand, player); + System.out.printf("Created MultiPlaceEvent - [PlacedAgainst: %s ][ItemInHand: %s ][Player: %s ]\n", placedAgainst, this.getItemInHand(), player); } } diff --git a/src/main/java/net/minecraftforge/event/world/ChunkWatchEvent.java b/src/main/java/net/minecraftforge/event/world/ChunkWatchEvent.java index e94c57cc32..bc33653b06 100644 --- a/src/main/java/net/minecraftforge/event/world/ChunkWatchEvent.java +++ b/src/main/java/net/minecraftforge/event/world/ChunkWatchEvent.java @@ -16,15 +16,25 @@ import net.minecraft.entity.player.EntityPlayerMP; **/ public class ChunkWatchEvent extends Event { - public final ChunkCoordIntPair chunk; - public final EntityPlayerMP player; + private final ChunkCoordIntPair chunk; + private final EntityPlayerMP player; public ChunkWatchEvent(ChunkCoordIntPair chunk, EntityPlayerMP player) { this.chunk = chunk; this.player = player; } - + + public ChunkCoordIntPair getChunk() + { + return chunk; + } + + public EntityPlayerMP getPlayer() + { + return player; + } + /** * ChunkWatchEvent.Watch is fired when an EntityPlayer begins watching a chunk.
* This event is fired when a chunk is added to the watched chunks of an EntityPlayer in diff --git a/src/main/java/net/minecraftforge/event/world/ExplosionEvent.java b/src/main/java/net/minecraftforge/event/world/ExplosionEvent.java index 03751b0124..5a93fdb3d9 100644 --- a/src/main/java/net/minecraftforge/event/world/ExplosionEvent.java +++ b/src/main/java/net/minecraftforge/event/world/ExplosionEvent.java @@ -21,8 +21,8 @@ import net.minecraft.world.World; */ public class ExplosionEvent extends Event { - public final World world; - public final Explosion explosion; + private final World world; + private final Explosion explosion; public ExplosionEvent(World world, Explosion explosion) { @@ -30,6 +30,16 @@ public class ExplosionEvent extends Event this.explosion = explosion; } + public World getWorld() + { + return world; + } + + public Explosion getExplosion() + { + return explosion; + } + /** ExplosionEvent.Start is fired before the explosion actually occurs. Canceling this event will stop the explosion.
*
* This event is {@link Cancelable}.
@@ -64,7 +74,7 @@ public class ExplosionEvent extends Event /** return the list of blocks affected by the explosion. */ public List getAffectedBlocks() { - return explosion.getAffectedBlockPositions(); + return getExplosion().getAffectedBlockPositions(); } /** return the list of entities affected by the explosion. */ diff --git a/src/main/java/net/minecraftforge/event/world/NoteBlockEvent.java b/src/main/java/net/minecraftforge/event/world/NoteBlockEvent.java index 58ef7c0e61..6ed656285f 100644 --- a/src/main/java/net/minecraftforge/event/world/NoteBlockEvent.java +++ b/src/main/java/net/minecraftforge/event/world/NoteBlockEvent.java @@ -67,12 +67,22 @@ public class NoteBlockEvent extends BlockEvent @Cancelable public static class Play extends NoteBlockEvent { - public Instrument instrument; + private Instrument instrument; public Play(World world, BlockPos pos, IBlockState state, int note, int instrument) { super(world, pos, state, note); - this.instrument = Instrument.fromId(instrument); + this.setInstrument(Instrument.fromId(instrument)); + } + + public Instrument getInstrument() + { + return instrument; + } + + public void setInstrument(Instrument instrument) + { + this.instrument = instrument; } } @@ -83,8 +93,8 @@ public class NoteBlockEvent extends BlockEvent @Cancelable public static class Change extends NoteBlockEvent { - public final Note oldNote; - public final Octave oldOctave; + private final Note oldNote; + private final Octave oldOctave; public Change(World world, BlockPos pos, IBlockState state, int oldNote, int newNote) { @@ -92,6 +102,16 @@ public class NoteBlockEvent extends BlockEvent this.oldNote = Note.fromId(oldNote); this.oldOctave = Octave.fromId(oldNote); } + + public Note getOldNote() + { + return oldNote; + } + + public Octave getOldOctave() + { + return oldOctave; + } } /** diff --git a/src/main/java/net/minecraftforge/event/world/WorldEvent.java b/src/main/java/net/minecraftforge/event/world/WorldEvent.java index 72f94ade91..d54bd3b77b 100644 --- a/src/main/java/net/minecraftforge/event/world/WorldEvent.java +++ b/src/main/java/net/minecraftforge/event/world/WorldEvent.java @@ -22,13 +22,18 @@ import net.minecraftforge.fml.common.eventhandler.Event; **/ public class WorldEvent extends Event { - public final World world; + private final World world; public WorldEvent(World world) { this.world = world; } + public World getWorld() + { + return world; + } + /** * WorldEvent.Load is fired when Minecraft loads a world.
* This event is fired when a world is loaded in @@ -96,9 +101,9 @@ public class WorldEvent extends Event @Cancelable public static class PotentialSpawns extends WorldEvent { - public final EnumCreatureType type; - public final BlockPos pos; - public final List list; + private final EnumCreatureType type; + private final BlockPos pos; + private final List list; public PotentialSpawns(World world, EnumCreatureType type, BlockPos pos, List oldList) { @@ -114,6 +119,21 @@ public class WorldEvent extends Event this.list = new ArrayList(); } } + + public EnumCreatureType getType() + { + return type; + } + + public BlockPos getPos() + { + return pos; + } + + public List getList() + { + return list; + } } /** @@ -123,11 +143,16 @@ public class WorldEvent extends Event @Cancelable public static class CreateSpawnPosition extends WorldEvent { - public final WorldSettings settings; + private final WorldSettings settings; public CreateSpawnPosition(World world, WorldSettings settings) { super(world); this.settings = settings; } + + public WorldSettings getSettings() + { + return settings; + } } } diff --git a/src/main/java/net/minecraftforge/fluids/FluidContainerRegistry.java b/src/main/java/net/minecraftforge/fluids/FluidContainerRegistry.java index 5810582726..0b2c3d49cf 100644 --- a/src/main/java/net/minecraftforge/fluids/FluidContainerRegistry.java +++ b/src/main/java/net/minecraftforge/fluids/FluidContainerRegistry.java @@ -389,11 +389,16 @@ public abstract class FluidContainerRegistry public static class FluidContainerRegisterEvent extends Event { - public final FluidContainerData data; + private final FluidContainerData data; public FluidContainerRegisterEvent(FluidContainerData data) { this.data = data.copy(); } + + public FluidContainerData getData() + { + return data; + } } } diff --git a/src/main/java/net/minecraftforge/fluids/FluidRegistry.java b/src/main/java/net/minecraftforge/fluids/FluidRegistry.java index ba32b29e34..b2a752f06b 100644 --- a/src/main/java/net/minecraftforge/fluids/FluidRegistry.java +++ b/src/main/java/net/minecraftforge/fluids/FluidRegistry.java @@ -319,14 +319,24 @@ public abstract class FluidRegistry public static class FluidRegisterEvent extends Event { - public final String fluidName; - public final int fluidID; + private final String fluidName; + private final int fluidID; public FluidRegisterEvent(String fluidName, int fluidID) { this.fluidName = fluidName; this.fluidID = fluidID; } + + public String getFluidName() + { + return fluidName; + } + + public int getFluidID() + { + return fluidID; + } } public static int getMaxID() diff --git a/src/main/java/net/minecraftforge/fml/common/network/FMLEventChannel.java b/src/main/java/net/minecraftforge/fml/common/network/FMLEventChannel.java index 4b424dccb7..615185ccdf 100644 --- a/src/main/java/net/minecraftforge/fml/common/network/FMLEventChannel.java +++ b/src/main/java/net/minecraftforge/fml/common/network/FMLEventChannel.java @@ -103,10 +103,10 @@ public class FMLEventChannel { if (event != null) { this.eventBus.post(event); - if (event.reply != null) + if (event.getReply() != null) { ctx.channel().attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.REPLY); - ctx.writeAndFlush(event.reply).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + ctx.writeAndFlush(event.getReply()).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); } } } diff --git a/src/main/java/net/minecraftforge/fml/common/network/FMLNetworkEvent.java b/src/main/java/net/minecraftforge/fml/common/network/FMLNetworkEvent.java index a6e9129ec4..141462441d 100644 --- a/src/main/java/net/minecraftforge/fml/common/network/FMLNetworkEvent.java +++ b/src/main/java/net/minecraftforge/fml/common/network/FMLNetworkEvent.java @@ -13,8 +13,8 @@ import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; import net.minecraftforge.fml.relauncher.Side; public class FMLNetworkEvent extends Event { - public final T handler; - public final NetworkManager manager; + private final T handler; + private final NetworkManager manager; private final Class type; FMLNetworkEvent(T thing, Class type, NetworkManager manager) @@ -25,22 +25,47 @@ public class FMLNetworkEvent extends Event { } public Class getHandlerType() + { + return getType(); + } + + public T getHandler() + { + return handler; + } + + public NetworkManager getManager() + { + return manager; + } + + public Class getType() { return type; } - + /** * Fired at the client when a client connects to a server */ public static class ClientConnectedToServerEvent extends FMLNetworkEvent { - public final boolean isLocal; - public final String connectionType; + private final boolean isLocal; + private final String connectionType; public ClientConnectedToServerEvent(NetworkManager manager, String connectionType) { super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager); this.isLocal = manager.isLocalChannel(); this.connectionType = connectionType; } + + public boolean isLocal() + { + return isLocal; + } + + public String getConnectionType() + { + return connectionType; + } } /** @@ -50,12 +75,17 @@ public class FMLNetworkEvent extends Event { * */ public static class ServerConnectionFromClientEvent extends FMLNetworkEvent { - public final boolean isLocal; + private final boolean isLocal; public ServerConnectionFromClientEvent(NetworkManager manager) { super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager); this.isLocal = manager.isLocalChannel(); } + + public boolean isLocal() + { + return isLocal; + } } /** * Fired at the server when a client disconnects. @@ -90,9 +120,9 @@ public class FMLNetworkEvent extends Event { * @param The side */ public static class CustomPacketRegistrationEvent extends FMLNetworkEvent { - public final ImmutableSet registrations; - public final String operation; - public final Side side; + private final ImmutableSet registrations; + private final String operation; + private final Side side; public CustomPacketRegistrationEvent(NetworkManager manager, Set registrations, String operation, Side side, Class type) { super(type.cast(manager.getNetHandler()), type, manager); @@ -100,18 +130,27 @@ public class FMLNetworkEvent extends Event { this.side = side; this.operation = operation; } + + public ImmutableSet getRegistrations() + { + return registrations; + } + + public String getOperation() + { + return operation; + } + + public Side getSide() + { + return side; + } } public static abstract class CustomPacketEvent extends FMLNetworkEvent { - /** - * The packet that generated the event - */ - public final FMLProxyPacket packet; + private final FMLProxyPacket packet; - /** - * Set this packet to reply to the originator - */ - public FMLProxyPacket reply; + private FMLProxyPacket reply; CustomPacketEvent(S thing, Class type, NetworkManager manager, FMLProxyPacket packet) { super(thing, type, manager); @@ -119,6 +158,27 @@ public class FMLNetworkEvent extends Event { } public abstract Side side(); + + /** + * The packet that generated the event + */ + public FMLProxyPacket getPacket() + { + return packet; + } + + /** + * Set this packet to reply to the originator + */ + public FMLProxyPacket getReply() + { + return reply; + } + + public void setReply(FMLProxyPacket reply) + { + this.reply = reply; + } } /** @@ -164,10 +224,15 @@ public class FMLNetworkEvent extends Event { * */ public static class CustomNetworkEvent extends Event { - public final Object wrappedEvent; + private final Object wrappedEvent; public CustomNetworkEvent(Object wrappedEvent) { this.wrappedEvent = wrappedEvent; } + + public Object getWrappedEvent() + { + return wrappedEvent; + } } } diff --git a/src/main/java/net/minecraftforge/oredict/OreDictionary.java b/src/main/java/net/minecraftforge/oredict/OreDictionary.java index f5bb9af470..806e382173 100644 --- a/src/main/java/net/minecraftforge/oredict/OreDictionary.java +++ b/src/main/java/net/minecraftforge/oredict/OreDictionary.java @@ -524,14 +524,24 @@ public class OreDictionary public static class OreRegisterEvent extends Event { - public final String Name; - public final ItemStack Ore; + private final String Name; + private final ItemStack Ore; public OreRegisterEvent(String name, ItemStack ore) { this.Name = name; this.Ore = ore; } + + public String getName() + { + return Name; + } + + public ItemStack getOre() + { + return Ore; + } } public static void rebakeMap() diff --git a/src/test/java/net/minecraftforge/test/EntityTravelToDimensionEventTest.java b/src/test/java/net/minecraftforge/test/EntityTravelToDimensionEventTest.java index a95b22dd1f..5b1380b42f 100644 --- a/src/test/java/net/minecraftforge/test/EntityTravelToDimensionEventTest.java +++ b/src/test/java/net/minecraftforge/test/EntityTravelToDimensionEventTest.java @@ -22,7 +22,7 @@ public class EntityTravelToDimensionEventTest public void onDimensionTravel(EntityTravelToDimensionEvent event) { if(ENABLE) { - System.out.println("Travelling to Dimension " + event.dimension); + System.out.println("Travelling to Dimension " + event.getDimension()); event.setCanceled(true); } } diff --git a/src/test/java/net/minecraftforge/test/NeighborNotifyEventTest.java b/src/test/java/net/minecraftforge/test/NeighborNotifyEventTest.java index 9be69bf6a0..af23523fbc 100644 --- a/src/test/java/net/minecraftforge/test/NeighborNotifyEventTest.java +++ b/src/test/java/net/minecraftforge/test/NeighborNotifyEventTest.java @@ -23,7 +23,7 @@ public class NeighborNotifyEventTest public void onNeighborNotify(NeighborNotifyEvent event) { if(ENABLE) { - System.out.println(event.pos.toString()); + System.out.println(event.getPos().toString()); event.setCanceled(true); } } diff --git a/src/test/java/net/minecraftforge/test/NoBedSleepingTest.java b/src/test/java/net/minecraftforge/test/NoBedSleepingTest.java index f50bf57f8d..b4f728a440 100644 --- a/src/test/java/net/minecraftforge/test/NoBedSleepingTest.java +++ b/src/test/java/net/minecraftforge/test/NoBedSleepingTest.java @@ -104,7 +104,7 @@ public class NoBedSleepingTest @SubscribeEvent public void onBedCheck(SleepingLocationCheckEvent evt) { - final IExtraSleeping sleep = evt.entityPlayer.getCapability(SLEEP_CAP, null); + final IExtraSleeping sleep = evt.getEntityPlayer().getCapability(SLEEP_CAP, null); if (sleep != null && sleep.isSleeping()) evt.setResult(Result.ALLOW); } @@ -112,7 +112,7 @@ public class NoBedSleepingTest @SubscribeEvent public void onWakeUp(PlayerWakeUpEvent evt) { - final IExtraSleeping sleep = evt.entityPlayer.getCapability(SLEEP_CAP, null); + final IExtraSleeping sleep = evt.getEntityPlayer().getCapability(SLEEP_CAP, null); if (sleep != null) sleep.setSleeping(false); } diff --git a/src/test/java/net/minecraftforge/test/PlayerInteractEventLocalTest.java b/src/test/java/net/minecraftforge/test/PlayerInteractEventLocalTest.java index 9e8d1031f7..16da5af0b1 100644 --- a/src/test/java/net/minecraftforge/test/PlayerInteractEventLocalTest.java +++ b/src/test/java/net/minecraftforge/test/PlayerInteractEventLocalTest.java @@ -22,8 +22,8 @@ public class PlayerInteractEventLocalTest @SubscribeEvent public void onPlayerInteract(PlayerInteractEvent event) { - if(ENABLE && event.localPos != null) { - System.out.println(event.localPos.toString()); + if(ENABLE && event.getLocalPos() != null) { + System.out.println(event.getLocalPos().toString()); } } } diff --git a/src/test/java/net/minecraftforge/test/PlayerSetSpawnTest.java b/src/test/java/net/minecraftforge/test/PlayerSetSpawnTest.java index 78875dbcee..65b9b41c17 100644 --- a/src/test/java/net/minecraftforge/test/PlayerSetSpawnTest.java +++ b/src/test/java/net/minecraftforge/test/PlayerSetSpawnTest.java @@ -19,7 +19,7 @@ public class PlayerSetSpawnTest { @SubscribeEvent public void onPlayerSetSpawn(PlayerSetSpawnEvent event) { - System.out.println(event.forced + " " + event.newSpawn.toString()); + System.out.println(event.isForced() + " " + event.getNewSpawn().toString()); event.setCanceled(true); } } diff --git a/src/test/java/net/minecraftforge/test/TestCapabilityMod.java b/src/test/java/net/minecraftforge/test/TestCapabilityMod.java index 8705900479..d6babd4b35 100644 --- a/src/test/java/net/minecraftforge/test/TestCapabilityMod.java +++ b/src/test/java/net/minecraftforge/test/TestCapabilityMod.java @@ -44,21 +44,21 @@ public class TestCapabilityMod @SubscribeEvent public void onInteract(PlayerInteractEvent event) { - if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return; - if (event.entityPlayer.inventory.getCurrentItem() == null) return; - if (event.entityPlayer.inventory.getCurrentItem().getItem() != Items.stick) return; + if (event.getAction() != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return; + if (event.getEntityPlayer().inventory.getCurrentItem() == null) return; + if (event.getEntityPlayer().inventory.getCurrentItem().getItem() != Items.stick) return; // This is just a example of how to interact with the TE, note the strong type binding that getCapability has - TileEntity te = event.world.getTileEntity(event.pos); - if (te != null && te.hasCapability(TEST_CAP, event.face)) + TileEntity te = event.getWorld().getTileEntity(event.getPos()); + if (te != null && te.hasCapability(TEST_CAP, event.getFace())) { event.setCanceled(true); - IExampleCapability inv = te.getCapability(TEST_CAP, event.face); + IExampleCapability inv = te.getCapability(TEST_CAP, event.getFace()); System.out.println("Hi I'm a " + inv.getOwnerType()); } - if (event.world.getBlockState(event.pos).getBlock() == Blocks.dirt) + if (event.getWorld().getBlockState(event.getPos()).getBlock() == Blocks.dirt) { - event.entityPlayer.addChatMessage(new TextComponentString(TextFormatting.RED + "" + TextFormatting.ITALIC + "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST")); + event.getEntityPlayer().addChatMessage(new TextComponentString(TextFormatting.RED + "" + TextFormatting.ITALIC + "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST")); event.setCanceled(true); } }