Skip to content

Commit

Permalink
Fixed cloth bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxCraft committed Aug 5, 2013
1 parent e521890 commit 13b0e12
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public int onBlockPlaced(World world, int x, int y, int z, int side, float click
}
}
}

world.setBlock(x, y + 1, z, Block.cloth.blockID);

return 0;
}
Expand Down Expand Up @@ -85,5 +87,7 @@ public void setBlockBoundsForItemRender()
{
setBlockBounds(-0.2f, -0.2f, -0.2f, 1.2f, 1.2f, 1.2f);
}

public void onBlockAdded(World par1World, int par2, int par3, int par4) {par1World.setBlock(par2, par3, par4, Block.cloth.blockID);}

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}

@Override
/**@Override
public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
{
int j1 = Facing.oppositeSide[par5];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ public void tickStart(EnumSet<TickType> type, Object... tickData)
// do stuff here.
EntityPlayerMP player = (EntityPlayerMP) tickData[0];

// nothign not ina dream.
if (player.worldObj.provider.dimensionId != DreamDimension.dimensionID)
return;

DreamerData data = dreamers.get(player.username);

// null check.
Expand All @@ -41,11 +37,10 @@ public void tickStart(EnumSet<TickType> type, Object... tickData)

if (data.getTimeLeft() == 600)
{
// why?
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 600, 0));
}

player.getFoodStats().setFoodLevel(20);

if (!data.decrementTime())
{
kickDreamer(player, 0, null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package com.github.ubiquitousspice.dreamdimension.handlers;

import com.github.ubiquitousspice.dreamdimension.DreamDimension;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingEvent;

import com.github.ubiquitousspice.dreamdimension.DreamDimension;

import cpw.mods.fml.common.FMLCommonHandler;

public class KickHandler
{
@ForgeSubscribe
Expand All @@ -28,17 +26,6 @@ public void onDeath(LivingDeathEvent event)
}
}

@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void removeHungerBar(RenderGameOverlayEvent event)
{
if (Minecraft.getMinecraft().theWorld.provider.dimensionId == DreamDimension.dimensionID)
{
if (event.type == RenderGameOverlayEvent.ElementType.FOOD || event.type == RenderGameOverlayEvent.ElementType.EXPERIENCE)
event.setCanceled(true);
}
}

private boolean isValidEvent(LivingEvent event)
{
EntityLivingBase entity = event.entityLiving;
Expand Down

0 comments on commit 13b0e12

Please sign in to comment.