1.15 port

This commit is contained in:
yueh
2020-05-18 14:02:45 +02:00
parent 0ea86c939c
commit 16d6d55d7f
630 changed files with 4211 additions and 12664 deletions
@@ -23,13 +23,12 @@ import java.util.Date;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
import appeng.api.definitions.IMaterials;
@@ -85,38 +84,18 @@ public final class EntitySingularity extends AEBaseEntityItem
if( materials.singularity().isSameAs( item ) )
{
final AxisAlignedBB region = new AxisAlignedBB( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 );
final AxisAlignedBB region = new AxisAlignedBB( this.getPosX() - 4, this.getPosY() - 4, this.getPosZ() - 4, this.getPosX() + 4, this
.getPosY() + 4, this.getPosZ() + 4 );
final List<Entity> l = this.getCheckedEntitiesWithinAABBExcludingEntity( region );
for( final Entity e : l )
{
if( e instanceof EntityItem )
if( e instanceof ItemEntity )
{
final ItemStack other = ( (EntityItem) e ).getItem();
final ItemStack other = ( (ItemEntity) e ).getItem();
if( !other.isEmpty() )
{
boolean matches = false;
for( final ItemStack is : OreDictionary.getOres( "dustEnder" ) )
{
if( OreDictionary.itemMatches( other, is, false ) )
{
matches = true;
break;
}
}
// check... other name.
if( !matches )
{
for( final ItemStack is : OreDictionary.getOres( "dustEnderPearl" ) )
{
if( OreDictionary.itemMatches( other, is, false ) )
{
matches = true;
break;
}
}
}
if( matches )
{
@@ -126,24 +105,25 @@ public final class EntitySingularity extends AEBaseEntityItem
;
if( other.getCount() == 0 )
{
e.setDead();
e.remove();
}
materials.qESingularity().maybeStack( 2 ).ifPresent( singularityStack ->
{
final NBTTagCompound cmp = Platform.openNbtData( singularityStack );
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 );
final CompoundNBT cmp = Platform.openNbtData( singularityStack );
cmp.putLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 );
randTickSeed++;
item.grow( -1 );
final EntitySingularity entity = new EntitySingularity( this.world, this.posX, this.posY, this.posZ, singularityStack );
this.world.spawnEntity( entity );
final EntitySingularity entity = new EntitySingularity( this.world, this.getPosX(), this.getPosY(), this
.getPosZ(), singularityStack );
this.world.addEntity( entity );
} );
}
if( item.getCount() <= 0 )
{
this.setDead();
this.remove();
}
}
}