mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Removed RenderWorldEvent, encapsulated all public event fields.
This commit is contained in:
1 parent
08c00662a0
commit
756c58d5cb
110 files changed
+1642
-680
No files matched your search
@@ -22,7 +22,7 @@ public class EntityTravelToDimensionEventTest
|
||||
public void onDimensionTravel(EntityTravelToDimensionEvent event)
|
||||
{
|
||||
if(ENABLE) {
|
||||
System.out.println("Travelling to Dimension " + event.dimension);
|
||||
System.out.println("Travelling to Dimension " + event.getDimension());
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class NeighborNotifyEventTest
|
||||
public void onNeighborNotify(NeighborNotifyEvent event)
|
||||
{
|
||||
if(ENABLE) {
|
||||
System.out.println(event.pos.toString());
|
||||
System.out.println(event.getPos().toString());
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class NoBedSleepingTest
|
||||
@SubscribeEvent
|
||||
public void onBedCheck(SleepingLocationCheckEvent evt)
|
||||
{
|
||||
final IExtraSleeping sleep = evt.entityPlayer.getCapability(SLEEP_CAP, null);
|
||||
final IExtraSleeping sleep = evt.getEntityPlayer().getCapability(SLEEP_CAP, null);
|
||||
if (sleep != null && sleep.isSleeping())
|
||||
evt.setResult(Result.ALLOW);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class NoBedSleepingTest
|
||||
@SubscribeEvent
|
||||
public void onWakeUp(PlayerWakeUpEvent evt)
|
||||
{
|
||||
final IExtraSleeping sleep = evt.entityPlayer.getCapability(SLEEP_CAP, null);
|
||||
final IExtraSleeping sleep = evt.getEntityPlayer().getCapability(SLEEP_CAP, null);
|
||||
if (sleep != null)
|
||||
sleep.setSleeping(false);
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ public class PlayerInteractEventLocalTest
|
||||
@SubscribeEvent
|
||||
public void onPlayerInteract(PlayerInteractEvent event)
|
||||
{
|
||||
if(ENABLE && event.localPos != null) {
|
||||
System.out.println(event.localPos.toString());
|
||||
if(ENABLE && event.getLocalPos() != null) {
|
||||
System.out.println(event.getLocalPos().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class PlayerSetSpawnTest {
|
||||
@SubscribeEvent
|
||||
public void onPlayerSetSpawn(PlayerSetSpawnEvent event)
|
||||
{
|
||||
System.out.println(event.forced + " " + event.newSpawn.toString());
|
||||
System.out.println(event.isForced() + " " + event.getNewSpawn().toString());
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
@@ -44,21 +44,21 @@ public class TestCapabilityMod
|
||||
@SubscribeEvent
|
||||
public void onInteract(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
|
||||
if (event.entityPlayer.inventory.getCurrentItem() == null) return;
|
||||
if (event.entityPlayer.inventory.getCurrentItem().getItem() != Items.stick) return;
|
||||
if (event.getAction() != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
|
||||
if (event.getEntityPlayer().inventory.getCurrentItem() == null) return;
|
||||
if (event.getEntityPlayer().inventory.getCurrentItem().getItem() != Items.stick) return;
|
||||
|
||||
// This is just a example of how to interact with the TE, note the strong type binding that getCapability has
|
||||
TileEntity te = event.world.getTileEntity(event.pos);
|
||||
if (te != null && te.hasCapability(TEST_CAP, event.face))
|
||||
TileEntity te = event.getWorld().getTileEntity(event.getPos());
|
||||
if (te != null && te.hasCapability(TEST_CAP, event.getFace()))
|
||||
{
|
||||
event.setCanceled(true);
|
||||
IExampleCapability inv = te.getCapability(TEST_CAP, event.face);
|
||||
IExampleCapability inv = te.getCapability(TEST_CAP, event.getFace());
|
||||
System.out.println("Hi I'm a " + inv.getOwnerType());
|
||||
}
|
||||
if (event.world.getBlockState(event.pos).getBlock() == Blocks.dirt)
|
||||
if (event.getWorld().getBlockState(event.getPos()).getBlock() == Blocks.dirt)
|
||||
{
|
||||
event.entityPlayer.addChatMessage(new TextComponentString(TextFormatting.RED + "" + TextFormatting.ITALIC + "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST"));
|
||||
event.getEntityPlayer().addChatMessage(new TextComponentString(TextFormatting.RED + "" + TextFormatting.ITALIC + "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST"));
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user