WOW 😲 such broken. Many brokes.
This commit is contained in:
parent
c1f0e1b68f
commit
f942eb184a
266 changed files with 1717 additions and 4018 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -30,3 +30,4 @@ changelog.txt
|
||||||
/patches_old_bak/
|
/patches_old_bak/
|
||||||
*.py
|
*.py
|
||||||
*.7z
|
*.7z
|
||||||
|
/logs/
|
||||||
|
|
|
@ -20,8 +20,10 @@
|
||||||
package net.minecraftforge.client;
|
package net.minecraftforge.client;
|
||||||
|
|
||||||
import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.BOSSINFO;
|
import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.BOSSINFO;
|
||||||
import static net.minecraftforge.common.ForgeVersion.Status.BETA;
|
import static net.minecraftforge.fml.VersionChecker.Status.BETA;
|
||||||
import static net.minecraftforge.common.ForgeVersion.Status.BETA_OUTDATED;
|
import static net.minecraftforge.fml.VersionChecker.Status.BETA_OUTDATED;
|
||||||
|
import static org.lwjgl.opengl.GL11.*;
|
||||||
|
import static org.lwjgl.opengl.GL20.*;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -125,22 +127,19 @@ import net.minecraftforge.client.resource.SelectiveReloadStateHandler;
|
||||||
import net.minecraftforge.client.resource.VanillaResourceType;
|
import net.minecraftforge.client.resource.VanillaResourceType;
|
||||||
import net.minecraftforge.common.ForgeModContainer;
|
import net.minecraftforge.common.ForgeModContainer;
|
||||||
import net.minecraftforge.common.ForgeVersion;
|
import net.minecraftforge.common.ForgeVersion;
|
||||||
import net.minecraftforge.common.ForgeVersion.Status;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.common.model.IModelPart;
|
import net.minecraftforge.common.model.IModelPart;
|
||||||
import net.minecraftforge.common.model.ITransformation;
|
import net.minecraftforge.common.model.ITransformation;
|
||||||
import net.minecraftforge.common.model.TRSRTransformation;
|
import net.minecraftforge.common.model.TRSRTransformation;
|
||||||
|
import net.minecraftforge.fml.VersionChecker;
|
||||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||||
import net.minecraftforge.fml.common.FMLLog;
|
import net.minecraftforge.fml.common.FMLLog;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import org.lwjgl.BufferUtils;
|
import org.lwjgl.BufferUtils;
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
import org.lwjgl.opengl.GL20;
|
|
||||||
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
public class ForgeHooksClient
|
public class ForgeHooksClient
|
||||||
|
@ -167,7 +166,7 @@ public class ForgeHooksClient
|
||||||
|
|
||||||
if (block != null && block.isBed(state, world, pos, entity))
|
if (block != null && block.isBed(state, world, pos, entity))
|
||||||
{
|
{
|
||||||
GL11.glRotatef((float)(block.getBedDirection(state, world, pos).getHorizontalIndex() * 90), 0.0F, 1.0F, 0.0F);
|
glRotatef((float)(block.getBedDirection(state, world, pos).getHorizontalIndex() * 90), 0.0F, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +329,7 @@ public class ForgeHooksClient
|
||||||
private static int updatescrollcounter = 0;
|
private static int updatescrollcounter = 0;
|
||||||
public static String renderMainMenu(GuiMainMenu gui, FontRenderer font, int width, int height, String splashText)
|
public static String renderMainMenu(GuiMainMenu gui, FontRenderer font, int width, int height, String splashText)
|
||||||
{
|
{
|
||||||
Status status = ForgeVersion.getStatus();
|
VersionChecker.Status status = ForgeVersion.getStatus();
|
||||||
if (status == BETA || status == BETA_OUTDATED)
|
if (status == BETA || status == BETA_OUTDATED)
|
||||||
{
|
{
|
||||||
// render a warning at the top of the screen,
|
// render a warning at the top of the screen,
|
||||||
|
@ -400,6 +399,29 @@ public class ForgeHooksClient
|
||||||
modelLoader.onPostBakeEvent(modelRegistry);
|
modelLoader.onPostBakeEvent(modelRegistry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public static Matrix4f getMatrix(net.minecraft.client.renderer.block.model.ItemTransformVec3f transform)
|
||||||
|
{
|
||||||
|
javax.vecmath.Matrix4f m = new javax.vecmath.Matrix4f(), t = new javax.vecmath.Matrix4f();
|
||||||
|
m.setIdentity();
|
||||||
|
m.setTranslation(TRSRTransformation.toVecmath(transform.translation));
|
||||||
|
t.setIdentity();
|
||||||
|
t.rotY(transform.rotation.y);
|
||||||
|
m.mul(t);
|
||||||
|
t.setIdentity();
|
||||||
|
t.rotX(transform.rotation.x);
|
||||||
|
m.mul(t);
|
||||||
|
t.setIdentity();
|
||||||
|
t.rotZ(transform.rotation.z);
|
||||||
|
m.mul(t);
|
||||||
|
t.setIdentity();
|
||||||
|
t.m00 = transform.scale.x;
|
||||||
|
t.m11 = transform.scale.y;
|
||||||
|
t.m22 = transform.scale.z;
|
||||||
|
m.mul(t);
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
private static final Matrix4f flipX;
|
private static final Matrix4f flipX;
|
||||||
static {
|
static {
|
||||||
flipX = new Matrix4f();
|
flipX = new Matrix4f();
|
||||||
|
@ -436,7 +458,7 @@ public class ForgeHooksClient
|
||||||
matrixBuf.put(t);
|
matrixBuf.put(t);
|
||||||
}
|
}
|
||||||
matrixBuf.flip();
|
matrixBuf.flip();
|
||||||
GL11.glMultMatrix(matrixBuf);
|
glMultMatrix(matrixBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// moved and expanded from WorldVertexBufferUploader.draw
|
// moved and expanded from WorldVertexBufferUploader.draw
|
||||||
|
@ -450,32 +472,32 @@ public class ForgeHooksClient
|
||||||
switch(attrType)
|
switch(attrType)
|
||||||
{
|
{
|
||||||
case POSITION:
|
case POSITION:
|
||||||
GlStateManager.glVertexPointer(count, constant, stride, buffer);
|
glVertexPointer(count, constant, stride, buffer);
|
||||||
GlStateManager.glEnableClientState(GL11.GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
break;
|
break;
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
if(count != 3)
|
if(count != 3)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Normal attribute should have the size 3: " + attr);
|
throw new IllegalArgumentException("Normal attribute should have the size 3: " + attr);
|
||||||
}
|
}
|
||||||
GlStateManager.glNormalPointer(constant, stride, buffer);
|
glNormalPointer(constant, stride, buffer);
|
||||||
GlStateManager.glEnableClientState(GL11.GL_NORMAL_ARRAY);
|
glEnableClientState(GL_NORMAL_ARRAY);
|
||||||
break;
|
break;
|
||||||
case COLOR:
|
case COLOR:
|
||||||
GlStateManager.glColorPointer(count, constant, stride, buffer);
|
glColorPointer(count, constant, stride, buffer);
|
||||||
GlStateManager.glEnableClientState(GL11.GL_COLOR_ARRAY);
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
break;
|
break;
|
||||||
case UV:
|
case UV:
|
||||||
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
|
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
|
||||||
GlStateManager.glTexCoordPointer(count, constant, stride, buffer);
|
glTexCoordPointer(count, constant, stride, buffer);
|
||||||
GlStateManager.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
|
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
|
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
|
||||||
break;
|
break;
|
||||||
case PADDING:
|
case PADDING:
|
||||||
break;
|
break;
|
||||||
case GENERIC:
|
case GENERIC:
|
||||||
GL20.glEnableVertexAttribArray(attr.getIndex());
|
glEnableVertexAttribArray(attr.getIndex());
|
||||||
GL20.glVertexAttribPointer(attr.getIndex(), count, constant, false, stride, buffer);
|
glVertexAttribPointer(attr.getIndex(), count, constant, false, stride, buffer);
|
||||||
default:
|
default:
|
||||||
FMLLog.log.fatal("Unimplemented vanilla attribute upload: {}", attrType.getDisplayName());
|
FMLLog.log.fatal("Unimplemented vanilla attribute upload: {}", attrType.getDisplayName());
|
||||||
}
|
}
|
||||||
|
@ -487,25 +509,25 @@ public class ForgeHooksClient
|
||||||
switch(attrType)
|
switch(attrType)
|
||||||
{
|
{
|
||||||
case POSITION:
|
case POSITION:
|
||||||
GlStateManager.glDisableClientState(GL11.GL_VERTEX_ARRAY);
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
break;
|
break;
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
GlStateManager.glDisableClientState(GL11.GL_NORMAL_ARRAY);
|
glDisableClientState(GL_NORMAL_ARRAY);
|
||||||
break;
|
break;
|
||||||
case COLOR:
|
case COLOR:
|
||||||
GlStateManager.glDisableClientState(GL11.GL_COLOR_ARRAY);
|
glDisableClientState(GL_COLOR_ARRAY);
|
||||||
// is this really needed?
|
// is this really needed?
|
||||||
GlStateManager.resetColor();
|
GlStateManager.resetColor();
|
||||||
break;
|
break;
|
||||||
case UV:
|
case UV:
|
||||||
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
|
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
|
||||||
GlStateManager.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
|
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
|
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
|
||||||
break;
|
break;
|
||||||
case PADDING:
|
case PADDING:
|
||||||
break;
|
break;
|
||||||
case GENERIC:
|
case GENERIC:
|
||||||
GL20.glDisableVertexAttribArray(attr.getIndex());
|
glDisableVertexAttribArray(attr.getIndex());
|
||||||
default:
|
default:
|
||||||
FMLLog.log.fatal("Unimplemented vanilla attribute upload: {}", attrType.getDisplayName());
|
FMLLog.log.fatal("Unimplemented vanilla attribute upload: {}", attrType.getDisplayName());
|
||||||
}
|
}
|
||||||
|
@ -570,15 +592,6 @@ public class ForgeHooksClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed as soon as possible. See {@link Item#getTileEntityItemStackRenderer()}.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public static void registerTESRItemStack(Item item, int metadata, Class<? extends TileEntity> TileClass)
|
|
||||||
{
|
|
||||||
tileItemMap.put(Pair.of(item, metadata), TileClass);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* internal, relies on fixed format of FaceBakery
|
* internal, relies on fixed format of FaceBakery
|
||||||
*/
|
*/
|
||||||
|
@ -742,9 +755,9 @@ public class ForgeHooksClient
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public static Pair<? extends IBakedModel,Matrix4f> handlePerspective(IBakedModel model, ItemCameraTransforms.TransformType type)
|
public static Pair<? extends IBakedModel,Matrix4f> handlePerspective(IBakedModel model, ItemCameraTransforms.TransformType type)
|
||||||
{
|
{
|
||||||
TRSRTransformation tr = TRSRTransformation.from(model.getItemCameraTransforms().getTransform(type));
|
TRSRTransformation tr = new TRSRTransformation(model.getItemCameraTransforms().getTransform(type));
|
||||||
Matrix4f mat = null;
|
Matrix4f mat = null;
|
||||||
if (!tr.isIdentity()) mat = tr.getMatrix();
|
if(!tr.equals(TRSRTransformation.identity())) mat = tr.getMatrix();
|
||||||
return Pair.of(model, mat);
|
return Pair.of(model, mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
|
|
@ -21,11 +21,11 @@ package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraft.util.text.ChatType;
|
import net.minecraft.util.text.ChatType;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class ClientChatReceivedEvent extends Event
|
public class ClientChatReceivedEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private ITextComponent message;
|
private ITextComponent message;
|
||||||
private final ChatType type;
|
private final ChatType type;
|
||||||
|
|
|
@ -21,7 +21,7 @@ package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.color.BlockColors;
|
import net.minecraft.client.renderer.color.BlockColors;
|
||||||
import net.minecraft.client.renderer.color.ItemColors;
|
import net.minecraft.client.renderer.color.ItemColors;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use these events to register block/item
|
* Use these events to register block/item
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.client.renderer.RenderGlobal;
|
import net.minecraft.client.renderer.RenderGlobal;
|
||||||
|
|
|
@ -22,14 +22,14 @@ package net.minecraftforge.client.event;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.renderer.EntityRenderer;
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event that hooks into EntityRenderer, allowing any feature to customize visual attributes
|
* Event that hooks into EntityRenderer, allowing any feature to customize visual attributes
|
||||||
* the player sees.
|
* the player sees.
|
||||||
*/
|
*/
|
||||||
public abstract class EntityViewRenderEvent extends Event
|
public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final EntityRenderer renderer;
|
private final EntityRenderer renderer;
|
||||||
private final Entity entity;
|
private final Entity entity;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: MachineMuse (Claire Semple)
|
* Author: MachineMuse (Claire Semple)
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event class for handling GuiContainer specific events.
|
* Event class for handling GuiContainer specific events.
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,8 +30,8 @@ import net.minecraft.client.gui.GuiScreen;
|
||||||
*
|
*
|
||||||
* @author jk-5
|
* @author jk-5
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class GuiOpenEvent extends Event
|
public class GuiOpenEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private GuiScreen gui;
|
private GuiScreen gui;
|
||||||
public GuiOpenEvent(GuiScreen gui)
|
public GuiOpenEvent(GuiScreen gui)
|
||||||
|
|
|
@ -30,8 +30,8 @@ import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
|
|
@ -24,14 +24,14 @@ import net.minecraft.client.renderer.block.model.ModelManager;
|
||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.util.registry.IRegistry;
|
import net.minecraft.util.registry.IRegistry;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when the ModelManager is notified of the resource manager reloading.
|
* Fired when the ModelManager is notified of the resource manager reloading.
|
||||||
* Called after model registry is setup, but before it's passed to BlockModelShapes.
|
* Called after model registry is setup, but before it's passed to BlockModelShapes.
|
||||||
*/
|
*/
|
||||||
// TODO: try to merge with ICustomModelLoader
|
// TODO: try to merge with ICustomModelLoader
|
||||||
public class ModelBakeEvent extends Event
|
public class ModelBakeEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final ModelManager modelManager;
|
private final ModelManager modelManager;
|
||||||
private final IRegistry<ModelResourceLocation, IBakedModel> modelRegistry;
|
private final IRegistry<ModelResourceLocation, IBakedModel> modelRegistry;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraftforge.fml.common.eventhandler.IContextSetter;
|
import net.minecraftforge.fml.common.eventhandler.IContextSetter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,15 +21,15 @@ package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: MachineMuse (Claire Semple)
|
* Author: MachineMuse (Claire Semple)
|
||||||
* Created: 2:46 PM, 9/4/13
|
* Created: 2:46 PM, 9/4/13
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class MouseEvent extends Event
|
public class MouseEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final int x;
|
private final int x;
|
||||||
private final int y;
|
private final int y;
|
||||||
|
|
|
@ -22,7 +22,7 @@ package net.minecraftforge.client.event;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import javax.annotation.Nonnull;
|
||||||
*
|
*
|
||||||
* Cancelling the event will prevent pushOutOfBlocks from being called.
|
* Cancelling the event will prevent pushOutOfBlocks from being called.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class PlayerSPPushOutOfBlocksEvent extends PlayerEvent
|
public class PlayerSPPushOutOfBlocksEvent extends PlayerEvent
|
||||||
{
|
{
|
||||||
private AxisAlignedBB entityBoundingBox;
|
private AxisAlignedBB entityBoundingBox;
|
||||||
|
|
|
@ -23,14 +23,15 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a block's texture is going to be overlaid on the player's HUD. Cancel this event to prevent the overlay.
|
* Called when a block's texture is going to be overlaid on the player's HUD. Cancel this event to prevent the overlay.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class RenderBlockOverlayEvent extends Event {
|
public class RenderBlockOverlayEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
|
{
|
||||||
|
|
||||||
public static enum OverlayType {
|
public static enum OverlayType {
|
||||||
FIRE, BLOCK, WATER
|
FIRE, BLOCK, WATER
|
||||||
|
|
|
@ -21,12 +21,12 @@ package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.client.gui.BossInfoClient;
|
import net.minecraft.client.gui.BossInfoClient;
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class RenderGameOverlayEvent extends Event
|
public class RenderGameOverlayEvent extends Event
|
||||||
{
|
{
|
||||||
public float getPartialTicks()
|
public float getPartialTicks()
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.client.renderer.RenderGlobal;
|
import net.minecraft.client.renderer.RenderGlobal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,8 +30,8 @@ import net.minecraft.client.renderer.RenderGlobal;
|
||||||
* and prevents {@link RenderSpecificHandEvent} from firing.
|
* and prevents {@link RenderSpecificHandEvent} from firing.
|
||||||
* TODO This may get merged in 11 with RenderSpecificHandEvent to make a generic hand rendering
|
* TODO This may get merged in 11 with RenderSpecificHandEvent to make a generic hand rendering
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class RenderHandEvent extends Event
|
public class RenderHandEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final RenderGlobal context;
|
private final RenderGlobal context;
|
||||||
private final float partialTicks;
|
private final float partialTicks;
|
||||||
|
|
|
@ -22,8 +22,8 @@ package net.minecraftforge.client.event;
|
||||||
import net.minecraft.client.renderer.entity.RenderItemFrame;
|
import net.minecraft.client.renderer.entity.RenderItemFrame;
|
||||||
import net.minecraft.entity.item.EntityItemFrame;
|
import net.minecraft.entity.item.EntityItemFrame;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import javax.annotation.Nonnull;
|
||||||
* You can set canceled to do no further vanilla processing.
|
* You can set canceled to do no further vanilla processing.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public class RenderItemInFrameEvent extends Event
|
public class RenderItemInFrameEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final ItemStack item;
|
private final ItemStack item;
|
||||||
private final EntityItemFrame entityItemFrame;
|
private final EntityItemFrame entityItemFrame;
|
||||||
|
|
|
@ -19,12 +19,12 @@
|
||||||
|
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.client.renderer.entity.RenderLivingBase;
|
import net.minecraft.client.renderer.entity.RenderLivingBase;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
public abstract class RenderLivingEvent<T extends EntityLivingBase> extends Event
|
public abstract class RenderLivingEvent<T extends EntityLivingBase> extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final EntityLivingBase entity;
|
private final EntityLivingBase entity;
|
||||||
private final RenderLivingBase<T> renderer;
|
private final RenderLivingBase<T> renderer;
|
||||||
|
@ -56,7 +56,7 @@ public abstract class RenderLivingEvent<T extends EntityLivingBase> extends Even
|
||||||
public double getY() { return y; }
|
public double getY() { return y; }
|
||||||
public double getZ() { return z; }
|
public double getZ() { return z; }
|
||||||
|
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class Pre<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
public static class Pre<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
||||||
{
|
{
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -74,7 +74,7 @@ public abstract class RenderLivingEvent<T extends EntityLivingBase> extends Even
|
||||||
{
|
{
|
||||||
public Specials(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z){ super(entity, renderer, 0, x, y, z); }
|
public Specials(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z){ super(entity, renderer, 0, x, y, z); }
|
||||||
|
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class Pre<T extends EntityLivingBase> extends Specials<T>
|
public static class Pre<T extends EntityLivingBase> extends Specials<T>
|
||||||
{
|
{
|
||||||
public Pre(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
public Pre(EntityLivingBase entity, RenderLivingBase<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -51,7 +51,7 @@ public abstract class RenderPlayerEvent extends PlayerEvent
|
||||||
public double getY() { return y; }
|
public double getY() { return y; }
|
||||||
public double getZ() { return z; }
|
public double getZ() { return z; }
|
||||||
|
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class Pre extends RenderPlayerEvent
|
public static class Pre extends RenderPlayerEvent
|
||||||
{
|
{
|
||||||
public Pre(EntityPlayer player, RenderPlayer renderer, float tick, double x, double y, double z){ super(player, renderer, tick, x, y, z); }
|
public Pre(EntityPlayer player, RenderPlayer renderer, float tick, double x, double y, double z){ super(player, renderer, tick, x, y, z); }
|
||||||
|
@ -74,7 +74,7 @@ public abstract class RenderPlayerEvent extends PlayerEvent
|
||||||
super(player, renderer, partialTicks, 0D, 0D, 0D);
|
super(player, renderer, partialTicks, 0D, 0D, 0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class Pre extends Specials
|
public static class Pre extends Specials
|
||||||
{
|
{
|
||||||
private boolean renderHelmet = true;
|
private boolean renderHelmet = true;
|
||||||
|
|
|
@ -21,8 +21,8 @@ package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ import javax.annotation.Nonnull;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A set of events which are fired at various points during tooltip rendering.
|
* A set of events which are fired at various points during tooltip rendering.
|
||||||
|
@ -42,7 +42,7 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
* <li>{@link RenderTooltipEvent.PostText}</li>
|
* <li>{@link RenderTooltipEvent.PostText}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public abstract class RenderTooltipEvent extends Event
|
public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
@Nonnull
|
@Nonnull
|
||||||
protected final ItemStack stack;
|
protected final ItemStack stack;
|
||||||
|
@ -110,7 +110,7 @@ public abstract class RenderTooltipEvent extends Event
|
||||||
* <p>
|
* <p>
|
||||||
* This event is {@link Cancelable}.
|
* This event is {@link Cancelable}.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class Pre extends RenderTooltipEvent
|
public static class Pre extends RenderTooltipEvent
|
||||||
{
|
{
|
||||||
private int screenWidth;
|
private int screenWidth;
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
|
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.client.renderer.RenderGlobal;
|
import net.minecraft.client.renderer.RenderGlobal;
|
||||||
|
|
||||||
public class RenderWorldLastEvent extends Event
|
public class RenderWorldLastEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final RenderGlobal context;
|
private final RenderGlobal context;
|
||||||
private final float partialTicks;
|
private final float partialTicks;
|
||||||
|
|
|
@ -21,8 +21,8 @@ package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
import net.minecraft.util.text.TextComponentString;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -37,7 +37,7 @@ import java.io.File;
|
||||||
* {@link #resultMessage} contains the {@link ITextComponent} to be returned. If {@code null}, the default vanilla message will be used instead
|
* {@link #resultMessage} contains the {@link ITextComponent} to be returned. If {@code null}, the default vanilla message will be used instead
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public class ScreenshotEvent extends Event
|
public class ScreenshotEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final ITextComponent DEFAULT_CANCEL_REASON = new TextComponentString("Screenshot canceled");
|
public static final ITextComponent DEFAULT_CANCEL_REASON = new TextComponentString("Screenshot canceled");
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package net.minecraftforge.client.event;
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
|
|
||||||
package net.minecraftforge.client.event.sound;
|
package net.minecraftforge.client.event.sound;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.client.audio.ISound;
|
import net.minecraft.client.audio.ISound;
|
||||||
import net.minecraft.client.audio.SoundManager;
|
import net.minecraft.client.audio.SoundManager;
|
||||||
|
|
||||||
public class SoundEvent extends Event
|
public class SoundEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final SoundManager manager;
|
private final SoundManager manager;
|
||||||
public SoundEvent(SoundManager manager)
|
public SoundEvent(SoundManager manager)
|
||||||
|
|
|
@ -28,6 +28,7 @@ import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.common.ForgeModContainer;
|
import net.minecraftforge.common.ForgeModContainer;
|
||||||
import net.minecraftforge.common.ForgeVersion;
|
import net.minecraftforge.common.ForgeVersion;
|
||||||
import net.minecraftforge.common.ForgeVersion.Status;
|
import net.minecraftforge.common.ForgeVersion.Status;
|
||||||
|
import net.minecraftforge.fml.VersionChecker;
|
||||||
import net.minecraftforge.fml.client.ClientModLoader;
|
import net.minecraftforge.fml.client.ClientModLoader;
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import net.minecraftforge.fml.common.ModContainer;
|
import net.minecraftforge.fml.common.ModContainer;
|
||||||
|
@ -41,7 +42,7 @@ public class NotificationModUpdateScreen extends GuiScreen
|
||||||
private static final ResourceLocation VERSION_CHECK_ICONS = new ResourceLocation(ForgeVersion.MOD_ID, "textures/gui/version_check_icons.png");
|
private static final ResourceLocation VERSION_CHECK_ICONS = new ResourceLocation(ForgeVersion.MOD_ID, "textures/gui/version_check_icons.png");
|
||||||
|
|
||||||
private final GuiButton modButton;
|
private final GuiButton modButton;
|
||||||
private Status showNotification = null;
|
private VersionChecker.Status showNotification = null;
|
||||||
private boolean hasCheckedForUpdates = false;
|
private boolean hasCheckedForUpdates = false;
|
||||||
|
|
||||||
public NotificationModUpdateScreen(GuiButton modButton)
|
public NotificationModUpdateScreen(GuiButton modButton)
|
||||||
|
|
|
@ -80,6 +80,7 @@ import net.minecraftforge.common.model.animation.IClip;
|
||||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||||
import net.minecraftforge.common.property.Properties;
|
import net.minecraftforge.common.property.Properties;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
import net.minecraftforge.fml.client.ClientModLoader;
|
||||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
import net.minecraftforge.fml.common.FMLLog;
|
import net.minecraftforge.fml.common.FMLLog;
|
||||||
import net.minecraftforge.fml.common.ProgressManager;
|
import net.minecraftforge.fml.common.ProgressManager;
|
||||||
|
@ -143,7 +144,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
@Override
|
@Override
|
||||||
public IRegistry<ModelResourceLocation, IBakedModel> setupModelRegistry()
|
public IRegistry<ModelResourceLocation, IBakedModel> setupModelRegistry()
|
||||||
{
|
{
|
||||||
if (FMLClientHandler.instance().hasError()) // skip loading models if we're just going to show a fatal error screen
|
if (ClientModLoader.isErrored()) // skip loading models if we're just going to show a fatal error screen
|
||||||
return bakedRegistry;
|
return bakedRegistry;
|
||||||
|
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
|
|
@ -53,7 +53,7 @@ import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
import net.minecraftforge.fml.common.FMLLog;
|
import net.minecraftforge.fml.common.FMLLog;
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import net.minecraftforge.fml.common.ModContainer;
|
import net.minecraftforge.fml.common.ModContainer;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
|
@ -390,7 +390,8 @@ public class ForgeChunkManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ForceChunkEvent extends Event {
|
public static class ForceChunkEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
|
{
|
||||||
private final Ticket ticket;
|
private final Ticket ticket;
|
||||||
private final ChunkPos location;
|
private final ChunkPos location;
|
||||||
|
|
||||||
|
@ -411,7 +412,8 @@ public class ForgeChunkManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class UnforceChunkEvent extends Event {
|
public static class UnforceChunkEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
|
{
|
||||||
private final Ticket ticket;
|
private final Ticket ticket;
|
||||||
private final ChunkPos location;
|
private final ChunkPos location;
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ import net.minecraftforge.fml.common.FMLLog;
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import net.minecraftforge.fml.common.LoaderState;
|
import net.minecraftforge.fml.common.LoaderState;
|
||||||
import net.minecraftforge.fml.common.ModContainer;
|
import net.minecraftforge.fml.common.ModContainer;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher;
|
import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher;
|
||||||
import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.ConnectionType;
|
import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.ConnectionType;
|
||||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||||
|
@ -1279,7 +1279,7 @@ public class ForgeHooks
|
||||||
{
|
{
|
||||||
BlockEvent ev = new BlockEvent.CropGrowEvent.Pre(worldIn,pos,state);
|
BlockEvent ev = new BlockEvent.CropGrowEvent.Pre(worldIn,pos,state);
|
||||||
MinecraftForge.EVENT_BUS.post(ev);
|
MinecraftForge.EVENT_BUS.post(ev);
|
||||||
return (ev.getResult() == Event.Result.ALLOW || (ev.getResult() == Event.Result.DEFAULT && def));
|
return (ev.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || (ev.getResult() == net.minecraftforge.eventbus.api.Event.Result.DEFAULT && def));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onCropsGrowPost(World worldIn, BlockPos pos, IBlockState state, IBlockState blockState)
|
public static void onCropsGrowPost(World worldIn, BlockPos pos, IBlockState state, IBlockState blockState)
|
||||||
|
@ -1320,7 +1320,7 @@ public class ForgeHooks
|
||||||
{
|
{
|
||||||
CriticalHitEvent hitResult = new CriticalHitEvent(player, target, damageModifier, vanillaCritical);
|
CriticalHitEvent hitResult = new CriticalHitEvent(player, target, damageModifier, vanillaCritical);
|
||||||
MinecraftForge.EVENT_BUS.post(hitResult);
|
MinecraftForge.EVENT_BUS.post(hitResult);
|
||||||
if (hitResult.getResult() == Event.Result.ALLOW || (vanillaCritical && hitResult.getResult() == Event.Result.DEFAULT))
|
if (hitResult.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW || (vanillaCritical && hitResult.getResult() == net.minecraftforge.eventbus.api.Event.Result.DEFAULT))
|
||||||
{
|
{
|
||||||
return hitResult;
|
return hitResult;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,8 @@ import net.minecraftforge.common.util.FakePlayerFactory;
|
||||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||||
import net.minecraftforge.event.world.WorldEvent;
|
import net.minecraftforge.event.world.WorldEvent;
|
||||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
import net.minecraftforge.fml.common.FMLLog;
|
import net.minecraftforge.eventbus.api.EventPriority;
|
||||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
|
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
|
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
|
||||||
|
@ -64,7 +63,7 @@ public class ForgeInternalHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
@net.minecraftforge.eventbus.api.SubscribeEvent(priority = net.minecraftforge.eventbus.api.EventPriority.HIGHEST)
|
||||||
public void onDimensionLoad(WorldEvent.Load event)
|
public void onDimensionLoad(WorldEvent.Load event)
|
||||||
{
|
{
|
||||||
ForgeChunkManager.loadWorld(event.getWorld());
|
ForgeChunkManager.loadWorld(event.getWorld());
|
||||||
|
@ -76,7 +75,7 @@ public class ForgeInternalHandler
|
||||||
ForgeChunkManager.saveWorld(event.getWorld());
|
ForgeChunkManager.saveWorld(event.getWorld());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
@net.minecraftforge.eventbus.api.SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||||
public void onDimensionUnload(WorldEvent.Unload event)
|
public void onDimensionUnload(WorldEvent.Unload event)
|
||||||
{
|
{
|
||||||
ForgeChunkManager.unloadWorld(event.getWorld());
|
ForgeChunkManager.unloadWorld(event.getWorld());
|
||||||
|
|
|
@ -94,7 +94,7 @@ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
@ -415,7 +415,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@net.minecraftforge.eventbus.api.SubscribeEvent
|
||||||
public void playerLogin(PlayerEvent.PlayerLoggedInEvent event)
|
public void playerLogin(PlayerEvent.PlayerLoggedInEvent event)
|
||||||
{
|
{
|
||||||
UsernameCache.setUsername(event.player.getPersistentID(), event.player.getGameProfile().getName());
|
UsernameCache.setUsername(event.player.getPersistentID(), event.player.getGameProfile().getName());
|
||||||
|
@ -491,7 +491,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@net.minecraftforge.eventbus.api.SubscribeEvent
|
||||||
public void registrItems(RegistryEvent.Register<Item> event)
|
public void registrItems(RegistryEvent.Register<Item> event)
|
||||||
{
|
{
|
||||||
// Add and register the forge universal bucket, if it's enabled
|
// Add and register the forge universal bucket, if it's enabled
|
||||||
|
|
|
@ -21,12 +21,9 @@ package net.minecraftforge.common;
|
||||||
|
|
||||||
import static net.minecraftforge.common.ForgeVersion.Status.*;
|
import static net.minecraftforge.common.ForgeVersion.Status.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -43,6 +40,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
import com.electronwill.nightconfig.core.Config;
|
import com.electronwill.nightconfig.core.Config;
|
||||||
import com.electronwill.nightconfig.core.UnmodifiableConfig;
|
import com.electronwill.nightconfig.core.UnmodifiableConfig;
|
||||||
import com.electronwill.nightconfig.core.path.PathConfig;
|
import com.electronwill.nightconfig.core.path.PathConfig;
|
||||||
|
import net.minecraftforge.fml.VersionChecker;
|
||||||
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion;
|
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion;
|
||||||
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
|
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
|
@ -52,6 +50,7 @@ import org.apache.logging.log4j.Logger;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import net.minecraftforge.fml.common.FMLLog;
|
||||||
import net.minecraftforge.fml.common.InjectedModContainer;
|
import net.minecraftforge.fml.common.InjectedModContainer;
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import net.minecraftforge.fml.common.ModContainer;
|
import net.minecraftforge.fml.common.ModContainer;
|
||||||
|
@ -75,15 +74,9 @@ public class ForgeVersion
|
||||||
public static final String mcVersion = "1.12.2";
|
public static final String mcVersion = "1.12.2";
|
||||||
// This is the MCP data version we're using
|
// This is the MCP data version we're using
|
||||||
public static final String mcpVersion = "9.42";
|
public static final String mcpVersion = "9.42";
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private static Status status = PENDING;
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private static String target = null;
|
|
||||||
|
|
||||||
private static final Logger log = LogManager.getLogger("ForgeVersionCheck");
|
private static final Logger log = LogManager.getLogger("ForgeVersionCheck");
|
||||||
|
|
||||||
private static final int MAX_HTTP_REDIRECTS = Integer.getInteger("http.maxRedirects", 20);
|
|
||||||
|
|
||||||
public static int getMajorVersion()
|
public static int getMajorVersion()
|
||||||
{
|
{
|
||||||
return majorVersion;
|
return majorVersion;
|
||||||
|
@ -104,299 +97,20 @@ public class ForgeVersion
|
||||||
return buildVersion;
|
return buildVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Status getStatus()
|
|
||||||
{
|
|
||||||
return getResult(ForgeModContainer.getInstance()).status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
public static String getTarget()
|
|
||||||
{
|
|
||||||
CheckResult res = getResult(ForgeModContainer.getInstance());
|
|
||||||
return res.target != null ? res.target.toString() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getVersion()
|
public static String getVersion()
|
||||||
{
|
{
|
||||||
return String.format("%d.%d.%d.%d", majorVersion, minorVersion, revisionVersion, buildVersion);
|
return String.format("%d.%d.%d.%d", majorVersion, minorVersion, revisionVersion, buildVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ModInfo> getModInfos()
|
public static VersionChecker.Status getStatus()
|
||||||
{
|
{
|
||||||
PathConfig minecraftmod;
|
return VersionChecker.Status.PENDING;
|
||||||
PathConfig forgemod;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
minecraftmod = PathConfig.of(Paths.get(ForgeVersion.class.getClassLoader().getResource("minecraftmod.toml").toURI()));
|
|
||||||
forgemod = PathConfig.of(Paths.get(ForgeVersion.class.getClassLoader().getResource("forgemod.toml").toURI()));
|
|
||||||
minecraftmod.load();
|
|
||||||
forgemod.load();
|
|
||||||
}
|
|
||||||
catch (URISyntaxException | NullPointerException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException("Missing toml configs for minecraft and forge!", e);
|
|
||||||
}
|
|
||||||
return Arrays.asList(
|
|
||||||
new ModInfo(null, minecraftmod),
|
|
||||||
new ModInfo(null, forgemod)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum Status
|
@Nullable
|
||||||
|
public static String getTarget()
|
||||||
{
|
{
|
||||||
PENDING(),
|
return "";
|
||||||
FAILED(),
|
|
||||||
UP_TO_DATE(),
|
|
||||||
OUTDATED(3, true),
|
|
||||||
AHEAD(),
|
|
||||||
BETA(),
|
|
||||||
BETA_OUTDATED(6, true);
|
|
||||||
|
|
||||||
final int sheetOffset;
|
|
||||||
final boolean draw, animated;
|
|
||||||
|
|
||||||
Status()
|
|
||||||
{
|
|
||||||
this(0, false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
Status(int sheetOffset)
|
|
||||||
{
|
|
||||||
this(sheetOffset, true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
Status(int sheetOffset, boolean animated)
|
|
||||||
{
|
|
||||||
this(sheetOffset, true, animated);
|
|
||||||
}
|
|
||||||
|
|
||||||
Status(int sheetOffset, boolean draw, boolean animated)
|
|
||||||
{
|
|
||||||
this.sheetOffset = sheetOffset;
|
|
||||||
this.draw = draw;
|
|
||||||
this.animated = animated;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSheetOffset()
|
|
||||||
{
|
|
||||||
return sheetOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean shouldDraw()
|
|
||||||
{
|
|
||||||
return draw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAnimated()
|
|
||||||
{
|
|
||||||
return animated;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class CheckResult
|
|
||||||
{
|
|
||||||
public final Status status;
|
|
||||||
@Nullable
|
|
||||||
public final ComparableVersion target;
|
|
||||||
public final Map<ComparableVersion, String> changes;
|
|
||||||
@Nullable
|
|
||||||
public final String url;
|
|
||||||
|
|
||||||
private CheckResult(Status status, @Nullable ComparableVersion target, @Nullable Map<ComparableVersion, String> changes, @Nullable String url)
|
|
||||||
{
|
|
||||||
this.status = status;
|
|
||||||
this.target = target;
|
|
||||||
this.changes = changes == null ? Collections.<ComparableVersion, String>emptyMap() : Collections.unmodifiableMap(changes);
|
|
||||||
this.url = url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void startVersionCheck()
|
|
||||||
{
|
|
||||||
new Thread("Forge Version Check")
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
if (!ForgeModContainer.getConfig().get(ForgeModContainer.VERSION_CHECK_CAT, "Global", true).getBoolean())
|
|
||||||
{
|
|
||||||
log.info("Global Forge version check system disabled, no further processing.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Entry<ModContainer, URL> entry : gatherMods().entrySet())
|
|
||||||
{
|
|
||||||
ModContainer mod = entry.getKey();
|
|
||||||
if (ForgeModContainer.getConfig().get(ForgeModContainer.VERSION_CHECK_CAT, mod.getModId(), true).getBoolean())
|
|
||||||
{
|
|
||||||
process(mod, entry.getValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log.info("[{}] Skipped version check", mod.getModId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Opens stream for given URL while following redirects
|
|
||||||
*/
|
|
||||||
private InputStream openUrlStream(URL url) throws IOException
|
|
||||||
{
|
|
||||||
URL currentUrl = url;
|
|
||||||
for (int redirects = 0; redirects < MAX_HTTP_REDIRECTS; redirects++)
|
|
||||||
{
|
|
||||||
URLConnection c = currentUrl.openConnection();
|
|
||||||
if (c instanceof HttpURLConnection)
|
|
||||||
{
|
|
||||||
HttpURLConnection huc = (HttpURLConnection) c;
|
|
||||||
huc.setInstanceFollowRedirects(false);
|
|
||||||
int responseCode = huc.getResponseCode();
|
|
||||||
if (responseCode >= 300 && responseCode <= 399)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String loc = huc.getHeaderField("Location");
|
|
||||||
currentUrl = new URL(currentUrl, loc);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
huc.disconnect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.getInputStream();
|
|
||||||
}
|
|
||||||
throw new IOException("Too many redirects while trying to fetch " + url);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void process(ModContainer mod, URL url)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
log.info("[{}] Starting version check at {}", mod.getModId(), url.toString());
|
|
||||||
Status status = PENDING;
|
|
||||||
ComparableVersion target = null;
|
|
||||||
|
|
||||||
InputStream con = openUrlStream(url);
|
|
||||||
String data = new String(ByteStreams.toByteArray(con), "UTF-8");
|
|
||||||
con.close();
|
|
||||||
|
|
||||||
log.debug("[{}] Received version check data:\n{}", mod.getModId(), data);
|
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Map<String, Object> json = new Gson().fromJson(data, Map.class);
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Map<String, String> promos = (Map<String, String>)json.get("promos");
|
|
||||||
String display_url = (String)json.get("homepage");
|
|
||||||
|
|
||||||
String rec = promos.get(MinecraftForge.MC_VERSION + "-recommended");
|
|
||||||
String lat = promos.get(MinecraftForge.MC_VERSION + "-latest");
|
|
||||||
ComparableVersion current = new ComparableVersion(mod.getVersion());
|
|
||||||
|
|
||||||
if (rec != null)
|
|
||||||
{
|
|
||||||
ComparableVersion recommended = new ComparableVersion(rec);
|
|
||||||
int diff = recommended.compareTo(current);
|
|
||||||
|
|
||||||
if (diff == 0)
|
|
||||||
status = UP_TO_DATE;
|
|
||||||
else if (diff < 0)
|
|
||||||
{
|
|
||||||
status = AHEAD;
|
|
||||||
if (lat != null)
|
|
||||||
{
|
|
||||||
ComparableVersion latest = new ComparableVersion(lat);
|
|
||||||
if (current.compareTo(latest) < 0)
|
|
||||||
{
|
|
||||||
status = OUTDATED;
|
|
||||||
target = latest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status = OUTDATED;
|
|
||||||
target = recommended;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (lat != null)
|
|
||||||
{
|
|
||||||
ComparableVersion latest = new ComparableVersion(lat);
|
|
||||||
if (current.compareTo(latest) < 0)
|
|
||||||
{
|
|
||||||
status = BETA_OUTDATED;
|
|
||||||
target = latest;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
status = BETA;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
status = BETA;
|
|
||||||
|
|
||||||
log.info("[{}] Found status: {} Target: {}", mod.getModId(), status, target);
|
|
||||||
|
|
||||||
Map<ComparableVersion, String> changes = new LinkedHashMap<ComparableVersion, String>();
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Map<String, String> tmp = (Map<String, String>)json.get(MinecraftForge.MC_VERSION);
|
|
||||||
if (tmp != null)
|
|
||||||
{
|
|
||||||
List<ComparableVersion> ordered = new ArrayList<ComparableVersion>();
|
|
||||||
for (String key : tmp.keySet())
|
|
||||||
{
|
|
||||||
ComparableVersion ver = new ComparableVersion(key);
|
|
||||||
if (ver.compareTo(current) > 0 && (target == null || ver.compareTo(target) < 1))
|
|
||||||
{
|
|
||||||
ordered.add(ver);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Collections.sort(ordered);
|
|
||||||
|
|
||||||
for (ComparableVersion ver : ordered)
|
|
||||||
{
|
|
||||||
changes.put(ver, tmp.get(ver.toString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mod instanceof InjectedModContainer)
|
|
||||||
mod = ((InjectedModContainer)mod).wrappedContainer;
|
|
||||||
results.put(mod, new CheckResult(status, target, changes, display_url));
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.debug("Failed to process update information", e);
|
|
||||||
status = FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gather a list of mods that have opted in to this update system by providing a URL.
|
|
||||||
public static Map<ModContainer, URL> gatherMods()
|
|
||||||
{
|
|
||||||
Map<ModContainer, URL> ret = new HashMap<ModContainer, URL>();
|
|
||||||
for (ModContainer mod : Loader.instance().getActiveModList())
|
|
||||||
{
|
|
||||||
URL url = mod.getUpdateUrl();
|
|
||||||
if (url != null)
|
|
||||||
ret.put(mod, url);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Map<ModContainer, CheckResult> results = new ConcurrentHashMap<ModContainer, CheckResult>();
|
|
||||||
private static final CheckResult PENDING_CHECK = new CheckResult(PENDING, null, null, null);
|
|
||||||
|
|
||||||
public static CheckResult getResult(ModContainer mod)
|
|
||||||
{
|
|
||||||
if (mod == null) return PENDING_CHECK;
|
|
||||||
if (mod instanceof InjectedModContainer)
|
|
||||||
mod = ((InjectedModContainer)mod).wrappedContainer;
|
|
||||||
CheckResult ret = results.get(mod);
|
|
||||||
return ret == null ? PENDING_CHECK : ret;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,14 +24,12 @@ import net.minecraftforge.fml.common.ICrashCallable;
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import net.minecraftforge.fml.common.discovery.ASMDataTable;
|
import net.minecraftforge.fml.common.discovery.ASMDataTable;
|
||||||
import net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData;
|
import net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData;
|
||||||
import net.minecraftforge.fml.common.eventhandler.EventBus;
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Level;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
|
@ -53,9 +51,9 @@ public class MinecraftForge
|
||||||
* ORE_GEN_BUS for ore gen events
|
* ORE_GEN_BUS for ore gen events
|
||||||
* EVENT_BUS for everything else
|
* EVENT_BUS for everything else
|
||||||
*/
|
*/
|
||||||
public static final EventBus EVENT_BUS = new EventBus();
|
public static final IEventBus EVENT_BUS = IEventBus.create();
|
||||||
public static final EventBus TERRAIN_GEN_BUS = new EventBus();
|
public static final IEventBus TERRAIN_GEN_BUS = IEventBus.create();
|
||||||
public static final EventBus ORE_GEN_BUS = new EventBus();
|
public static final IEventBus ORE_GEN_BUS = IEventBus.create();
|
||||||
public static final String MC_VERSION = Loader.MC_VERSION;
|
public static final String MC_VERSION = Loader.MC_VERSION;
|
||||||
|
|
||||||
static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler();
|
static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler();
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.event;
|
package net.minecraftforge.event;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||||
import net.minecraftforge.fml.common.eventhandler.GenericEvent;
|
import net.minecraftforge.eventbus.api.GenericEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired whenever an object with Capabilities support {currently TileEntity/Item/Entity)
|
* Fired whenever an object with Capabilities support {currently TileEntity/Item/Entity)
|
||||||
|
|
|
@ -22,8 +22,8 @@ package net.minecraftforge.event;
|
||||||
import net.minecraft.command.CommandHandler;
|
import net.minecraft.command.CommandHandler;
|
||||||
import net.minecraftforge.client.ClientCommandHandler;
|
import net.minecraftforge.client.ClientCommandHandler;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.command.ICommand;
|
import net.minecraft.command.ICommand;
|
||||||
import net.minecraft.command.ICommandSender;
|
import net.minecraft.command.ICommandSender;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ import net.minecraft.command.ICommandSender;
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public class CommandEvent extends Event
|
public class CommandEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
|
|
||||||
private final ICommand command;
|
private final ICommand command;
|
||||||
|
|
|
@ -19,27 +19,25 @@
|
||||||
|
|
||||||
package net.minecraftforge.event;
|
package net.minecraftforge.event;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import net.minecraft.world.EnumDifficulty;
|
import net.minecraft.world.EnumDifficulty;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DifficultyChangeEvent is fired when difficulty is changing. <br>
|
* DifficultyChangeEvent is fired when difficulty is changing. <br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired via the {@link ForgeHooks#onDifficultyChange(EnumDifficulty, EnumDifficulty)}.<br>
|
* This event is fired via the {@link ForgeHooks#onDifficultyChange(EnumDifficulty, EnumDifficulty)}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.<br>
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
public class DifficultyChangeEvent extends Event
|
public class DifficultyChangeEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final EnumDifficulty difficulty;
|
private final EnumDifficulty difficulty;
|
||||||
private final EnumDifficulty oldDifficulty;
|
private final EnumDifficulty oldDifficulty;
|
||||||
|
|
|
@ -128,8 +128,8 @@ import net.minecraftforge.event.world.ExplosionEvent;
|
||||||
import net.minecraftforge.event.world.GetCollisionBoxesEvent;
|
import net.minecraftforge.event.world.GetCollisionBoxesEvent;
|
||||||
import net.minecraftforge.event.world.WorldEvent;
|
import net.minecraftforge.event.world.WorldEvent;
|
||||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
import net.minecraftforge.eventbus.api.Event.Result;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
@ -737,7 +737,7 @@ public class ForgeEventFactory
|
||||||
{
|
{
|
||||||
ChunkGeneratorEvent.ReplaceBiomeBlocks event = new ChunkGeneratorEvent.ReplaceBiomeBlocks(gen, x, z, primer, world);
|
ChunkGeneratorEvent.ReplaceBiomeBlocks event = new ChunkGeneratorEvent.ReplaceBiomeBlocks(gen, x, z, primer, world);
|
||||||
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
||||||
return event.getResult() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY;
|
return event.getResult() != net.minecraftforge.eventbus.api.Event.Result.DENY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onChunkPopulate(boolean pre, IChunkGenerator gen, World world, Random rand, int x, int z, boolean hasVillageGenerated)
|
public static void onChunkPopulate(boolean pre, IChunkGenerator gen, World world, Random rand, int x, int z, boolean hasVillageGenerated)
|
||||||
|
|
|
@ -22,8 +22,8 @@ package net.minecraftforge.event;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.storage.loot.LootTable;
|
import net.minecraft.world.storage.loot.LootTable;
|
||||||
import net.minecraft.world.storage.loot.LootTableManager;
|
import net.minecraft.world.storage.loot.LootTableManager;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event fired when a LootTable json is loaded from json.
|
* Event fired when a LootTable json is loaded from json.
|
||||||
|
|
|
@ -27,9 +27,7 @@ import org.apache.commons.lang3.Validate;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.fml.common.ModContainer;
|
import net.minecraftforge.fml.common.ModContainer;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.GenericEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.GenericEvent;
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.IContextSetter;
|
|
||||||
import net.minecraftforge.registries.IForgeRegistry;
|
import net.minecraftforge.registries.IForgeRegistry;
|
||||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||||
|
|
||||||
|
@ -37,7 +35,7 @@ import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||||
/**
|
/**
|
||||||
* RegistryEvent supertype.
|
* RegistryEvent supertype.
|
||||||
*/
|
*/
|
||||||
public class RegistryEvent<T extends IForgeRegistryEntry<T>> extends GenericEvent<T> implements IContextSetter
|
public class RegistryEvent<T extends IForgeRegistryEntry<T>> extends GenericEvent<T>
|
||||||
{
|
{
|
||||||
RegistryEvent(Class<T> clazz) {
|
RegistryEvent(Class<T> clazz) {
|
||||||
super(clazz);
|
super(clazz);
|
||||||
|
@ -45,7 +43,7 @@ public class RegistryEvent<T extends IForgeRegistryEntry<T>> extends GenericEven
|
||||||
/**
|
/**
|
||||||
* Register new registries when you receive this event, through the {@link RecipeBuilder}
|
* Register new registries when you receive this event, through the {@link RecipeBuilder}
|
||||||
*/
|
*/
|
||||||
public static class NewRegistry extends Event
|
public static class NewRegistry extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ package net.minecraftforge.event;
|
||||||
import net.minecraft.network.NetHandlerPlayServer;
|
import net.minecraft.network.NetHandlerPlayServer;
|
||||||
import net.minecraft.network.play.client.CPacketChatMessage;
|
import net.minecraft.network.play.client.CPacketChatMessage;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ import net.minecraft.util.text.ITextComponent;
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public class ServerChatEvent extends Event
|
public class ServerChatEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final String message, username;
|
private final String message, username;
|
||||||
private final EntityPlayerMP player;
|
private final EntityPlayerMP player;
|
||||||
|
|
|
@ -23,9 +23,9 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntityBrewingStand;
|
import net.minecraft.tileentity.TileEntityBrewingStand;
|
||||||
import net.minecraft.util.NonNullList;
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public class PotionBrewEvent extends Event
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #stacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.<br>
|
* {@link #stacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If the event is not canceled, the vanilla brewing will take place instead of modded brewing.
|
* If the event is not canceled, the vanilla brewing will take place instead of modded brewing.
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
|
@ -76,7 +76,7 @@ public class PotionBrewEvent extends Event
|
||||||
* <br>
|
* <br>
|
||||||
* If this event is canceled, and items have been modified, PotionBrewEvent.Post will automatically be fired.
|
* If this event is canceled, and items have been modified, PotionBrewEvent.Post will automatically be fired.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class Pre extends PotionBrewEvent
|
public static class Pre extends PotionBrewEvent
|
||||||
{
|
{
|
||||||
public Pre(NonNullList<ItemStack> stacks)
|
public Pre(NonNullList<ItemStack> stacks)
|
||||||
|
@ -92,7 +92,7 @@ public class PotionBrewEvent extends Event
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #stacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.<br>
|
* {@link #stacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.<br>
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
|
|
|
@ -22,7 +22,7 @@ package net.minecraftforge.event.enchanting;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import javax.annotation.Nonnull;
|
||||||
* from 0-15 and indicates how many bookshelves surround the enchanting table. The {@link #itemStack} representing the item being
|
* from 0-15 and indicates how many bookshelves surround the enchanting table. The {@link #itemStack} representing the item being
|
||||||
* enchanted is also available.
|
* enchanted is also available.
|
||||||
*/
|
*/
|
||||||
public class EnchantmentLevelSetEvent extends Event
|
public class EnchantmentLevelSetEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final World world;
|
private final World world;
|
||||||
private final BlockPos pos;
|
private final BlockPos pos;
|
||||||
|
|
|
@ -22,13 +22,13 @@ package net.minecraftforge.event.entity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EntityEvent is fired when an event involving any Entity occurs.<br>
|
* EntityEvent is fired when an event involving any Entity occurs.<br>
|
||||||
* If a method utilizes this {@link Event} as its parameter, the method will
|
* If a method utilizes this {@link net.minecraftforge.eventbus.api.Event} as its parameter, the method will
|
||||||
* receive every child event of this class.<br>
|
* receive every child event of this class.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #entity} contains the entity that caused this event to occur.<br>
|
* {@link #entity} contains the entity that caused this event to occur.<br>
|
||||||
|
@ -53,7 +53,7 @@ public class EntityEvent extends Event
|
||||||
* EntityConstructing is fired when an Entity is being created. <br>
|
* EntityConstructing is fired when an Entity is being created. <br>
|
||||||
* This event is fired within the constructor of the Entity.<br>
|
* This event is fired within the constructor of the Entity.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.<br>
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
|
|
|
@ -21,7 +21,7 @@ package net.minecraftforge.event.entity;
|
||||||
|
|
||||||
import net.minecraft.world.WorldServer;
|
import net.minecraft.world.WorldServer;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ import java.util.Collection;
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class EntityJoinWorldEvent extends EntityEvent
|
public class EntityJoinWorldEvent extends EntityEvent
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -22,15 +22,15 @@ package net.minecraftforge.event.entity;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired whenever a entity mounts/dismounts another entity.<br>
|
* This event gets fired whenever a entity mounts/dismounts another entity.<br>
|
||||||
* <b>entityBeingMounted can be null</b>, be sure to check for that.
|
* <b>entityBeingMounted can be null</b>, be sure to check for that.
|
||||||
* <br>
|
* <br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the entity does not mount/dismount the other entity.<br>
|
* If this event is canceled, the entity does not mount/dismount the other entity.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
|
@ -39,7 +39,7 @@ import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class EntityMountEvent extends EntityEvent
|
public class EntityMountEvent extends EntityEvent
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ package net.minecraftforge.event.entity;
|
||||||
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ import net.minecraft.entity.effect.EntityLightningBolt;
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class EntityStruckByLightningEvent extends EntityEvent
|
public class EntityStruckByLightningEvent extends EntityEvent
|
||||||
{
|
{
|
||||||
private final EntityLightningBolt lightning;
|
private final EntityLightningBolt lightning;
|
||||||
|
|
|
@ -21,15 +21,15 @@ package net.minecraftforge.event.entity;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EntityTravelToDimensionEvent is fired before an Entity travels to a dimension.<br>
|
* EntityTravelToDimensionEvent is fired before an Entity travels to a dimension.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #dimension} contains the id of the dimension the entity is traveling to.<br>
|
* {@link #dimension} contains the id of the dimension the entity is traveling to.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the Entity does not travel to the dimension.<br>
|
* If this event is canceled, the Entity does not travel to the dimension.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
|
|
|
@ -21,10 +21,9 @@ package net.minecraftforge.event.entity;
|
||||||
|
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.SoundCategory;
|
import net.minecraft.util.SoundCategory;
|
||||||
import net.minecraft.util.SoundEvent;
|
import net.minecraft.util.SoundEvent;
|
||||||
|
@ -48,7 +47,7 @@ import net.minecraft.util.SoundEvent;
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class PlaySoundAtEntityEvent extends EntityEvent
|
public class PlaySoundAtEntityEvent extends EntityEvent
|
||||||
{
|
{
|
||||||
private SoundEvent name;
|
private SoundEvent name;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import net.minecraft.entity.projectile.EntityThrowable;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event is fired when a projectile entity impacts something.
|
* This event is fired when a projectile entity impacts something.
|
||||||
|
|
|
@ -21,7 +21,7 @@ package net.minecraftforge.event.entity;
|
||||||
|
|
||||||
import net.minecraft.entity.projectile.EntityThrowable;
|
import net.minecraft.entity.projectile.EntityThrowable;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event is fired before an {@link EntityThrowable} calls its {@link EntityThrowable#onImpact} method.
|
* This event is fired before an {@link EntityThrowable} calls its {@link EntityThrowable#onImpact} method.
|
||||||
|
@ -33,7 +33,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
* @deprecated use {@link ProjectileImpactEvent.Throwable}
|
* @deprecated use {@link ProjectileImpactEvent.Throwable}
|
||||||
*/
|
*/
|
||||||
@Deprecated // TODO: remove (1.13)
|
@Deprecated // TODO: remove (1.13)
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class ThrowableImpactEvent extends EntityEvent
|
public class ThrowableImpactEvent extends EntityEvent
|
||||||
{
|
{
|
||||||
private final EntityThrowable throwable;
|
private final EntityThrowable throwable;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.item;
|
package net.minecraftforge.event.entity.item;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.item;
|
package net.minecraftforge.event.entity.item;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
|
|
@ -23,16 +23,16 @@ import net.minecraft.entity.passive.EntityAnimal;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event is fired when an {@link EntityAnimal} is tamed. <br>
|
* This event is fired when an {@link EntityAnimal} is tamed. <br>
|
||||||
* It is fired via {@link ForgeEventFactory#onAnimalTame(EntityAnimal, EntityPlayer)}.
|
* It is fired via {@link ForgeEventFactory#onAnimalTame(EntityAnimal, EntityPlayer)}.
|
||||||
* Forge fires this event for applicable vanilla animals, mods need to fire it themselves.
|
* Forge fires this event for applicable vanilla animals, mods need to fire it themselves.
|
||||||
* This event is {@link Cancelable}. If canceled, taming the animal will fail.
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}. If canceled, taming the animal will fail.
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class AnimalTameEvent extends LivingEvent
|
public class AnimalTameEvent extends LivingEvent
|
||||||
{
|
{
|
||||||
private final EntityAnimal animal;
|
private final EntityAnimal animal;
|
||||||
|
|
|
@ -26,8 +26,8 @@ import net.minecraft.entity.ai.EntityAIVillagerMate;
|
||||||
import net.minecraft.entity.passive.EntityAnimal;
|
import net.minecraft.entity.passive.EntityAnimal;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,7 +50,7 @@ import javax.annotation.Nullable;
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@Cancelable
|
||||||
public class BabyEntitySpawnEvent extends Event
|
public class BabyEntitySpawnEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final EntityLiving parentA;
|
private final EntityLiving parentA;
|
||||||
private final EntityLiving parentB;
|
private final EntityLiving parentB;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.living;
|
package net.minecraftforge.event.entity.living;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,7 +22,7 @@ package net.minecraftforge.event.entity.living;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
@ -37,14 +37,14 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
* {@link #source} contains the DamageSource of the attack. <br>
|
* {@link #source} contains the DamageSource of the attack. <br>
|
||||||
* {@link #amount} contains the amount of damage dealt to the entity. <br>
|
* {@link #amount} contains the amount of damage dealt to the entity. <br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the Entity does not take attack damage.<br>
|
* If this event is canceled, the Entity does not take attack damage.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
*<br>
|
*<br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class LivingAttackEvent extends LivingEvent
|
public class LivingAttackEvent extends LivingEvent
|
||||||
{
|
{
|
||||||
private final DamageSource source;
|
private final DamageSource source;
|
||||||
|
|
|
@ -21,7 +21,7 @@ package net.minecraftforge.event.entity.living;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
* {@link #source} contains the DamageSource that caused this Entity to be hurt. <br>
|
* {@link #source} contains the DamageSource that caused this Entity to be hurt. <br>
|
||||||
* {@link #amount} contains the final amount of damage that will be dealt to entity. <br>
|
* {@link #amount} contains the final amount of damage that will be dealt to entity. <br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the Entity is not hurt. Used resources WILL NOT be restored.<br>
|
* If this event is canceled, the Entity is not hurt. Used resources WILL NOT be restored.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
|
|
@ -26,19 +26,19 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when the ender dragon or wither attempts to destroy a block and when ever a zombie attempts to break a door. Basically a event version of {@link Block#canEntityDestroy(IBlockState, IBlockAccess, BlockPos, Entity)}<br>
|
* Fired when the ender dragon or wither attempts to destroy a block and when ever a zombie attempts to break a door. Basically a event version of {@link Block#canEntityDestroy(IBlockState, IBlockAccess, BlockPos, Entity)}<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the block will not be destroyed.<br>
|
* If this event is canceled, the block will not be destroyed.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class LivingDestroyBlockEvent extends LivingEvent
|
public class LivingDestroyBlockEvent extends LivingEvent
|
||||||
{
|
{
|
||||||
private final BlockPos pos;
|
private final BlockPos pos;
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.util.List;
|
||||||
|
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -48,7 +48,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class LivingDropsEvent extends LivingEvent
|
public class LivingDropsEvent extends LivingEvent
|
||||||
{
|
{
|
||||||
private final DamageSource source;
|
private final DamageSource source;
|
||||||
|
|
|
@ -21,7 +21,7 @@ package net.minecraftforge.event.entity.living;
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.living;
|
package net.minecraftforge.event.entity.living;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.monster.EntityMagmaCube;
|
import net.minecraft.entity.monster.EntityMagmaCube;
|
||||||
import net.minecraft.entity.passive.EntityHorse;
|
import net.minecraft.entity.passive.EntityHorse;
|
||||||
|
@ -30,7 +30,7 @@ import net.minecraftforge.event.entity.EntityEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LivingEvent is fired whenever an event involving Living entities occurs.<br>
|
* LivingEvent is fired whenever an event involving Living entities occurs.<br>
|
||||||
* If a method utilizes this {@link Event} as its parameter, the method will
|
* If a method utilizes this {@link net.minecraftforge.eventbus.api.Event} as its parameter, the method will
|
||||||
* receive every child event of this class.<br>
|
* receive every child event of this class.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||||
|
|
|
@ -21,14 +21,14 @@ package net.minecraftforge.event.entity.living;
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event for when an entity drops experience on its death, can be used to change
|
* Event for when an entity drops experience on its death, can be used to change
|
||||||
* the amount of experience points dropped or completely prevent dropping of experience
|
* the amount of experience points dropped or completely prevent dropping of experience
|
||||||
* by canceling the event.
|
* by canceling the event.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class LivingExperienceDropEvent extends LivingEvent
|
public class LivingExperienceDropEvent extends LivingEvent
|
||||||
{
|
{
|
||||||
private final EntityPlayer attackingPlayer;
|
private final EntityPlayer attackingPlayer;
|
||||||
|
|
|
@ -21,7 +21,7 @@ package net.minecraftforge.event.entity.living;
|
||||||
|
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,14 +33,14 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #distance} contains the distance the Entity is to fall. If this event is canceled, this value is set to 0.0F.
|
* {@link #distance} contains the distance the Entity is to fall. If this event is canceled, this value is set to 0.0F.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the Entity does not fall.<br>
|
* If this event is canceled, the Entity does not fall.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class LivingFallEvent extends LivingEvent
|
public class LivingFallEvent extends LivingEvent
|
||||||
{
|
{
|
||||||
private float distance;
|
private float distance;
|
||||||
|
|
|
@ -21,7 +21,7 @@ package net.minecraftforge.event.entity.living;
|
||||||
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,14 +32,14 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #amount} contains the amount of healing done to the Entity that was healed. <br>
|
* {@link #amount} contains the amount of healing done to the Entity that was healed. <br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the Entity is not healed.<br>
|
* If this event is canceled, the Entity is not healed.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class LivingHealEvent extends LivingEvent
|
public class LivingHealEvent extends LivingEvent
|
||||||
{
|
{
|
||||||
private float amount;
|
private float amount;
|
||||||
|
|
|
@ -22,7 +22,7 @@ package net.minecraftforge.event.entity.living;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
* @see LivingDamageEvent
|
* @see LivingDamageEvent
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class LivingHurtEvent extends LivingEvent
|
public class LivingHurtEvent extends LivingEvent
|
||||||
{
|
{
|
||||||
private final DamageSource source;
|
private final DamageSource source;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LivingKnockBackEvent is fired when a living entity is about to be knocked back. <br>
|
* LivingKnockBackEvent is fired when a living entity is about to be knocked back. <br>
|
||||||
|
@ -43,7 +43,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
* {@link #ratioX} contains the x ratio of the knock back. <br>
|
* {@link #ratioX} contains the x ratio of the knock back. <br>
|
||||||
* {@link #ratioZ} contains the z ratio of the knock back. <br>
|
* {@link #ratioZ} contains the z ratio of the knock back. <br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the entity is not knocked back.<br>
|
* If this event is canceled, the entity is not knocked back.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.living;
|
package net.minecraftforge.event.entity.living;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
|
|
||||||
@HasResult
|
@HasResult
|
||||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LivingSetAttackTargetEvent is fired when an Entity sets a target to attack.<br>
|
* LivingSetAttackTargetEvent is fired when an Entity sets a target to attack.<br>
|
||||||
|
@ -35,7 +35,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #target} contains the newly targeted Entity.<br>
|
* {@link #target} contains the newly targeted Entity.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.<br>
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
|
|
|
@ -21,11 +21,10 @@ package net.minecraftforge.event.entity.living;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import net.minecraft.tileentity.MobSpawnerBaseLogic;
|
import net.minecraft.tileentity.MobSpawnerBaseLogic;
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@ -142,14 +141,14 @@ public class LivingSpawnEvent extends LivingEvent
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired via the {@link ForgeEventFactory#doSpecialSpawn(EntityLiving, World, float, float, float)}.<br>
|
* This event is fired via the {@link ForgeEventFactory#doSpecialSpawn(EntityLiving, World, float, float, float)}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the Entity is not spawned.<br>
|
* If this event is canceled, the Entity is not spawned.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class SpecialSpawn extends LivingSpawnEvent
|
public static class SpecialSpawn extends LivingSpawnEvent
|
||||||
{
|
{
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|
|
@ -23,16 +23,15 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.monster.EntityZombie;
|
import net.minecraft.entity.monster.EntityZombie;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.event.entity.EntityEvent;
|
import net.minecraftforge.event.entity.EntityEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ZombieEvent is fired whenever a zombie is spawned for aid.
|
* ZombieEvent is fired whenever a zombie is spawned for aid.
|
||||||
* If a method utilizes this {@link Event} as its parameter, the method will
|
* If a method utilizes this {@link Event} as its parameter, the method will
|
||||||
* receive every child event of this class.
|
* receive every child event of this class.
|
||||||
*
|
*
|
||||||
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
|
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
|
@ -64,7 +63,7 @@ public class ZombieEvent extends EntityEvent {
|
||||||
* {@link #attacker} contains the living Entity that attacked and caused this event to fire.
|
* {@link #attacker} contains the living Entity that attacked and caused this event to fire.
|
||||||
* {@link #summonChance} contains the likelihood that a Zombie would successfully be summoned.
|
* {@link #summonChance} contains the likelihood that a Zombie would successfully be summoned.
|
||||||
*
|
*
|
||||||
* This event is not {@link Cancelable}.
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.
|
||||||
*
|
*
|
||||||
* This event has a result. {@link HasResult}
|
* This event has a result. {@link HasResult}
|
||||||
* {@link Result#ALLOW} Zombie is summoned.
|
* {@link Result#ALLOW} Zombie is summoned.
|
||||||
|
|
|
@ -22,7 +22,7 @@ package net.minecraftforge.event.entity.minecart;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
import net.minecraft.entity.item.EntityMinecart;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MinecartCollisionEvent is fired when a minecart collides with an Entity.
|
* MinecartCollisionEvent is fired when a minecart collides with an Entity.
|
||||||
|
|
|
@ -22,11 +22,11 @@ package net.minecraftforge.event.entity.minecart;
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
import net.minecraft.entity.item.EntityMinecart;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.entity.EntityEvent;
|
import net.minecraftforge.event.entity.EntityEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MinecartEvent is fired whenever an event involving minecart entities occurs. <br>
|
* MinecartEvent is fired whenever an event involving minecart entities occurs. <br>
|
||||||
* If a method utilizes this {@link Event} as its parameter, the method will <br>
|
* If a method utilizes this {@link net.minecraftforge.eventbus.api.Event} as its parameter, the method will <br>
|
||||||
* receive every child event of this class.<br>
|
* receive every child event of this class.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #minecart} contains the minecart entity involved with this event.<br>
|
* {@link #minecart} contains the minecart entity involved with this event.<br>
|
||||||
|
|
|
@ -19,12 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.minecart;
|
package net.minecraftforge.event.entity.minecart;
|
||||||
|
|
||||||
import net.minecraft.entity.item.EntityMinecartContainer;
|
|
||||||
import net.minecraft.entity.item.EntityMinecartEmpty;
|
|
||||||
import net.minecraft.entity.item.EntityMinecartFurnace;
|
|
||||||
import net.minecraft.entity.item.EntityMinecartHopper;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
import net.minecraft.entity.item.EntityMinecart;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -40,14 +36,14 @@ import javax.annotation.Nonnull;
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #player} contains the EntityPlayer that is involved with this minecart interaction.<br>
|
* {@link #player} contains the EntityPlayer that is involved with this minecart interaction.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the player does not interact with the minecart.<br>
|
* If this event is canceled, the player does not interact with the minecart.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class MinecartInteractEvent extends MinecartEvent
|
public class MinecartInteractEvent extends MinecartEvent
|
||||||
{
|
{
|
||||||
private final EntityPlayer player;
|
private final EntityPlayer player;
|
||||||
|
|
|
@ -22,7 +22,7 @@ package net.minecraftforge.event.entity.minecart;
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
import net.minecraft.entity.item.EntityMinecart;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MinecartUpdateEvent is fired when a minecart is updated.<br>
|
* MinecartUpdateEvent is fired when a minecart is updated.<br>
|
||||||
|
@ -31,7 +31,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #pos} contains the coordinate of the track the entity is on {if applicable}.<br>
|
* {@link #pos} contains the coordinate of the track the entity is on {if applicable}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.<br>
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
|
|
|
@ -22,12 +22,12 @@ package net.minecraftforge.event.entity.player;
|
||||||
import net.minecraft.advancements.Advancement;
|
import net.minecraft.advancements.Advancement;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event is fired when a player gets an advancement.
|
* This event is fired when a player gets an advancement.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.<br>
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
|
|
|
@ -22,7 +22,7 @@ package net.minecraftforge.event.entity.player;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.item.ItemBow;
|
import net.minecraft.item.ItemBow;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -37,14 +37,14 @@ import javax.annotation.Nonnull;
|
||||||
* {@link #bow} contains the ItemBow ItemStack that was used in this event.<br>
|
* {@link #bow} contains the ItemBow ItemStack that was used in this event.<br>
|
||||||
* {@link #charge} contains the value for how much the player had charged before stopping the shot.<br>
|
* {@link #charge} contains the value for how much the player had charged before stopping the shot.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If this event is canceled, the player does not stop using the bow.<br>
|
* If this event is canceled, the player does not stop using the bow.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
**/
|
**/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class ArrowLooseEvent extends PlayerEvent
|
public class ArrowLooseEvent extends PlayerEvent
|
||||||
{
|
{
|
||||||
private final ItemStack bow;
|
private final ItemStack bow;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
package net.minecraftforge.event.entity.player;
|
package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.player;
|
package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -41,7 +41,7 @@ import javax.annotation.Nullable;
|
||||||
* setResult(ALLOW) is the same as the old setHandled()
|
* setResult(ALLOW) is the same as the old setHandled()
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@Cancelable
|
||||||
@Event.HasResult
|
@net.minecraftforge.eventbus.api.Event.HasResult
|
||||||
public class BonemealEvent extends PlayerEvent
|
public class BonemealEvent extends PlayerEvent
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.player;
|
package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.player;
|
package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.player;
|
package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
|
@ -38,7 +38,7 @@ import javax.annotation.Nullable;
|
||||||
* ItemStack to your inventory and reducing the stack size to process.
|
* ItemStack to your inventory and reducing the stack size to process.
|
||||||
* setResult(ALLOW) is the same as the old setHandled();
|
* setResult(ALLOW) is the same as the old setHandled();
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
@Event.HasResult
|
@Event.HasResult
|
||||||
public class FillBucketEvent extends PlayerEvent
|
public class FillBucketEvent extends PlayerEvent
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@ import com.google.common.base.Preconditions;
|
||||||
import net.minecraft.entity.projectile.EntityFishHook;
|
import net.minecraft.entity.projectile.EntityFishHook;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.NonNullList;
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
import javax.annotation.Nonnegative;
|
import javax.annotation.Nonnegative;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -31,11 +31,11 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* This event is called when a player fishes an item.
|
* This event is called when a player fishes an item.
|
||||||
*
|
*
|
||||||
* This event is {@link net.minecraftforge.fml.common.eventhandler.Cancelable}
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}
|
||||||
* Canceling the event will cause the player to receive no items at all.
|
* Canceling the event will cause the player to receive no items at all.
|
||||||
* The hook will still take the damage specified
|
* The hook will still take the damage specified
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class ItemFishedEvent extends PlayerEvent
|
public class ItemFishedEvent extends PlayerEvent
|
||||||
{
|
{
|
||||||
private final NonNullList<ItemStack> stacks = NonNullList.create();
|
private final NonNullList<ItemStack> stacks = NonNullList.create();
|
||||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
|
|
|
@ -22,7 +22,7 @@ package net.minecraftforge.event.entity.player;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -34,7 +34,7 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||||
* player dies. Canceling the event will prevent ALL drops from entering the
|
* player dies. Canceling the event will prevent ALL drops from entering the
|
||||||
* world.
|
* world.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class PlayerDropsEvent extends LivingDropsEvent
|
public class PlayerDropsEvent extends LivingDropsEvent
|
||||||
{
|
{
|
||||||
private final EntityPlayer entityPlayer;
|
private final EntityPlayer entityPlayer;
|
||||||
|
|
|
@ -23,18 +23,17 @@ import java.io.File;
|
||||||
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PlayerEvent is fired whenever an event involving Living entities occurs. <br>
|
* PlayerEvent is fired whenever an event involving Living entities occurs. <br>
|
||||||
* If a method utilizes this {@link Event} as its parameter, the method will
|
* If a method utilizes this {@link net.minecraftforge.eventbus.api.Event} as its parameter, the method will
|
||||||
* receive every child event of this class.<br>
|
* receive every child event of this class.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
|
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
|
@ -63,7 +62,7 @@ public class PlayerEvent extends LivingEvent
|
||||||
* {@link #state} contains the {@link IBlockState} that is being checked for harvesting. <br>
|
* {@link #state} contains the {@link IBlockState} that is being checked for harvesting. <br>
|
||||||
* {@link #success} contains the boolean value for whether the Block will be successfully harvested. <br>
|
* {@link #success} contains the boolean value for whether the Block will be successfully harvested. <br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.<br>
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
* <br>
|
* <br>
|
||||||
|
@ -98,7 +97,7 @@ public class PlayerEvent extends LivingEvent
|
||||||
* {@link #newSpeed} contains the newSpeed at which the player will break the block. <br>
|
* {@link #newSpeed} contains the newSpeed at which the player will break the block. <br>
|
||||||
* {@link #pos} contains the coordinates at which this event is occurring. Y value -1 means location is unknown.<br>
|
* {@link #pos} contains the coordinates at which this event is occurring. Y value -1 means location is unknown.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link Cancelable}.<br>
|
* This event is {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
|
||||||
* If it is canceled, the player is unable to break the block.<br>
|
* If it is canceled, the player is unable to break the block.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}<br>
|
* This event does not have a result. {@link HasResult}<br>
|
||||||
|
@ -139,7 +138,7 @@ public class PlayerEvent extends LivingEvent
|
||||||
* {@link #username} contains the username of the player.
|
* {@link #username} contains the username of the player.
|
||||||
* {@link #displayname} contains the display name of the player.
|
* {@link #displayname} contains the display name of the player.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}
|
* This event does not have a result. {@link HasResult}
|
||||||
* <br>
|
* <br>
|
||||||
|
|
|
@ -30,14 +30,14 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import static net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT;
|
import static net.minecraftforge.eventbus.api.Event.Result.DEFAULT;
|
||||||
import static net.minecraftforge.fml.common.eventhandler.Event.Result.DENY;
|
import static net.minecraftforge.eventbus.api.Event.Result.DENY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PlayerInteractEvent is fired when a player interacts in some way.
|
* PlayerInteractEvent is fired when a player interacts in some way.
|
||||||
|
@ -69,7 +69,7 @@ public class PlayerInteractEvent extends PlayerEvent
|
||||||
* Let result be the return value of {@link Entity#applyPlayerInteraction}, or {@link #cancellationResult} if the event is cancelled.
|
* Let result be the return value of {@link Entity#applyPlayerInteraction}, or {@link #cancellationResult} if the event is cancelled.
|
||||||
* If we are on the client and result is not {@link EnumActionResult#SUCCESS}, the client will then try {@link EntityInteract}.
|
* If we are on the client and result is not {@link EnumActionResult#SUCCESS}, the client will then try {@link EntityInteract}.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class EntityInteractSpecific extends PlayerInteractEvent
|
public static class EntityInteractSpecific extends PlayerInteractEvent
|
||||||
{
|
{
|
||||||
private final Vec3d localPos;
|
private final Vec3d localPos;
|
||||||
|
@ -110,7 +110,7 @@ public class PlayerInteractEvent extends PlayerEvent
|
||||||
* or {@link #cancellationResult} if the event is cancelled.
|
* or {@link #cancellationResult} if the event is cancelled.
|
||||||
* If we are on the client and result is not {@link EnumActionResult#SUCCESS}, the client will then try {@link RightClickItem}.
|
* If we are on the client and result is not {@link EnumActionResult#SUCCESS}, the client will then try {@link RightClickItem}.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class EntityInteract extends PlayerInteractEvent
|
public static class EntityInteract extends PlayerInteractEvent
|
||||||
{
|
{
|
||||||
private final Entity target;
|
private final Entity target;
|
||||||
|
@ -248,7 +248,7 @@ public class PlayerInteractEvent extends PlayerEvent
|
||||||
* Also note that creative mode directly breaks the block without running any other logic.
|
* Also note that creative mode directly breaks the block without running any other logic.
|
||||||
* Therefore, in creative mode, {@link #setUseBlock} and {@link #setUseItem} have no effect.
|
* Therefore, in creative mode, {@link #setUseBlock} and {@link #setUseItem} have no effect.
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public static class LeftClickBlock extends PlayerInteractEvent
|
public static class LeftClickBlock extends PlayerInteractEvent
|
||||||
{
|
{
|
||||||
private Result useBlock = DEFAULT;
|
private Result useBlock = DEFAULT;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.player;
|
package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.item.EntityXPOrb;
|
import net.minecraft.entity.item.EntityXPOrb;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.entity.player;
|
package net.minecraftforge.event.entity.player;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
@Cancelable
|
@net.minecraftforge.eventbus.api.Cancelable
|
||||||
public class PlayerSetSpawnEvent extends PlayerEvent
|
public class PlayerSetSpawnEvent extends PlayerEvent
|
||||||
{
|
{
|
||||||
private final boolean forced;
|
private final boolean forced;
|
||||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayer.SleepResult;
|
import net.minecraft.entity.player.EntityPlayer.SleepResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PlayerSleepInBedEvent is fired when a player sleeps in a bed.
|
* PlayerSleepInBedEvent is fired when a player sleeps in a bed.
|
||||||
|
@ -33,7 +33,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||||
* <br>
|
* <br>
|
||||||
* {@link #result} contains whether the player is able to sleep. <br>
|
* {@link #result} contains whether the player is able to sleep. <br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}
|
* This event does not have a result. {@link HasResult}
|
||||||
* <br>
|
* <br>
|
||||||
|
|
|
@ -25,7 +25,7 @@ import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event is fired when game checks, if sleeping player should be still considered "in bed".<br>
|
* This event is fired when game checks, if sleeping player should be still considered "in bed".<br>
|
||||||
|
|
|
@ -23,8 +23,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ import javax.annotation.Nonnull;
|
||||||
* setResult(ALLOW) is the same as the old setHandled();
|
* setResult(ALLOW) is the same as the old setHandled();
|
||||||
*/
|
*/
|
||||||
@Cancelable
|
@Cancelable
|
||||||
@Event.HasResult
|
@net.minecraftforge.eventbus.api.Event.HasResult
|
||||||
public class UseHoeEvent extends PlayerEvent
|
public class UseHoeEvent extends PlayerEvent
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link FurnaceFuelBurnTimeEvent} is fired when determining the fuel value for an ItemStack. <br>
|
* {@link FurnaceFuelBurnTimeEvent} is fired when determining the fuel value for an ItemStack. <br>
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
package net.minecraftforge.event.terraingen;
|
package net.minecraftforge.event.terraingen;
|
||||||
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.world.biome.BiomeDecorator;
|
import net.minecraft.world.biome.BiomeDecorator;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
|
@ -34,7 +34,7 @@ import net.minecraft.world.biome.Biome;
|
||||||
* All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}
|
* All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}
|
||||||
* unless stated otherwise in their Javadocs.
|
* unless stated otherwise in their Javadocs.
|
||||||
**/
|
**/
|
||||||
public class BiomeEvent extends Event
|
public class BiomeEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final Biome biome;
|
private final Biome biome;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class BiomeEvent extends Event
|
||||||
* {@link #originalBiomeDecorator} contains the original BiomeDecorator that would be used in vanilla.
|
* {@link #originalBiomeDecorator} contains the original BiomeDecorator that would be used in vanilla.
|
||||||
* {@link #newBiomeDecorator} contains the new BiomeDecoration to be used by Minecraft.
|
* {@link #newBiomeDecorator} contains the new BiomeDecoration to be used by Minecraft.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}
|
* This event does not have a result. {@link HasResult}
|
||||||
* <br>
|
* <br>
|
||||||
|
@ -92,7 +92,7 @@ public class BiomeEvent extends Event
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BiomeColor is fired whenever an event involving biome colors occurs. <br>
|
* BiomeColor is fired whenever an event involving biome colors occurs. <br>
|
||||||
* If a method utilizes this {@link Event} as its parameter, the method will
|
* If a method utilizes this {@link net.minecraftforge.eventbus.api.Event} as its parameter, the method will
|
||||||
* receive every child event of this class.<br>
|
* receive every child event of this class.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
|
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||||
|
|
|
@ -19,12 +19,12 @@
|
||||||
|
|
||||||
package net.minecraftforge.event.terraingen;
|
package net.minecraftforge.event.terraingen;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
import net.minecraft.world.chunk.ChunkPrimer;
|
||||||
import net.minecraft.world.gen.IChunkGenerator;
|
import net.minecraft.world.gen.IChunkGenerator;
|
||||||
|
|
||||||
public class ChunkGeneratorEvent extends Event
|
public class ChunkGeneratorEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
private final IChunkGenerator gen;
|
private final IChunkGenerator gen;
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,11 @@ import net.minecraft.util.math.ChunkPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DecorateBiomeEvent is fired when a BiomeDecorator is created.
|
* DecorateBiomeEvent is fired when a BiomeDecorator is created.
|
||||||
|
@ -41,7 +44,7 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
* {@link #rand} contains an instance of Random to be used. <br>
|
* {@link #rand} contains an instance of Random to be used. <br>
|
||||||
* {@link #chunkPos} contains the original chunk for the decorator. <br>
|
* {@link #chunkPos} contains the original chunk for the decorator. <br>
|
||||||
* <br>
|
* <br>
|
||||||
* This event is not {@link Cancelable}.
|
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.
|
||||||
* <br>
|
* <br>
|
||||||
* This event does not have a result. {@link HasResult}
|
* This event does not have a result. {@link HasResult}
|
||||||
* <br>
|
* <br>
|
||||||
|
@ -51,28 +54,15 @@ public class DecorateBiomeEvent extends Event
|
||||||
{
|
{
|
||||||
private final World world;
|
private final World world;
|
||||||
private final Random rand;
|
private final Random rand;
|
||||||
/** @deprecated use {@link #chunkPos} */
|
|
||||||
@Deprecated // TODO remove in 1.13
|
|
||||||
private final BlockPos pos;
|
|
||||||
private final ChunkPos chunkPos;
|
private final ChunkPos chunkPos;
|
||||||
|
|
||||||
public DecorateBiomeEvent(World world, Random rand, ChunkPos chunkPos)
|
public DecorateBiomeEvent(World world, Random rand, ChunkPos chunkPos)
|
||||||
{
|
{
|
||||||
this.world = world;
|
this.world = world;
|
||||||
this.rand = rand;
|
this.rand = rand;
|
||||||
this.pos = chunkPos.getBlock(0, 0, 0);
|
|
||||||
this.chunkPos = chunkPos;
|
this.chunkPos = chunkPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated // TODO: remove in 1.13
|
|
||||||
public DecorateBiomeEvent(World world, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
this.world = world;
|
|
||||||
this.rand = rand;
|
|
||||||
this.pos = pos;
|
|
||||||
this.chunkPos = new ChunkPos(pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
public World getWorld()
|
public World getWorld()
|
||||||
{
|
{
|
||||||
return world;
|
return world;
|
||||||
|
@ -83,15 +73,6 @@ public class DecorateBiomeEvent extends Event
|
||||||
return rand;
|
return rand;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated use {@link #getChunkPos()} or {@link Decorate#getPlacementPos} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public BlockPos getPos()
|
|
||||||
{
|
|
||||||
return pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChunkPos getChunkPos()
|
public ChunkPos getChunkPos()
|
||||||
{
|
{
|
||||||
return chunkPos;
|
return chunkPos;
|
||||||
|
@ -106,12 +87,6 @@ public class DecorateBiomeEvent extends Event
|
||||||
{
|
{
|
||||||
super(world, rand, chunkPos);
|
super(world, rand, chunkPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated // TODO: remove in 1.13
|
|
||||||
public Pre(World world, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
this(world, rand, new ChunkPos(pos));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -123,12 +98,6 @@ public class DecorateBiomeEvent extends Event
|
||||||
{
|
{
|
||||||
super(world, rand, chunkPos);
|
super(world, rand, chunkPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated //TODO: remove in 1.13
|
|
||||||
public Post(World world, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
this(world, rand, new ChunkPos(pos));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -158,14 +127,6 @@ public class DecorateBiomeEvent extends Event
|
||||||
this.placementPos = placementPos;
|
this.placementPos = placementPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated // TODO: remove in 1.13
|
|
||||||
public Decorate(World world, Random rand, BlockPos pos, EventType type)
|
|
||||||
{
|
|
||||||
super(world, rand, pos);
|
|
||||||
this.type = type;
|
|
||||||
this.placementPos = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EventType getType()
|
public EventType getType()
|
||||||
{
|
{
|
||||||
return type;
|
return type;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue