Skip to content

Commit

Permalink
Quick crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dries007 committed Mar 17, 2016
1 parent 002a6b0 commit ac96d5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/doubledoordev/d3core/D3Core.java
Expand Up @@ -99,14 +99,14 @@ public class D3Core implements ID3Mod
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
logger = event.getModLog();

FMLCommonHandler.instance().bus().register(this);
FMLCommonHandler.instance().bus().register(FML_EVENT_HANDLER);
FMLCommonHandler.instance().bus().register(VOID_REFUNDS);
MinecraftForge.EVENT_BUS.register(FORGE_EVENT_HANDLER);
MinecraftForge.EVENT_BUS.register(VOID_REFUNDS);

logger = event.getModLog();

folder = new File(event.getModConfigurationDirectory(), MODID);
folder.mkdir();

Expand Down
Expand Up @@ -136,8 +136,11 @@ private void lilypad(EntityPlayer player)
if (x < 0) x --;
if (z < 0) z --;

while (world.getBlock(x, y, z).getMaterial() == Material.water) y++;
while (world.getBlock(x, y, z).getMaterial() == Material.air) y--;
int limiter = world.getActualHeight() * 2;

while (world.getBlock(x, y, z).getMaterial() == Material.water && --limiter != 0) y++;
while (world.getBlock(x, y, z).getMaterial() == Material.air && --limiter != 0) y--;
if (limiter == 0) return;
if (world.getBlock(x, y, z).getMaterial() == Material.water)
{
world.setBlock(x, y + 1, z, Blocks.waterlily);
Expand Down

0 comments on commit ac96d5c

Please sign in to comment.