mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Removed RenderWorldEvent, encapsulated all public event fields.
This commit is contained in:
1 parent
08c00662a0
commit
756c58d5cb
110 files changed
+1642
-680
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<ModelResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new ModelBakeEvent(modelManager, modelRegistry, modelLoader));
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<GuiButton> buttonList;
|
||||
private List<GuiButton> buttonList;
|
||||
|
||||
public InitGuiEvent(GuiScreen gui, List<GuiButton> buttonList)
|
||||
{
|
||||
super(gui);
|
||||
this.setButtonList(buttonList);
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@code buttonList} field from the GuiScreen object referenced by {@code gui}.
|
||||
*/
|
||||
public List<GuiButton> getButtonList()
|
||||
{
|
||||
return buttonList;
|
||||
}
|
||||
|
||||
public void setButtonList(List<GuiButton> 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<GuiButton> buttonList;
|
||||
private GuiButton button;
|
||||
private List<GuiButton> buttonList;
|
||||
|
||||
public ActionPerformedEvent(GuiScreen gui, GuiButton button, List<GuiButton> buttonList)
|
||||
{
|
||||
super(gui);
|
||||
this.button = button;
|
||||
this.buttonList = new ArrayList<GuiButton>(buttonList);
|
||||
this.setButton(button);
|
||||
this.setButtonList(new ArrayList<GuiButton>(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<GuiButton> getButtonList()
|
||||
{
|
||||
return buttonList;
|
||||
}
|
||||
|
||||
public void setButtonList(List<GuiButton> 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()}.
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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<String> left;
|
||||
public final ArrayList<String> right;
|
||||
private final ArrayList<String> left;
|
||||
private final ArrayList<String> right;
|
||||
public Text(RenderGameOverlayEvent parent, ArrayList<String> left, ArrayList<String> right)
|
||||
{
|
||||
super(parent, ElementType.TEXT);
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
public ArrayList<String> getLeft()
|
||||
{
|
||||
return left;
|
||||
}
|
||||
|
||||
public ArrayList<String> 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
|
||||
public abstract class RenderLivingEvent<T extends EntityLivingBase> extends Event
|
||||
{
|
||||
public final EntityLivingBase entity;
|
||||
public final RenderLivingBase<T> renderer;
|
||||
public final double x;
|
||||
public final double y;
|
||||
public final double z;
|
||||
private final EntityLivingBase entity;
|
||||
private final RenderLivingBase<T> renderer;
|
||||
private final double x;
|
||||
private final double y;
|
||||
private final double z;
|
||||
|
||||
public RenderLivingEvent(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z)
|
||||
{
|
||||
@@ -21,7 +21,13 @@ public abstract class RenderLivingEvent<T extends EntityLivingBase> extends Even
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
|
||||
public EntityLivingBase getEntity() { return entity; }
|
||||
public RenderLivingBase<T> getRenderer() { return renderer; }
|
||||
public double getX() { return x; }
|
||||
public double getY() { return y; }
|
||||
public double getZ() { return z; }
|
||||
|
||||
@Cancelable
|
||||
public static class Pre<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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); }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user