add black solar system

This commit is contained in:
Sen 2025-04-25 15:14:22 +02:00
parent 5e21c8e8f6
commit 6bf6831360
4 changed files with 78 additions and 64 deletions

View file

@ -111,28 +111,28 @@ public class ItemMonsterPlacer extends Item
}
int amount = Math.min(stack.stackSize, 128);
for(int z = 0; z < amount; z++) {
Entity entity = spawnCreature(worldIn, this.entityId, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D);
if (entity != null)
{
// if (entity instanceof EntityLiving)
// {
// ((EntityLiving)entity).disableDespawn();
// }
if (entity instanceof EntityLiving && stack.hasDisplayName())
{
entity.setCustomNameTag(stack.getDisplayName());
}
// int amount = Math.min(stack.stackSize, 128);
// for(int z = 0; z < amount; z++) {
Entity entity = spawnCreature(worldIn, this.entityId, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D);
if (entity != null)
{
// if (entity instanceof EntityLiving)
// {
// ((EntityLiving)entity).disableDespawn();
// }
if (entity instanceof EntityLiving && stack.hasDisplayName())
{
entity.setCustomNameTag(stack.getDisplayName());
}
// if (!playerIn.creative)
// {
--stack.stackSize;
--stack.stackSize;
// }
}
}
// }
return true;
}
@ -173,31 +173,31 @@ public class ItemMonsterPlacer extends Item
if (worldIn.getState(blockpos).getBlock() instanceof BlockLiquid)
{
int amount = Math.min(itemStackIn.stackSize, 128);
for(int z = 0; z < amount; z++) {
Entity entity = spawnCreature(worldIn, this.entityId, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D);
if (entity != null)
{
// if (entity instanceof EntityLiving)
// {
// ((EntityLiving)entity).disableDespawn();
// }
if (entity instanceof EntityLiving && itemStackIn.hasDisplayName())
{
((EntityLiving)entity).setCustomNameTag(itemStackIn.getDisplayName());
}
// int amount = Math.min(itemStackIn.stackSize, 128);
// for(int z = 0; z < amount; z++) {
Entity entity = spawnCreature(worldIn, this.entityId, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D);
if (entity != null)
{
// if (entity instanceof EntityLiving)
// {
// ((EntityLiving)entity).disableDespawn();
// }
if (entity instanceof EntityLiving && itemStackIn.hasDisplayName())
{
((EntityLiving)entity).setCustomNameTag(itemStackIn.getDisplayName());
}
// if (!playerIn.creative)
// {
--itemStackIn.stackSize;
--itemStackIn.stackSize;
// }
// if(z == 0)
// playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]);
}
}
// }
}
}

View file

@ -78,23 +78,23 @@ public class ItemNpcSpawner extends Item
d0 = 0.5D;
}
int amount = Math.min(stack.stackSize, 128);
for(int z = 0; z < amount; z++) {
Entity entity = spawnNpc(worldIn, this.spawned, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D);
if (entity != null)
{
if (stack.hasDisplayName())
{
entity.setCustomNameTag(stack.getDisplayName());
}
// int amount = Math.min(stack.stackSize, 128);
// for(int z = 0; z < amount; z++) {
Entity entity = spawnNpc(worldIn, this.spawned, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D);
if (entity != null)
{
if (stack.hasDisplayName())
{
entity.setCustomNameTag(stack.getDisplayName());
}
// if (!playerIn.creative)
// {
--stack.stackSize;
--stack.stackSize;
// }
}
}
// }
return true;
}
@ -132,26 +132,26 @@ public class ItemNpcSpawner extends Item
if (worldIn.getState(blockpos).getBlock() instanceof BlockLiquid)
{
int amount = Math.min(itemStackIn.stackSize, 128);
for(int z = 0; z < amount; z++) {
Entity entity = spawnNpc(worldIn, this.spawned, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D);
if (entity != null)
{
if (itemStackIn.hasDisplayName())
{
((EntityLiving)entity).setCustomNameTag(itemStackIn.getDisplayName());
}
// int amount = Math.min(itemStackIn.stackSize, 128);
// for(int z = 0; z < amount; z++) {
Entity entity = spawnNpc(worldIn, this.spawned, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D);
if (entity != null)
{
if (itemStackIn.hasDisplayName())
{
((EntityLiving)entity).setCustomNameTag(itemStackIn.getDisplayName());
}
// if (!playerIn.creative)
// {
--itemStackIn.stackSize;
--itemStackIn.stackSize;
// }
// if(z == 0)
// playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]);
}
}
// }
}
}