Make dimensional doors drop the regular door

This commit is contained in:
Runemoro 2017-12-31 11:28:26 -05:00
parent b03ae520dd
commit ef9d1053d8
9 changed files with 50 additions and 9 deletions

View file

@ -9,7 +9,6 @@ import org.dimdev.dimdoors.shared.world.gateways.GatewayGenerator;
import lombok.Getter;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.fml.common.Mod;

View file

@ -1,5 +1,6 @@
package org.dimdev.dimdoors.shared.blocks;
import net.minecraft.block.state.IBlockState;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.items.ModItems;
import org.dimdev.dimdoors.shared.tileentities.TileEntityEntranceRift;
@ -7,6 +8,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import java.util.Random;
public class BlockDimensionalDoorGold extends BlockDimensionalDoor {
public static final String ID = "gold_dimensional_door";
@ -23,6 +26,11 @@ public class BlockDimensionalDoorGold extends BlockDimensionalDoor {
return ModItems.GOLD_DIMENSIONAL_DOOR;
}
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return ModBlocks.GOLD_DOOR.getItemDropped(state, rand, fortune);
}
@Override
public void setupRift(TileEntityEntranceRift rift) {
// TODO

View file

@ -1,5 +1,7 @@
package org.dimdev.dimdoors.shared.blocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.items.ModItems;
import org.dimdev.dimdoors.shared.rifts.NewPublicDestination;
@ -8,6 +10,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import java.util.Random;
public class BlockDimensionalDoorIron extends BlockDimensionalDoor {
public static final String ID = "dimensional_door";
@ -25,6 +29,11 @@ public class BlockDimensionalDoorIron extends BlockDimensionalDoor {
return ModItems.DIMENSIONAL_DOOR;
}
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Blocks.IRON_DOOR.getItemDropped(state, rand, fortune);
}
@Override
public void setupRift(TileEntityEntranceRift rift) {
NewPublicDestination destination = NewPublicDestination.builder().build();

View file

@ -1,16 +1,18 @@
package org.dimdev.dimdoors.shared.blocks;
import net.minecraft.block.state.IBlockState;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.items.ModItems;
import org.dimdev.dimdoors.shared.rifts.PrivateDestination;
import org.dimdev.dimdoors.shared.rifts.PrivatePocketExitDestination;
import org.dimdev.dimdoors.shared.rifts.RiftDestination;
import org.dimdev.dimdoors.shared.tileentities.TileEntityEntranceRift;
import org.dimdev.dimdoors.shared.world.pocketdimension.WorldProviderPersonalPocket;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import java.util.Random;
public class BlockDimensionalDoorPersonal extends BlockDimensionalDoor {
public static final String ID = "quartz_dimensional_door";
@ -27,6 +29,11 @@ public class BlockDimensionalDoorPersonal extends BlockDimensionalDoor {
return ModItems.PERSONAL_DIMENSIONAL_DOOR;
}
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return ModBlocks.QUARTZ_DOOR.getItemDropped(state, rand, fortune);
}
@Override
public void setupRift(TileEntityEntranceRift rift) {
if (rift.getWorld().provider instanceof WorldProviderPersonalPocket) {

View file

@ -2,13 +2,12 @@ package org.dimdev.dimdoors.shared.blocks;
import java.util.Random;
import net.minecraft.init.Blocks;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.items.ModItems;
import org.dimdev.dimdoors.shared.tileentities.TileEntityEntranceRift;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
@ -31,7 +30,7 @@ public class BlockDimensionalDoorUnstable extends BlockDimensionalDoor {
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? Items.AIR : Items.IRON_DOOR;
return Blocks.IRON_DOOR.getItemDropped(state, rand, fortune);
}
@Override

View file

@ -1,5 +1,7 @@
package org.dimdev.dimdoors.shared.blocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.items.ModItems;
import org.dimdev.dimdoors.shared.tileentities.TileEntityEntranceRift;
@ -7,6 +9,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import java.util.Random;
public class BlockDimensionalDoorWarp extends BlockDimensionalDoor {
public static final String ID = "warp_dimensional_door";
@ -23,6 +27,11 @@ public class BlockDimensionalDoorWarp extends BlockDimensionalDoor {
return ModItems.WARP_DIMENSIONAL_DOOR;
}
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Blocks.OAK_DOOR.getItemDropped(state, rand, fortune);
}
@Override
public void setupRift(TileEntityEntranceRift rift) {
// TODO

View file

@ -1,5 +1,8 @@
package org.dimdev.dimdoors.shared.blocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.rifts.EscapeDestination;
import org.dimdev.dimdoors.shared.tileentities.TileEntityEntranceRift;
@ -7,6 +10,8 @@ import net.minecraft.block.*;
import net.minecraft.block.material.Material;
import net.minecraft.util.ResourceLocation;
import java.util.Random;
public class BlockDimensionalTrapdoorWood extends BlockDimensionalTrapdoor {
public static final String ID = "dimensional_trapdoor";
@ -20,6 +25,11 @@ public class BlockDimensionalTrapdoorWood extends BlockDimensionalTrapdoor {
setSoundType(SoundType.WOOD);
}
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Blocks.TRAPDOOR.getItemDropped(state, rand, fortune);
}
@Override
public void setupRift(TileEntityEntranceRift rift) {
rift.setSingleDestination(new EscapeDestination());

View file

@ -35,6 +35,5 @@ public interface IRiftProvider<T extends TileEntityRift> extends ITileEntityProv
//world.setTileEntity(pos, rift);
rift.markDirty();
rift.register();
T rift2 = getRift(world, pos, state);
}
}

View file

@ -1,6 +1,5 @@
package org.dimdev.dimdoors.shared.entities;
import net.minecraft.block.Block;
import org.dimdev.dimdoors.shared.sound.ModSounds;
import org.dimdev.dimdoors.shared.DDConfig;
import org.dimdev.ddutils.Location;
@ -74,7 +73,7 @@ public class EntityMonolith extends EntityFlying implements IMob {
@Override
public AxisAlignedBB getCollisionBoundingBox() {
return Block.NULL_AABB; // TODO: Is this right? Why check if it intersects anything if it is?
return null; // TODO: Is this right? Why check if it intersects anything if it is?
}
@Override
@ -282,6 +281,8 @@ public class EntityMonolith extends EntityFlying implements IMob {
}
}
return world.checkNoEntityCollision(getCollisionBoundingBox()) && world.getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !world.containsAnyLiquid(getCollisionBoundingBox());
return true;
// TODO: this would throw a null pointer exception if enabled (the bounding box is null)
//return world.checkNoEntityCollision(getCollisionBoundingBox()) && world.getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !world.containsAnyLiquid(getCollisionBoundingBox());
}
}