Compare commits

...
4 Commits
5 changed files with 37 additions and 31 deletions

No files matched your search

@@ -137,7 +137,7 @@ public class RecipeHandlerBrewery extends TemplateRecipeHandler {
for (ItemStack emptyContainer : BrewHelper.getBrewContainers()) {
final ItemStack filledContainer = recipe.getOutput(emptyContainer);
if (result.isItemEqual(filledContainer) && Objects.equals(result.stackTagCompound, filledContainer.stackTagCompound)) {
if (filledContainer != null && result.isItemEqual(filledContainer) && Objects.equals(result.stackTagCompound, filledContainer.stackTagCompound)) {
arecipes.add(new CachedBreweryRecipe(recipe, emptyContainer));
}
}
@@ -33,7 +33,8 @@ public class RenderTileCocoon extends TileEntitySpecialRenderer {
float rot = 0F;
float modval = 60F - (float) cocoon.timePassed / (float) TileCocoon.TOTAL_TIME * 30F;
if(cocoon.timePassed % modval < 10) {
// At timePassed 0 with partialTicks 0 (inventory/NEI render), log(0) makes rot NaN and the model disappears.
if(cocoon.timePassed > 0 && cocoon.timePassed % modval < 10) {
float mod = (cocoon.timePassed + partialTicks) % modval;
float v = mod / 5 * (float) Math.PI * 2;
rot = (float) Math.sin(v) * (float) Math.log(cocoon.timePassed + partialTicks);
@@ -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) {