Updated mappings to stable_39

This commit is contained in:
Waterpicker 2019-01-07 00:41:14 -06:00
parent 98b4db0c2c
commit 5004b30a48
45 changed files with 54 additions and 78 deletions

View file

@ -39,7 +39,7 @@ dependencies {
sourceCompatibility = targetCompatibility = "1.8"
ext.mcversion = "1.12.2"
ext.forgeversion = "14.23.4.2707"
String mcpversion = "snapshot_20180703"
String mcpversion = "stable_39"
// Mod version
version = "3.0.9"

View file

@ -188,7 +188,7 @@ public final class TeleportUtils {
// Send respawn packets to the player
player.dimension = newDimension;
player.connection.sendPacket(new SPacketRespawn(player.dimension, newWorld.getDifficulty(), newWorld.getWorldInfo().getTerrainType(), player.interactionManager.getGameType()));
player.mcServer.getPlayerList().updatePermissionLevel(player); // Sends an SPacketEntityStatus
player.server.getPlayerList().updatePermissionLevel(player); // Sends an SPacketEntityStatus
// Remove player entity from the old world
oldWorld.removeEntityDangerously(player);
@ -213,14 +213,14 @@ public final class TeleportUtils {
player.setWorld(newWorld);
// Sync the player
player.mcServer.getPlayerList().preparePlayer(player, oldWorld);
player.server.getPlayerList().preparePlayer(player, oldWorld);
player.connection.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
// Fix for https://bugs.mojang.com/browse/MC-98153. See this comment: https://bugs.mojang.com/browse/MC-98153#comment-411524
captureCurrentPosition(player.connection);
player.interactionManager.setWorld(newWorld);
player.connection.sendPacket(new SPacketPlayerAbilities(player.capabilities));
player.mcServer.getPlayerList().updateTimeAndWeatherForPlayer(player, newWorld);
player.mcServer.getPlayerList().syncPlayerInventory(player);
player.server.getPlayerList().updateTimeAndWeatherForPlayer(player, newWorld);
player.server.getPlayerList().syncPlayerInventory(player);
for (PotionEffect potioneffect : player.getActivePotionEffects()) {
player.connection.sendPacket(new SPacketEntityEffect(player.getEntityId(), potioneffect));
}

View file

@ -296,7 +296,7 @@ public class Schematic {
if (id.contains(":")) mods.add(id.split(":")[0]);
schematic.setBlockState(x, y, z, state);
TileEntity tileEntity = world.getChunkFromBlockCoords(pos).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK);
TileEntity tileEntity = world.getChunk(pos).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK);
if (tileEntity != null) {
NBTTagCompound tileEntityNBT = tileEntity.serializeNBT();
tileEntityNBT.setInteger("x", tileEntityNBT.getInteger("x") - from.getX());
@ -438,7 +438,7 @@ public class Schematic {
for (int chunkZ = 0; chunkZ <= (length >> 4) + 1; chunkZ++) {
long setStart = System.nanoTime();
// Get the chunk only once for efficiency
Chunk chunk = world.getChunkFromChunkCoords((xBase >> 4) + chunkX, (zBase >> 4) + chunkZ);
Chunk chunk = world.getChunk((xBase >> 4) + chunkX, (zBase >> 4) + chunkZ);
ExtendedBlockStorage[] storageArray = chunk.getBlockStorageArray();
for (int storageY = 0; storageY <= (height >> 4) + 1; storageY++) {
// Get the storage only once for eficiency

View file

@ -6,6 +6,7 @@ import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.inventory.Container;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import org.dimdev.ddutils.RGBA;

View file

@ -21,7 +21,7 @@ public class TileEntityEntranceRiftRenderer extends TileEntitySpecialRenderer<Ti
private final ResourceLocation keyholeLight = new ResourceLocation(DimDoors.MODID + ":textures/other/keyhole_light.png");
private void renderKeyHole(TileEntityEntranceRift tile, double x, double y, double z, int i) {
EnumFacing rotation = EnumFacing.getHorizontal((tile.orientation.getHorizontalIndex() + 3) % 4);
EnumFacing rotation = EnumFacing.byHorizontalIndex((tile.orientation.getHorizontalIndex() + 3) % 4);
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);

View file

@ -20,12 +20,12 @@ import org.dimdev.dimdoors.shared.items.ModItems;
public final class ModRecipes {
public static ResourceLocation getNameForRecipe(ItemStack output) {
ResourceLocation baseLoc = new ResourceLocation(DimDoors.MODID, output.getItem().getRegistryName().getResourcePath());
ResourceLocation baseLoc = new ResourceLocation(DimDoors.MODID, output.getItem().getRegistryName().getPath());
ResourceLocation recipeLoc = baseLoc;
int index = 0;
while (CraftingManager.REGISTRY.containsKey(recipeLoc)) {
index++;
recipeLoc = new ResourceLocation(DimDoors.MODID, baseLoc.getResourcePath() + "_" + index);
recipeLoc = new ResourceLocation(DimDoors.MODID, baseLoc.getPath() + "_" + index);
}
return recipeLoc;
}

View file

@ -31,10 +31,9 @@ public abstract class BlockDimensionalDoor extends BlockDoor implements IRiftPro
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity entity) {
// Run server-side only
if (world.isRemote) return;
// Get the door's state (many door blockstates are available for the bottom door half only)
IBlockState doorState = world.getBlockState(state.getValue(HALF) == EnumDoorHalf.UPPER ? pos.down() : pos);
if (doorState.getBlock() != this) return; // The door is in a half-broken state
@ -73,11 +72,11 @@ public abstract class BlockDimensionalDoor extends BlockDoor implements IRiftPro
}
private int getCloseSound() {
return blockMaterial == Material.IRON ? 1011 : 1012;
return material == Material.IRON ? 1011 : 1012;
}
private int getOpenSound() {
return blockMaterial == Material.IRON ? 1005 : 1006;
return material == Material.IRON ? 1005 : 1006;
}
@Override
@ -148,7 +147,7 @@ public abstract class BlockDimensionalDoor extends BlockDoor implements IRiftPro
@Override public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) {}
@Override
public EnumPushReaction getMobilityFlag(IBlockState state) {
public EnumPushReaction getPushReaction(IBlockState state) {
return EnumPushReaction.BLOCK;
}

View file

@ -16,7 +16,6 @@ public class BlockDimensionalDoorGold extends BlockDimensionalDoor {
public BlockDimensionalDoorGold() {
super(Material.IRON);
setHardness(1.0F);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
}

View file

@ -18,7 +18,6 @@ public class BlockDimensionalDoorIron extends BlockDimensionalDoor {
super(Material.IRON);
setHardness(1.0F);
setResistance(2000.0F);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
}

View file

@ -16,7 +16,6 @@ public class BlockDimensionalDoorQuartz extends BlockDimensionalDoor {
public BlockDimensionalDoorQuartz() {
super(Material.ROCK);
setHardness(0.1F);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
}

View file

@ -17,7 +17,6 @@ public class BlockDimensionalDoorWood extends BlockDimensionalDoor { // TODO: al
public BlockDimensionalDoorWood() {
super(Material.WOOD);
setHardness(1.0F);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
}

View file

@ -22,7 +22,6 @@ public class BlockDimensionalPortal extends BlockDimensionalDoor { // TODO: conv
super(Material.PORTAL); // This is the only way to make it collide with water but not other entities, but still have a collision box.
setHardness(1.0F);
setLightLevel(0.5F);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setDefaultState(super.getDefaultState().withProperty(OPEN, true));
}
@ -44,7 +43,7 @@ public class BlockDimensionalPortal extends BlockDimensionalDoor { // TODO: conv
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity entity) {
// Run server-side only
if (world.isRemote) return;

View file

@ -23,7 +23,7 @@ public abstract class BlockDimensionalTrapdoor extends BlockTrapDoor implements
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity entity) {
if (world.isRemote) return;
// Check that it's a door and that the entity portal timer is 0
@ -66,7 +66,7 @@ public abstract class BlockDimensionalTrapdoor extends BlockTrapDoor implements
@Override
@SuppressWarnings("deprecation")
public EnumPushReaction getMobilityFlag(IBlockState state) {
public EnumPushReaction getPushReaction(IBlockState state) {
return EnumPushReaction.BLOCK;
}

View file

@ -18,7 +18,6 @@ public class BlockDimensionalTrapdoorWood extends BlockDimensionalTrapdoor { //
public BlockDimensionalTrapdoorWood() {
super(Material.WOOD);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setHardness(1.0F);
setSoundType(SoundType.WOOD);

View file

@ -22,7 +22,6 @@ public class BlockDoorGold extends BlockDoor {
public BlockDoorGold() {
super(Material.IRON);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setHardness(0.1F);
}

View file

@ -22,7 +22,6 @@ public class BlockDoorQuartz extends BlockDoor {
public BlockDoorQuartz() {
super(Material.ROCK);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setHardness(0.1F);
}

View file

@ -30,7 +30,6 @@ public class BlockFabric extends BlockColored {
public BlockFabric() {
super(FABRIC);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setDefaultState(getDefaultState().withProperty(COLOR, EnumDyeColor.BLACK));
setHardness(0.1F);

View file

@ -23,7 +23,6 @@ public class BlockFabricAncient extends BlockColored {
super(Material.ROCK);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setDefaultState(getDefaultState().withProperty(COLOR, EnumDyeColor.BLACK));
setHardness(-1);
setResistance(6000000.0F);

View file

@ -21,7 +21,6 @@ public class BlockFabricEternal extends BlockEmptyDrops { // TODO: make this a g
public BlockFabricEternal() {
super(ETERNAL_FABRIC);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setHardness(-1);
setResistance(6000000.0F);

View file

@ -23,7 +23,6 @@ public class BlockFabricUnravelled extends BlockEmptyDrops {
public BlockFabricUnravelled() {
super(UNRAVELLED_FABRIC);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setHardness(0.1F);
setSoundType(SoundType.STONE);

View file

@ -28,7 +28,6 @@ public class BlockFloatingRift extends BlockSpecialAir implements ITileEntityPro
public BlockFloatingRift() {
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setTickRandomly(true);
setResistance(6000000.0F); // Same as bedrock
setLightLevel(0.5f);

View file

@ -21,7 +21,6 @@ public class BlockMarkingPlate extends Block {
public BlockMarkingPlate() {
super(FABRIC);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setHardness(0.1F);
setSoundType(SoundType.STONE);

View file

@ -109,8 +109,8 @@ public abstract class ItemDimensionalDoor extends ItemDoor {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
if (I18n.hasKey(getUnlocalizedName() + ".info")) {
tooltip.add(I18n.format(getUnlocalizedName() + ".info"));
if (I18n.hasKey(getRegistryName() + ".info")) {
tooltip.add(I18n.format(getRegistryName() + ".info"));
}
}

View file

@ -17,7 +17,6 @@ public class ItemDimensionalDoorGold extends ItemDimensionalDoor {
public ItemDimensionalDoorGold() {
super(ModBlocks.GOLD_DIMENSIONAL_DOOR);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(BlockDimensionalDoorGold.ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, BlockDimensionalDoorGold.ID));
}

View file

@ -12,7 +12,6 @@ public class ItemDimensionalDoorIron extends ItemDimensionalDoor {
public ItemDimensionalDoorIron() {
super(ModBlocks.IRON_DIMENSIONAL_DOOR);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(BlockDimensionalDoorIron.ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, BlockDimensionalDoorIron.ID));
}

View file

@ -14,7 +14,6 @@ public class ItemDimensionalDoorQuartz extends ItemDimensionalDoor {
public ItemDimensionalDoorQuartz() {
super(ModBlocks.PERSONAL_DIMENSIONAL_DOOR);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(BlockDimensionalDoorQuartz.ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, BlockDimensionalDoorQuartz.ID));
}

View file

@ -11,7 +11,6 @@ public class ItemDimensionalDoorUnstable extends ItemDimensionalDoor {
public ItemDimensionalDoorUnstable() {
super(ModBlocks.IRON_DIMENSIONAL_DOOR);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName("unstable_dimensional_door");
setRegistryName(new ResourceLocation(DimDoors.MODID, "unstable_dimensional_door"));
}

View file

@ -14,7 +14,6 @@ public class ItemDimensionalDoorWood extends ItemDimensionalDoor {
public ItemDimensionalDoorWood() {
super(ModBlocks.WARP_DIMENSIONAL_DOOR);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(BlockDimensionalDoorWood.ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, BlockDimensionalDoorWood.ID));
}

View file

@ -54,8 +54,8 @@ public abstract class ItemDimensionalTrapdoor extends ItemBlock {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
if (I18n.hasKey(getUnlocalizedName() + ".info")) {
tooltip.add(I18n.format(getUnlocalizedName() + ".info"));
if (I18n.hasKey(getRegistryName() + ".info")) {
tooltip.add(I18n.format(getRegistryName() + ".info"));
}
}

View file

@ -12,7 +12,6 @@ public class ItemDimensionalTrapdoorWood extends ItemDimensionalTrapdoor {
public ItemDimensionalTrapdoorWood() {
super(ModBlocks.WOOD_DIMENSIONAL_TRAPDOOR);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(BlockDimensionalTrapdoorWood.ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, BlockDimensionalTrapdoorWood.ID));
}

View file

@ -12,7 +12,6 @@ public class ItemDoorGold extends ItemDoor {
super(ModBlocks.GOLD_DOOR);
setMaxStackSize(16);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(BlockDoorGold.ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, BlockDoorGold.ID));
}
}

View file

@ -11,7 +11,6 @@ public class ItemDoorQuartz extends ItemDoor {
public ItemDoorQuartz() {
super(ModBlocks.QUARTZ_DOOR);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(BlockDoorQuartz.ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, BlockDoorQuartz.ID));
}
}

View file

@ -8,6 +8,5 @@ public class ItemModRecord extends ItemRecord {
protected ItemModRecord(String recordName, SoundEvent soundIn) {
super(recordName, soundIn);
setRegistryName(DimDoors.MODID, "record_" + recordName);
setUnlocalizedName("record");
}
}

View file

@ -30,7 +30,6 @@ public class ItemRiftBlade extends ItemSword {
public ItemRiftBlade() {
super(ToolMaterial.IRON);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
}
@ -57,7 +56,7 @@ public class ItemRiftBlade extends ItemSword {
if (RayTraceHelper.isLivingEntity(hit) || RayTraceHelper.isRift(hit, world)) {
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
} else {
player.sendStatusMessage(new TextComponentTranslation(getUnlocalizedName() + ".rift_miss"), true);
player.sendStatusMessage(new TextComponentTranslation(getRegistryName() + ".rift_miss"), true);
TileEntityFloatingRiftRenderer.showRiftCoreUntil = System.currentTimeMillis() + ModConfig.graphics.highlightRiftCoreFor;
return new ActionResult<>(EnumActionResult.FAIL, stack);
}
@ -93,6 +92,6 @@ public class ItemRiftBlade extends ItemSword {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
tooltip.add(I18n.format(getUnlocalizedName() + ".info"));
tooltip.add(I18n.format(getRegistryName() + ".info"));
}
}

View file

@ -17,6 +17,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.client.TileEntityFloatingRiftRenderer;
import org.dimdev.dimdoors.shared.ModConfig;
import org.dimdev.dimdoors.shared.tileentities.TileEntityRift;
import java.util.List;
@ -28,7 +29,6 @@ public class ItemRiftConfigurationTool extends Item {
setMaxStackSize(1);
setMaxDamage(16);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
}
@ -46,6 +46,10 @@ public class ItemRiftConfigurationTool extends Item {
}
if (RayTraceHelper.isRift(hit, world)) {
TileEntityRift rift = (TileEntityRift) world.getTileEntity(hit.getBlockPos());
System.out.println(rift);
//TODO: implement this tool's functionality
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}
@ -55,8 +59,8 @@ public class ItemRiftConfigurationTool extends Item {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
if (I18n.hasKey(getUnlocalizedName() + ".info")) {
tooltip.add(I18n.format(getUnlocalizedName() + ".info"));
if (I18n.hasKey(getRegistryName() + ".info")) {
tooltip.add(I18n.format(getRegistryName() + ".info"));
}
}
}

View file

@ -24,7 +24,6 @@ public class ItemRiftRemover extends Item {
public ItemRiftRemover() {
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setMaxStackSize(1);
setMaxDamage(100);
@ -33,8 +32,8 @@ public class ItemRiftRemover extends Item {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
if (I18n.hasKey(getUnlocalizedName() + ".info")) {
tooltip.add(I18n.format(getUnlocalizedName() + ".info"));
if (I18n.hasKey(getRegistryName() + ".info")) {
tooltip.add(I18n.format(getRegistryName() + ".info"));
}
}
@ -57,10 +56,10 @@ public class ItemRiftRemover extends Item {
rift.setClosing(true);
world.playSound(null, player.getPosition(), ModSounds.RIFT_CLOSE, SoundCategory.BLOCKS, 0.6f, 1);
stack.damageItem(10, player);
player.sendStatusMessage(new TextComponentTranslation(getUnlocalizedName() + ".closing"), true);
player.sendStatusMessage(new TextComponentTranslation(getRegistryName() + ".closing"), true);
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
} else {
player.sendStatusMessage(new TextComponentTranslation(getUnlocalizedName() + ".already_closing"), true);
player.sendStatusMessage(new TextComponentTranslation(getRegistryName() + ".already_closing"), true);
}
}
return new ActionResult<>(EnumActionResult.FAIL, stack);

View file

@ -29,7 +29,6 @@ public class ItemRiftSignature extends Item {
setMaxStackSize(1);
setMaxDamage(1);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
}
@ -58,7 +57,7 @@ public class ItemRiftSignature extends Item {
if (target == null) {
// The link signature has not been used. Store its current target as the first location.
setSource(stack, new RotatedLocation(new Location(world, pos), player.rotationYaw, 0));
player.sendStatusMessage(new TextComponentTranslation(getUnlocalizedName() + ".stored"), true);
player.sendStatusMessage(new TextComponentTranslation(getRegistryName() + ".stored"), true);
world.playSound(null, player.getPosition(), ModSounds.RIFT_START, SoundCategory.BLOCKS, 0.6f, 1);
} else {
// Place a rift at the saved point
@ -86,7 +85,7 @@ public class ItemRiftSignature extends Item {
stack.damageItem(1, player); // TODO: calculate damage based on position?
clearSource(stack);
player.sendStatusMessage(new TextComponentTranslation(getUnlocalizedName() + ".created"), true);
player.sendStatusMessage(new TextComponentTranslation(getRegistryName() + ".created"), true);
// null = send sound to the player too, we have to do this because this code is not run client-side
world.playSound(null, player.getPosition(), ModSounds.RIFT_END, SoundCategory.BLOCKS, 0.6f, 1);
}
@ -120,9 +119,9 @@ public class ItemRiftSignature extends Item {
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
RotatedLocation transform = getSource(stack);
if (transform != null) {
tooltip.add(I18n.format(I18n.format(getUnlocalizedName() + ".bound.info", transform.getLocation().getX(), transform.getLocation().getY(), transform.getLocation().getZ(), transform.getLocation().dim)));
tooltip.add(I18n.format(I18n.format(getRegistryName() + ".bound.info", transform.getLocation().getX(), transform.getLocation().getY(), transform.getLocation().getZ(), transform.getLocation().dim)));
} else {
tooltip.add(I18n.format(getUnlocalizedName() + ".unbound.info"));
tooltip.add(I18n.format(getRegistryName() + ".unbound.info"));
}
}
}

View file

@ -26,7 +26,6 @@ public class ItemRiftStabilizer extends Item {
setMaxStackSize(1);
setMaxDamage(6); // TODO: Add more uses and make it reduce rift growth speed instead?
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
}
@ -52,10 +51,10 @@ public class ItemRiftStabilizer extends Item {
rift.setStabilized(true);
world.playSound(null, player.getPosition(), ModSounds.RIFT_CLOSE, SoundCategory.BLOCKS, 0.6f, 1); // TODO: different sound
stack.damageItem(1, player);
player.sendStatusMessage(new TextComponentTranslation(getUnlocalizedName() + ".stabilized"), true);
player.sendStatusMessage(new TextComponentTranslation(getRegistryName() + ".stabilized"), true);
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
} else {
player.sendStatusMessage(new TextComponentTranslation(getUnlocalizedName() + ".already_stabilized"), true);
player.sendStatusMessage(new TextComponentTranslation(getRegistryName() + ".already_stabilized"), true);
}
}
return new ActionResult<>(EnumActionResult.FAIL, stack);
@ -64,6 +63,6 @@ public class ItemRiftStabilizer extends Item {
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
tooltip.add(I18n.format(I18n.format(getUnlocalizedName() + ".info")));
tooltip.add(I18n.format(I18n.format(getRegistryName() + ".info")));
}
}

View file

@ -29,7 +29,6 @@ public class ItemStabilizedRiftSignature extends Item { // TODO: common supercla
setMaxStackSize(1);
setMaxDamage(20);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
setUnlocalizedName(ID);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
}
@ -57,7 +56,7 @@ public class ItemStabilizedRiftSignature extends Item { // TODO: common supercla
if (target == null) {
// The link signature has not been used. Store its current target as the first location.
setSource(stack, new RotatedLocation(new Location(world, pos), player.rotationYaw, 0));
player.sendStatusMessage(new TextComponentTranslation(getUnlocalizedName() + ".stored"), true);
player.sendStatusMessage(new TextComponentTranslation(getRegistryName() + ".stored"), true);
world.playSound(null, player.getPosition(), ModSounds.RIFT_START, SoundCategory.BLOCKS, 0.6f, 1);
} else {
// Place a rift at the target point
@ -83,7 +82,7 @@ public class ItemStabilizedRiftSignature extends Item { // TODO: common supercla
stack.damageItem(1, player);
player.sendStatusMessage(new TextComponentTranslation(getUnlocalizedName() + ".created"), true);
player.sendStatusMessage(new TextComponentTranslation(getRegistryName() + ".created"), true);
world.playSound(null, player.getPosition(), ModSounds.RIFT_END, SoundCategory.BLOCKS, 0.6f, 1);
}
@ -116,9 +115,9 @@ public class ItemStabilizedRiftSignature extends Item { // TODO: common supercla
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
RotatedLocation transform = getTarget(stack);
if (transform != null) {
tooltip.add(I18n.format(getUnlocalizedName() + ".bound.info", transform.getLocation().getX(), transform.getLocation().getY(), transform.getLocation().getZ(), transform.getLocation().dim));
tooltip.add(I18n.format(getRegistryName() + ".bound.info", transform.getLocation().getX(), transform.getLocation().getY(), transform.getLocation().getZ(), transform.getLocation().dim));
} else {
tooltip.add(I18n.format(getUnlocalizedName() + ".unbound.info"));
tooltip.add(I18n.format(getRegistryName() + ".unbound.info"));
}
}
}

View file

@ -20,7 +20,6 @@ public class ItemWovenWorldThreadArmor extends ItemArmor {
public ItemWovenWorldThreadArmor(String name, int renderIndex, EntityEquipmentSlot equipmentSlot) {
super(WOVEN_WORLD_THREAD, renderIndex, equipmentSlot);
setUnlocalizedName(name);
setRegistryName(DimDoors.MODID, name);
setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
}

View file

@ -9,7 +9,7 @@ public final class ModCreativeTabs {
public static final CreativeTabs DIMENSIONAL_DOORS_CREATIVE_TAB = new CreativeTabs("dimensional_doors_creative_tab") {
@Override
@SideOnly(Side.CLIENT)
public ItemStack getTabIconItem() {
public ItemStack createIcon() {
return new ItemStack(ModItems.IRON_DIMENSIONAL_DOOR);
}
};

View file

@ -29,8 +29,8 @@ public final class ModItems {
// Crafting ingredients
private static final String WORLD_THREAD_ID = "world_thread";
private static final String STABLE_FABRIC_ID = "stable_fabric";
public static final Item WORLD_THREAD = new Item().setUnlocalizedName(WORLD_THREAD_ID).setFull3D().setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB).setRegistryName(new ResourceLocation(DimDoors.MODID, WORLD_THREAD_ID));
public static final Item STABLE_FABRIC = new Item().setUnlocalizedName(STABLE_FABRIC_ID).setFull3D().setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB).setRegistryName(new ResourceLocation(DimDoors.MODID, STABLE_FABRIC_ID));
public static final Item WORLD_THREAD = new Item().setRegistryName(DimDoors.MODID, WORLD_THREAD_ID).setFull3D().setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
public static final Item STABLE_FABRIC = new Item().setRegistryName(DimDoors.MODID, STABLE_FABRIC_ID).setFull3D().setCreativeTab(ModCreativeTabs.DIMENSIONAL_DOORS_CREATIVE_TAB);
// Tools
public static final ItemRiftConfigurationTool RIFT_CONFIGURATION_TOOL = new ItemRiftConfigurationTool();

View file

@ -77,7 +77,7 @@ import java.util.Random;
@Override
public boolean receiveEntity(Entity entity, float relativeYaw, float relativePitch) { // TODO: teleportOffset for all rifts instead?
Vec3d targetPos = new Vec3d(pos).addVector(0.5, 0, 0.5).add(new Vec3d(orientation.getDirectionVec()).scale(ModConfig.general.teleportOffset + 0.5));
Vec3d targetPos = new Vec3d(pos).add(0.5, 0, 0.5).add(new Vec3d(orientation.getDirectionVec()).scale(ModConfig.general.teleportOffset + 0.5));
if (relativeRotation) {
float yaw = getDestinationYaw(entity.rotationYaw) + entity.rotationYaw - relativeYaw;
float pitch = entity instanceof EntityLiving ? entity.rotationPitch : getDestinationPitch(entity.rotationPitch) + entity.rotationPitch - relativePitch;
@ -137,7 +137,7 @@ import java.util.Random;
@Override
public float getSourcePitch(float entityPitch) {
return orientation.getOpposite().getFrontOffsetY() * 90;
return orientation.getOpposite().getYOffset() * 90;
}
@Override

View file

@ -1,6 +1,7 @@
package org.dimdev.dimdoors.shared.tileentities;
import lombok.Getter;
import lombok.ToString;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
@ -24,7 +25,7 @@ import org.dimdev.pocketlib.VirtualLocation;
import javax.annotation.Nonnull;
import org.dimdev.dimdoors.shared.pockets.PocketTemplate;
@NBTSerializable public abstract class TileEntityRift extends TileEntity implements ITarget, IEntityTarget {
@ToString @NBTSerializable public abstract class TileEntityRift extends TileEntity implements ITarget, IEntityTarget {
/*@Saved*/ @Nonnull @Getter /*protected*/ VirtualTarget destination; // How the rift acts as a source
@Saved @Getter protected LinkProperties properties; // How the rift acts as a target, and properties that affect how it can link to other rifts

View file

@ -23,7 +23,7 @@ public class GatewayLimbo extends BaseGateway {
world.setBlockState(new BlockPos(x, y + 1, z - 1), unravelledFabric);
world.setBlockState(new BlockPos(x, y + 1, z + 1), unravelledFabric);
ItemDoor.placeDoor(world, new BlockPos(x, y + 1, z), EnumFacing.getHorizontal(0), ModBlocks.DIMENSIONAL_PORTAL, false);
ItemDoor.placeDoor(world, new BlockPos(x, y + 1, z), EnumFacing.byHorizontalIndex(0), ModBlocks.DIMENSIONAL_PORTAL, false);
}
@Override