mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-23 13:39:43 +00:00
Step 2: The Reformation
This commit is contained in:
1 parent
9332673944
commit
797399ff7f
198 files changed
+24
-10
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
@Cancelable
|
||||
public class ClientChatReceivedEvent extends Event
|
||||
{
|
||||
public String message;
|
||||
public ClientChatReceivedEvent(String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
@Cancelable
|
||||
public class DrawBlockHighlightEvent extends Event
|
||||
{
|
||||
public final RenderGlobal context;
|
||||
public final EntityPlayer player;
|
||||
public final MovingObjectPosition target;
|
||||
public final int subID;
|
||||
public final ItemStack currentItem;
|
||||
public final float partialTicks;
|
||||
|
||||
public DrawBlockHighlightEvent(RenderGlobal context, EntityPlayer player, MovingObjectPosition target, int subID, ItemStack currentItem, float partialTicks)
|
||||
{
|
||||
this.context = context;
|
||||
this.player = player;
|
||||
this.target = target;
|
||||
this.subID = subID;
|
||||
this.currentItem = currentItem;
|
||||
this.partialTicks= partialTicks;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
* Created: 6:07 PM, 9/5/13
|
||||
*/
|
||||
public class FOVUpdateEvent extends Event
|
||||
{
|
||||
public final EntityPlayerSP entity;
|
||||
public final float fov;
|
||||
public float newfov;
|
||||
|
||||
public FOVUpdateEvent(EntityPlayerSP entity, float fov)
|
||||
{
|
||||
this.entity = entity;
|
||||
this.fov = fov;
|
||||
this.newfov = fov;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
/**
|
||||
* This event is called before any Gui will open.
|
||||
* If you don't want this to happen, cancel the event.
|
||||
* If you want to override this Gui, simply set the gui variable to your own Gui.
|
||||
*
|
||||
* @author jk-5
|
||||
*/
|
||||
@Cancelable
|
||||
public class GuiOpenEvent extends Event
|
||||
{
|
||||
public GuiScreen gui;
|
||||
public GuiOpenEvent(GuiScreen gui)
|
||||
{
|
||||
this.gui = gui;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
* Created: 2:46 PM, 9/4/13
|
||||
*/
|
||||
@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;
|
||||
|
||||
public MouseEvent()
|
||||
{
|
||||
this.x = Mouse.getEventX();
|
||||
this.y = Mouse.getEventY();
|
||||
this.dx = Mouse.getEventDX();
|
||||
this.dy = Mouse.getEventDY();
|
||||
this.dwheel = Mouse.getEventDWheel();
|
||||
this.button = Mouse.getEventButton();
|
||||
this.buttonstate = Mouse.getEventButtonState();
|
||||
this.nanoseconds = Mouse.getEventNanoseconds();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
@Cancelable
|
||||
public class RenderGameOverlayEvent extends Event
|
||||
{
|
||||
public static enum ElementType
|
||||
{
|
||||
ALL,
|
||||
HELMET,
|
||||
PORTAL,
|
||||
CROSSHAIRS,
|
||||
BOSSHEALTH,
|
||||
ARMOR,
|
||||
HEALTH,
|
||||
FOOD,
|
||||
AIR,
|
||||
HOTBAR,
|
||||
EXPERIENCE,
|
||||
TEXT,
|
||||
HEALTHMOUNT,
|
||||
JUMPBAR,
|
||||
CHAT,
|
||||
PLAYER_LIST
|
||||
}
|
||||
|
||||
public final float partialTicks;
|
||||
public final ScaledResolution resolution;
|
||||
public final int mouseX;
|
||||
public final int mouseY;
|
||||
public final ElementType type;
|
||||
|
||||
public RenderGameOverlayEvent(float partialTicks, ScaledResolution resolution, int mouseX, int mouseY)
|
||||
{
|
||||
this.partialTicks = partialTicks;
|
||||
this.resolution = resolution;
|
||||
this.mouseX = mouseX;
|
||||
this.mouseY = mouseY;
|
||||
this.type = null;
|
||||
}
|
||||
|
||||
private RenderGameOverlayEvent(RenderGameOverlayEvent parent, ElementType type)
|
||||
{
|
||||
this.partialTicks = parent.partialTicks;
|
||||
this.resolution = parent.resolution;
|
||||
this.mouseX = parent.mouseX;
|
||||
this.mouseY = parent.mouseY;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static class Pre extends RenderGameOverlayEvent
|
||||
{
|
||||
public Pre(RenderGameOverlayEvent parent, ElementType type)
|
||||
{
|
||||
super(parent, type);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Post extends RenderGameOverlayEvent
|
||||
{
|
||||
public Post(RenderGameOverlayEvent parent, ElementType type)
|
||||
{
|
||||
super(parent, type);
|
||||
}
|
||||
@Override public boolean isCancelable(){ return false; }
|
||||
}
|
||||
|
||||
public static class Text extends Pre
|
||||
{
|
||||
public final ArrayList<String> left;
|
||||
public 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 static class Chat extends Pre
|
||||
{
|
||||
public int posX;
|
||||
public int posY;
|
||||
|
||||
public Chat(RenderGameOverlayEvent parent, int posX, int posY)
|
||||
{
|
||||
super(parent, ElementType.CHAT);
|
||||
this.posX = posX;
|
||||
this.posY = posY;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
public abstract class RenderLivingEvent extends Event
|
||||
{
|
||||
public final EntityLivingBase entity;
|
||||
public final RendererLivingEntity renderer;
|
||||
|
||||
public RenderLivingEvent(EntityLivingBase entity, RendererLivingEntity renderer)
|
||||
{
|
||||
this.entity = entity;
|
||||
this.renderer = renderer;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class Pre extends RenderLivingEvent
|
||||
{
|
||||
public Pre(EntityLivingBase entity, RendererLivingEntity renderer){ super(entity, renderer); }
|
||||
}
|
||||
public static class Post extends RenderLivingEvent
|
||||
{
|
||||
public Post(EntityLivingBase entity, RendererLivingEntity renderer){ super(entity, renderer); }
|
||||
}
|
||||
|
||||
public abstract static class Specials extends RenderLivingEvent
|
||||
{
|
||||
public Specials(EntityLivingBase entity, RendererLivingEntity renderer){ super(entity, renderer); }
|
||||
|
||||
@Cancelable
|
||||
public static class Pre extends Specials
|
||||
{
|
||||
public Pre(EntityLivingBase entity, RendererLivingEntity renderer){ super(entity, renderer); }
|
||||
}
|
||||
public static class Post extends Specials
|
||||
{
|
||||
public Post(EntityLivingBase entity, RendererLivingEntity renderer){ super(entity, renderer); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
public abstract class RenderPlayerEvent extends PlayerEvent
|
||||
{
|
||||
public final RenderPlayer renderer;
|
||||
public final float partialRenderTick;
|
||||
|
||||
public RenderPlayerEvent(EntityPlayer player, RenderPlayer renderer, float partialRenderTick)
|
||||
{
|
||||
super(player);
|
||||
this.renderer = renderer;
|
||||
this.partialRenderTick = partialRenderTick;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class Pre extends RenderPlayerEvent
|
||||
{
|
||||
public Pre(EntityPlayer player, RenderPlayer renderer, float tick){ super(player, renderer, tick); }
|
||||
}
|
||||
|
||||
public static class Post extends RenderPlayerEvent
|
||||
{
|
||||
public Post(EntityPlayer player, RenderPlayer renderer, float tick){ super(player, renderer, tick); }
|
||||
}
|
||||
|
||||
public abstract static class Specials extends RenderPlayerEvent
|
||||
{
|
||||
@Deprecated
|
||||
public final float partialTicks;
|
||||
public Specials(EntityPlayer player, RenderPlayer renderer, float partialTicks)
|
||||
{
|
||||
super(player, renderer, partialTicks);
|
||||
this.partialTicks = partialTicks;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class Pre extends Specials
|
||||
{
|
||||
public boolean renderHelmet = true;
|
||||
public boolean renderCape = true;
|
||||
public boolean renderItem = true;
|
||||
public Pre(EntityPlayer player, RenderPlayer renderer, float partialTicks){ super(player, renderer, partialTicks); }
|
||||
}
|
||||
|
||||
public static class Post extends Specials
|
||||
{
|
||||
public Post(EntityPlayer player, RenderPlayer renderer, float partialTicks){ super(player, renderer, partialTicks); }
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
@Deprecated
|
||||
public final float partialTick;
|
||||
public final ItemStack stack;
|
||||
public SetArmorModel(EntityPlayer player, RenderPlayer renderer, int slot, float partialTick, ItemStack stack)
|
||||
{
|
||||
super(player, renderer, partialTick);
|
||||
this.slot = slot;
|
||||
this.partialTick = partialTick;
|
||||
this.stack = stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
public class RenderWorldLastEvent extends Event
|
||||
{
|
||||
public final RenderGlobal context;
|
||||
public final float partialTicks;
|
||||
public RenderWorldLastEvent(RenderGlobal context, float partialTicks)
|
||||
{
|
||||
this.context = context;
|
||||
this.partialTicks = partialTicks;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
|
||||
public class TextureStitchEvent extends Event
|
||||
{
|
||||
public final TextureMap map;
|
||||
|
||||
public TextureStitchEvent(TextureMap map)
|
||||
{
|
||||
this.map = 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
|
||||
* add themselves to the list.
|
||||
*/
|
||||
public static class Pre extends TextureStitchEvent
|
||||
{
|
||||
public Pre(TextureMap map){ super(map); }
|
||||
}
|
||||
|
||||
/**
|
||||
* This event is fired once the texture map has loaded all textures and
|
||||
* stitched them together. All Icons should have there locations defined
|
||||
* by the time this is fired.
|
||||
*/
|
||||
public static class Post extends TextureStitchEvent
|
||||
{
|
||||
public Post(TextureMap map){ super(map); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.client.audio.SoundPoolEntry;
|
||||
|
||||
/**
|
||||
* Raised when the SoundManager tries to play a Background Music file,
|
||||
* If you return null from this function it will prevent the sound from being played,
|
||||
* you can return a different entry if you want to change the sound being played.
|
||||
*/
|
||||
public class PlayBackgroundMusicEvent extends SoundResultEvent
|
||||
{
|
||||
public PlayBackgroundMusicEvent(SoundManager manager, SoundPoolEntry entry)
|
||||
{ super(manager, entry, null, 0.0f, 0.0f); }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.client.audio.SoundPoolEntry;
|
||||
|
||||
public class PlaySoundEffectEvent extends SoundResultEvent
|
||||
{
|
||||
public PlaySoundEffectEvent(SoundManager manager, SoundPoolEntry source, String name, float volume, float pitch)
|
||||
{ super(manager, source, name, volume, pitch); }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
|
||||
public class PlaySoundEffectSourceEvent extends SoundEvent
|
||||
{
|
||||
public final SoundManager manager;
|
||||
public final String name;
|
||||
public PlaySoundEffectSourceEvent(SoundManager manager, String name)
|
||||
{
|
||||
this.manager = manager;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.client.audio.SoundPoolEntry;
|
||||
|
||||
/***
|
||||
* Raised when the SoundManager tries to play a normal sound,
|
||||
* dogs barking, footsteps, etc. THe majority of all sounds during normal game play.
|
||||
*
|
||||
* If you return null from this function it will prevent the sound from being played,
|
||||
* you can return a different entry if you want to change the sound being played.
|
||||
*/
|
||||
public class PlaySoundEvent extends SoundResultEvent
|
||||
{
|
||||
public final float x;
|
||||
public final float y;
|
||||
public final float z;
|
||||
public PlaySoundEvent(SoundManager manager, SoundPoolEntry source, String name, float x, float y, float z, float volume, float pitch)
|
||||
{
|
||||
super(manager, source, name, volume, pitch);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
|
||||
public class PlaySoundSourceEvent extends SoundEvent
|
||||
{
|
||||
public final SoundManager manager;
|
||||
public final String name;
|
||||
public final float x;
|
||||
public final float y;
|
||||
public final float z;
|
||||
public PlaySoundSourceEvent(SoundManager manager, String name, float x, float y, float z)
|
||||
{
|
||||
this.manager = manager;
|
||||
this.name = name;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.client.audio.SoundPoolEntry;
|
||||
|
||||
/**
|
||||
* Raised when the SoundManager tries to play a 'Streaming' file,
|
||||
* in vanilla it is only the Jukebox that uses this function.
|
||||
*
|
||||
* If you return null from this function it will prevent the sound from being played,
|
||||
* you can return a different entry if you want to change the sound being played.
|
||||
*
|
||||
*/
|
||||
public class PlayStreamingEvent extends SoundResultEvent
|
||||
{
|
||||
public final float x;
|
||||
public final float y;
|
||||
public final float z;
|
||||
public PlayStreamingEvent(SoundManager manager, SoundPoolEntry source, String name, float x, float y, float z)
|
||||
{
|
||||
super(manager, source, name, 0.0f, 0.0f);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
|
||||
public class PlayStreamingSourceEvent extends SoundEvent
|
||||
{
|
||||
public final SoundManager manager;
|
||||
public final String name;
|
||||
public final float x;
|
||||
public final float y;
|
||||
public final float z;
|
||||
public PlayStreamingSourceEvent(SoundManager manager, String name, float x, float y, float z)
|
||||
{
|
||||
this.manager = manager;
|
||||
this.name = name;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.client.audio.SoundPoolEntry;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
public class SoundEvent extends Event
|
||||
{
|
||||
public SoundEvent(){}
|
||||
|
||||
public static SoundPoolEntry getResult(SoundResultEvent event)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
return event.result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
|
||||
/**
|
||||
* Raised by the SoundManager.loadSoundSettings, this would be a good place for
|
||||
* adding your custom sounds to the SoundPool.
|
||||
*/
|
||||
public class SoundLoadEvent extends SoundEvent
|
||||
{
|
||||
public final SoundManager manager;
|
||||
public SoundLoadEvent(SoundManager manager)
|
||||
{
|
||||
this.manager = manager;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.client.audio.SoundPoolEntry;
|
||||
|
||||
public abstract class SoundResultEvent extends SoundEvent
|
||||
{
|
||||
public final SoundManager manager;
|
||||
public final SoundPoolEntry source;
|
||||
public final String name;
|
||||
public final float volume;
|
||||
public final float pitch;
|
||||
public SoundPoolEntry result;
|
||||
|
||||
public SoundResultEvent(SoundManager manager, SoundPoolEntry source, String name, float volume, float pitch)
|
||||
{
|
||||
this.manager = manager;
|
||||
this.source = source;
|
||||
this.name = name;
|
||||
this.volume = volume;
|
||||
this.pitch = pitch;
|
||||
this.result = source;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.minecraftforge.client.event.sound;
|
||||
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
|
||||
/**
|
||||
* This event is raised by the SoundManager when it does its first setup of the
|
||||
* SoundSystemConfig's codecs, use this function to add your own codecs.
|
||||
*/
|
||||
public class SoundSetupEvent extends SoundEvent
|
||||
{
|
||||
public final SoundManager manager;
|
||||
public SoundSetupEvent(SoundManager manager)
|
||||
{
|
||||
this.manager = manager;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user