mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 14:24:22 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c5c51e6fa | ||
|
|
37379acd3d |
No files matched your search
@@ -62,10 +62,13 @@ public class BlockAlfPortal extends BlockModContainer<TileAlfPortal> implements
|
||||
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
boolean did = ((TileAlfPortal) world.getTileEntity(x, y, z)).onWanded();
|
||||
if(did && player != null)
|
||||
player.addStat(ModAchievements.elfPortalOpen, 1);
|
||||
return did;
|
||||
if(!world.isRemote) {
|
||||
boolean did = ((TileAlfPortal) world.getTileEntity(x, y, z)).onWanded();
|
||||
if(did && player != null)
|
||||
player.addStat(ModAchievements.elfPortalOpen, 1);
|
||||
return did;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -167,7 +167,8 @@ public class TileAlfPortal extends TileMod {
|
||||
} else closeNow = false;
|
||||
|
||||
if(closeNow) {
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 1 | 2);
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 1 | 2);
|
||||
for(int i = 0; i < 36; i++)
|
||||
blockParticle(meta);
|
||||
closeNow = false;
|
||||
@@ -175,7 +176,8 @@ public class TileAlfPortal extends TileMod {
|
||||
if(newMeta == 0)
|
||||
for(int i = 0; i < 36; i++)
|
||||
blockParticle(meta);
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2);
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2);
|
||||
} else if(explode) {
|
||||
worldObj.createExplosion(null, xCoord + .5, yCoord + 2.0, zCoord + .5, 3f, true);
|
||||
explode = false;
|
||||
|
||||
@@ -464,8 +464,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
}
|
||||
|
||||
public EntityManaBurst getBurst(boolean fake) {
|
||||
EntityManaBurst burst = new EntityManaBurst(this, fake);
|
||||
|
||||
boolean dreamwood = isDreamwood();
|
||||
boolean ultra = isULTRA_SPREADER();
|
||||
int maxMana = ultra ? 640 : dreamwood ? 240 : 160;
|
||||
@@ -480,29 +478,31 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
if(lens != null && lens.getItem() instanceof ILensEffect)
|
||||
((ILensEffect) lens.getItem()).apply(lens, props);
|
||||
|
||||
burst.setSourceLens(lens);
|
||||
if(getCurrentMana() >= props.maxMana || fake) {
|
||||
if(mapmakerOverride) {
|
||||
burst.setColor(mmForcedColor);
|
||||
burst.setMana(mmForcedManaPayload);
|
||||
burst.setStartingMana(mmForcedManaPayload);
|
||||
burst.setMinManaLoss(mmForcedTicksBeforeManaLoss);
|
||||
burst.setManaLossPerTick(mmForcedManaLossPerTick);
|
||||
burst.setGravity(mmForcedGravity);
|
||||
burst.setMotion(burst.motionX * mmForcedVelocityMultiplier, burst.motionY * mmForcedVelocityMultiplier, burst.motionZ * mmForcedVelocityMultiplier);
|
||||
} else {
|
||||
burst.setColor(props.color);
|
||||
burst.setMana(props.maxMana);
|
||||
burst.setStartingMana(props.maxMana);
|
||||
burst.setMinManaLoss(props.ticksBeforeManaLoss);
|
||||
burst.setManaLossPerTick(props.manaLossPerTick);
|
||||
burst.setGravity(props.gravity);
|
||||
burst.setMotion(burst.motionX * props.motionModifier, burst.motionY * props.motionModifier, burst.motionZ * props.motionModifier);
|
||||
}
|
||||
if(getCurrentMana() < props.maxMana && !fake)
|
||||
return null;
|
||||
|
||||
return burst;
|
||||
// Construct the entity only after the mana check, every new Entity takes a global entity ID
|
||||
EntityManaBurst burst = new EntityManaBurst(this, fake);
|
||||
burst.setSourceLens(lens);
|
||||
if(mapmakerOverride) {
|
||||
burst.setColor(mmForcedColor);
|
||||
burst.setMana(mmForcedManaPayload);
|
||||
burst.setStartingMana(mmForcedManaPayload);
|
||||
burst.setMinManaLoss(mmForcedTicksBeforeManaLoss);
|
||||
burst.setManaLossPerTick(mmForcedManaLossPerTick);
|
||||
burst.setGravity(mmForcedGravity);
|
||||
burst.setMotion(burst.motionX * mmForcedVelocityMultiplier, burst.motionY * mmForcedVelocityMultiplier, burst.motionZ * mmForcedVelocityMultiplier);
|
||||
} else {
|
||||
burst.setColor(props.color);
|
||||
burst.setMana(props.maxMana);
|
||||
burst.setStartingMana(props.maxMana);
|
||||
burst.setMinManaLoss(props.ticksBeforeManaLoss);
|
||||
burst.setManaLossPerTick(props.manaLossPerTick);
|
||||
burst.setGravity(props.gravity);
|
||||
burst.setMotion(burst.motionX * props.motionModifier, burst.motionY * props.motionModifier, burst.motionZ * props.motionModifier);
|
||||
}
|
||||
return null;
|
||||
|
||||
return burst;
|
||||
}
|
||||
|
||||
public ILensControl getLensController(ItemStack stack) {
|
||||
|
||||
Reference in new issue
Block a user