More stuff ingame and showing up.

This commit is contained in:
Sebastian Hartte
2020-06-01 01:01:32 +02:00
parent 6a88728544
commit 077ff17078
864 changed files with 11515 additions and 11761 deletions
@@ -24,9 +24,10 @@ import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
@@ -45,7 +46,7 @@ public class BlockCellWorkbench extends AEBaseTileBlock
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( p.isShiftKeyDown() )
{
@@ -57,7 +58,7 @@ public class BlockCellWorkbench extends AEBaseTileBlock
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_CELL_WORKBENCH );
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_CELL_WORKBENCH );
}
return true;
}
@@ -25,6 +25,8 @@ import java.util.Random;
import javax.annotation.Nullable;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.math.BlockRayTraceResult;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
@@ -71,7 +73,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( player.isShiftKeyDown() )
{
@@ -92,7 +94,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
@Override
@OnlyIn( Dist.CLIENT )
public void randomDisplayTick( final BlockState state, final World w, final BlockPos pos, final Random r )
public void animateTick( final BlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance().isEnableEffects() )
{
@@ -24,9 +24,10 @@ import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
@@ -45,7 +46,7 @@ public class BlockCondenser extends AEBaseTileBlock
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( player.isShiftKeyDown() )
{
@@ -57,7 +58,7 @@ public class BlockCondenser extends AEBaseTileBlock
final TileCondenser tc = this.getTileEntity( w, pos );
if( tc != null && !player.isShiftKeyDown() )
{
Platform.openGUI( player, tc, AEPartLocation.fromFacing( side ), GuiBridge.GUI_CONDENSER );
Platform.openGUI( player, tc, AEPartLocation.fromFacing(hit), GuiBridge.GUI_CONDENSER );
return true;
}
}
@@ -25,10 +25,11 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
@@ -50,7 +51,7 @@ public class BlockInscriber extends AEBaseTileBlock
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( p.isShiftKeyDown() )
{
@@ -62,7 +63,7 @@ public class BlockInscriber extends AEBaseTileBlock
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_INSCRIBER );
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_INSCRIBER );
}
return true;
}
@@ -27,9 +27,11 @@ import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
@@ -73,7 +75,7 @@ public class BlockInterface extends AEBaseTileBlock
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( p.isShiftKeyDown() )
{
@@ -85,7 +87,7 @@ public class BlockInterface extends AEBaseTileBlock
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_INTERFACE );
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_INTERFACE );
}
return true;
}
@@ -109,7 +109,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
public void randomDisplayTick( final BlockState state, final World worldIn, final BlockPos pos, final Random rand )
public void animateTick( final BlockState state, final World worldIn, final BlockPos pos, final Random rand )
{
// cancel out lightning
}
@@ -135,7 +135,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
@Override
@OnlyIn( Dist.CLIENT )
public void randomDisplayTick( final BlockState state, final World w, final BlockPos pos, final Random r )
public void animateTick( final BlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance().isEnableEffects() )
{
@@ -73,7 +73,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
@OnlyIn( Dist.CLIENT )
@Override
public void randomDisplayTick( final BlockState state, final World w, final BlockPos pos, final Random r )
public void animateTick( final BlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance().isEnableEffects() )
{
@@ -27,10 +27,11 @@ import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
@@ -80,7 +81,7 @@ public class BlockSecurityStation extends AEBaseTileBlock
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( p.isShiftKeyDown() )
{
@@ -95,7 +96,7 @@ public class BlockSecurityStation extends AEBaseTileBlock
return true;
}
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_SECURITY );
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_SECURITY );
return true;
}
return false;
@@ -31,21 +31,23 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.AbstractArrowEntity;
import net.minecraft.item.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import appeng.block.AEBaseBlock;
import appeng.entity.EntityTinyTNTPrimed;
import appeng.helpers.ICustomCollision;
import net.minecraft.world.server.ServerWorld;
public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
@@ -72,18 +74,18 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( heldItem != null && heldItem.getItem() == Items.FLINT_AND_STEEL )
{
this.startFuse( w, pos, player );
w.setBlockToAir( pos );
w.removeBlock(pos, false);
heldItem.damageItem( 1, player );
return true;
}
else
{
return super.onActivated( w, pos, player, hand, heldItem, side, hitX, hitY, hitZ );
return super.onActivated( w, pos, player, hand, heldItem, hit);
}
}
@@ -104,7 +106,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
if( world.isBlockIndirectlyGettingPowered( pos ) > 0 )
{
this.startFuse( world, pos, null );
world.setBlockToAir( pos );
world.removeBlock(pos, false);
}
}
@@ -116,21 +118,31 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
if( w.isBlockIndirectlyGettingPowered( pos ) > 0 )
{
this.startFuse( w, pos, null );
w.setBlockToAir( pos );
w.removeBlock(pos, false);
}
}
@Override
public void onEntityWalk( final World w, final BlockPos pos, final Entity entity )
{
if( entity instanceof EntityArrow && !w.isRemote )
if( entity instanceof AbstractArrowEntity && !w.isRemote )
{
final EntityArrow entityarrow = (EntityArrow) entity;
final AbstractArrowEntity entityarrow = (AbstractArrowEntity) entity;
if( entityarrow.isBurning() )
{
this.startFuse( w, pos, entityarrow.shootingEntity instanceof LivingEntity ? (LivingEntity) entityarrow.shootingEntity : null );
w.setBlockToAir( pos );
LivingEntity igniter = null;
// Check if the shooter still exists
if (w instanceof ServerWorld) {
ServerWorld serverWorld = (ServerWorld) w;
Entity shooter = serverWorld.getEntityByUuid(entityarrow.shootingEntity);
if (shooter instanceof LivingEntity) {
igniter = (LivingEntity) shooter;
}
}
this.startFuse( w, pos, igniter );
w.removeBlock(pos, false);
}
}
}
@@ -29,10 +29,12 @@ import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
@@ -75,7 +77,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit)
{
if( player.isShiftKeyDown() )
{
@@ -87,7 +89,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
final TileVibrationChamber tc = this.getTileEntity( w, pos );
if( tc != null && !player.isShiftKeyDown() )
{
Platform.openGUI( player, tc, AEPartLocation.fromFacing( side ), GuiBridge.GUI_VIBRATION_CHAMBER );
Platform.openGUI( player, tc, AEPartLocation.fromFacing(hit), GuiBridge.GUI_VIBRATION_CHAMBER );
return true;
}
}
@@ -96,7 +98,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
}
@Override
public void randomDisplayTick( final BlockState state, final World w, final BlockPos pos, final Random r )
public void animateTick( final BlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance().isEnableEffects() )
{