mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-17 19:05:02 +00:00
Fix Mark of the Falling Tower does not check item stack and does not immediately remove entities (#75)
Co-authored-by: Maya <[email protected]>
This commit is contained in:
1 parent
14a4825e33
commit
efe1e6044a
1 file changed
+13
-2
+13
-2
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -45,7 +46,10 @@ public class RitualEffectSummonMeteor extends RitualEffect {
|
||||
|
||||
for (EntityItem entityItem : entities) {
|
||||
if (entityItem != null && MeteorRegistry.isValidMeteorFocusItem(entityItem.getEntityItem())) {
|
||||
int meteorID = MeteorRegistry.getMeteorIDForItem(entityItem.getEntityItem());
|
||||
ItemStack stack = entityItem.getEntityItem();
|
||||
if (stack == null || stack.stackSize <= 0) continue;
|
||||
|
||||
int meteorID = MeteorRegistry.getMeteorIDForItem(stack);
|
||||
int cost = MeteorRegistry.meteorList.get(meteorID).cost;
|
||||
|
||||
if (currentEssence < cost) {
|
||||
@@ -63,7 +67,14 @@ public class RitualEffectSummonMeteor extends RitualEffect {
|
||||
}
|
||||
}
|
||||
|
||||
entityItem.setDead();
|
||||
stack.stackSize--;
|
||||
|
||||
if (stack.stackSize <= 0) {
|
||||
world.removeEntity(entityItem);
|
||||
} else {
|
||||
entityItem.setEntityItemStack(stack);
|
||||
}
|
||||
|
||||
world.spawnEntityInWorld(meteor);
|
||||
ritualStone.setActive(false);
|
||||
SoulNetworkHandler.syphonFromNetwork(owner, cost);
|
||||
|
||||
Reference in new issue
Block a user