Insert random nonsensical title here

Removed some superfluous methods
Added stacktrace print whenever TileEntity gets created
This commit is contained in:
Mathijs Riezebos 2017-01-19 03:20:30 +01:00
parent f93c4e3670
commit 987f52049f
3 changed files with 10 additions and 21 deletions

View file

@ -63,14 +63,6 @@ public abstract class BlockDimDoorBase extends BlockDoor implements IDimDoor, IT
return state.getValue(BlockDoor.HALF) == EnumDoorHalf.UPPER;
}
@Override
public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
if (state.getValue(BlockDoor.HALF) == EnumDoorHalf.UPPER) {
world.setTileEntity(pos, createNewTileEntity(world, 0));
updateAttachedTile(world, pos);
}
}
//Called to update the render information on the tile entity. Could probably implement a data watcher,
//but this works fine and is more versatile I think.
public BlockDimDoorBase updateAttachedTile(World world, BlockPos pos) {

View file

@ -60,6 +60,9 @@ public abstract class ItemDoorBase extends ItemDoor {
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World worldIn, EntityPlayer playerIn, EnumHand hand) {
if (worldIn.isRemote) {
return new ActionResult(EnumActionResult.FAIL, stack);
}
RayTraceResult hit = ItemDoorBase.doRayTrace(worldIn, playerIn, true);
if (hit != null) {
DimDoors.log(this.getClass(), "Hit is not null");
@ -180,17 +183,4 @@ public abstract class ItemDoorBase extends ItemDoor {
} else */ break;
}
}
private boolean canDoorBePlacedOnRift(World worldIn, EntityPlayer playerIn) {
RayTraceResult hit = ItemDoorBase.doRayTrace(worldIn, playerIn, true);
if (hit != null) {
DimDoors.log(this.getClass(), "Hit is not null");
BlockPos pos = hit.getBlockPos();
if (worldIn.getBlockState(pos).getBlock() == ModBlocks.blockRift) {
return true;
}
}
DimDoors.log(this.getClass(), "Hit is null, or block at pos is not blockRift");
return false;
}
}

View file

@ -1,5 +1,6 @@
package com.zixiken.dimdoors.tileentities;
import com.zixiken.dimdoors.DimDoors;
import com.zixiken.dimdoors.shared.RiftRegistry;
import java.util.Random;
import net.minecraft.block.state.IBlockState;
@ -14,6 +15,12 @@ public abstract class DDTileEntityBase extends TileEntity {
public int riftID = -1; //should not start at 0
public int pairedRiftID = -1;
public DDTileEntityBase() {
super();
DimDoors.log(this.getClass(), "Printing stacktrace for debugging purposes:");
Thread.dumpStack();
}
/**
*
* @return an array of floats representing RGBA color where 1.0 = 255.