Update mappings to stable_39-1.12 (#322)

This commit is contained in:
zeng-git
2023-11-08 05:21:59 +08:00
committed by GitHub
parent ba9b790a02
commit 4484863452
88 changed files with 239 additions and 212 deletions
+7 -7
View File
@@ -307,13 +307,13 @@ public abstract class AEBaseBlock extends Block {
return dir;
}
final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY();
final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ();
final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX();
final int west_x = forward.getYOffset() * up.getZOffset() - forward.getZOffset() * up.getYOffset();
final int west_y = forward.getZOffset() * up.getYOffset() - forward.getXOffset() * up.getZOffset();
final int west_z = forward.getXOffset() * up.getYOffset() - forward.getYOffset() * up.getXOffset();
EnumFacing west = null;
for (final EnumFacing dx : EnumFacing.VALUES) {
if (dx.getFrontOffsetX() == west_x && dx.getFrontOffsetY() == west_y && dx.getFrontOffsetZ() == west_z) {
if (dx.getXOffset() == west_x && dx.getYOffset() == west_y && dx.getZOffset() == west_z) {
west = dx;
}
}
@@ -348,12 +348,12 @@ public abstract class AEBaseBlock extends Block {
@Override
public String toString() {
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
String regName = this.getRegistryName() != null ? this.getRegistryName().getPath() : "unregistered";
return this.getClass().getSimpleName() + "[" + regName + "]";
}
protected String getUnlocalizedName(final ItemStack is) {
return this.getUnlocalizedName();
protected String getTranslationKey(final ItemStack is) {
return this.getTranslationKey();
}
protected boolean hasCustomRotation() {
@@ -38,6 +38,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@@ -77,8 +78,9 @@ public class AEBaseItemBlock extends ItemBlock {
}
@Override
public String getUnlocalizedName(final ItemStack is) {
return this.blockType.getUnlocalizedName(is);
@NotNull
public String getTranslationKey(final ItemStack is) {
return this.blockType.getTranslationKey(is);
}
@Override
@@ -137,7 +139,7 @@ public class AEBaseItemBlock extends ItemBlock {
ori = ((IOrientableBlock) this.blockType).getOrientable(w, pos);
up = side;
forward = EnumFacing.SOUTH;
if (up.getFrontOffsetY() == 0) {
if (up.getYOffset() == 0) {
forward = EnumFacing.UP;
}
}
@@ -36,16 +36,18 @@ public abstract class AEBaseStairBlock extends BlockStairs {
super(block.getDefaultState());
Preconditions.checkNotNull(block);
Preconditions.checkNotNull(block.getUnlocalizedName());
Preconditions.checkArgument(block.getUnlocalizedName().length() > 0);
Preconditions.checkNotNull(block.getTranslationKey());
Preconditions.checkArgument(block.getTranslationKey().length() > 0);
this.setUnlocalizedName("stair." + type);
this.setTranslationKey("stair." + type);
this.getLocalizedName();
this.setLightOpacity(0);
}
@Override
public String toString() {
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
String regName = this.getRegistryName() != null ? this.getRegistryName().getPath() : "unregistered";
return this.getClass().getSimpleName() + "[" + regName + "]";
}
@@ -288,7 +288,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return false;
}
final String name = this.getUnlocalizedName();
final String name = this.getTranslationKey();
if (player.isSneaking()) {
final NBTTagCompound data = tileEntity.downloadSettings(SettingsFrom.MEMORY_CARD);
@@ -300,7 +300,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
final String savedName = memoryCard.getSettingsName(heldItem);
final NBTTagCompound data = memoryCard.getData(heldItem);
if (this.getUnlocalizedName().equals(savedName)) {
if (this.getTranslationKey().equals(savedName)) {
tileEntity.uploadSettings(SettingsFrom.MEMORY_CARD, data, player);
memoryCard.notifyUser(player, MemoryCardMessages.SETTINGS_LOADED);
} else {
@@ -43,6 +43,7 @@ import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import javax.annotation.Nonnull;
import java.util.EnumSet;
@@ -111,7 +112,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -38,6 +38,8 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nonnull;
public class BlockMolecularAssembler extends AEBaseTileBlock {
@@ -72,7 +74,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock {
*/
@SideOnly(Side.CLIENT)
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -121,15 +121,15 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision {
final EnumFacing forward = tile.getForward();
final AEAxisAlignedBB bb = new AEAxisAlignedBB(twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels);
if (up.getFrontOffsetX() != 0) {
if (up.getXOffset() != 0) {
bb.minX = 0;
bb.maxX = 1;
}
if (up.getFrontOffsetY() != 0) {
if (up.getYOffset() != 0) {
bb.minY = 0;
bb.maxY = 1;
}
if (up.getFrontOffsetZ() != 0) {
if (up.getZOffset() != 0) {
bb.minZ = 0;
bb.maxZ = 1;
}
@@ -68,7 +68,7 @@ public class BlockInscriber extends AEBaseTileBlock {
}
@Override
public String getUnlocalizedName(final ItemStack is) {
return super.getUnlocalizedName(is);
public String getTranslationKey(final ItemStack is) {
return super.getTranslationKey(is);
}
}
@@ -41,6 +41,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
import java.util.Random;
@@ -115,9 +116,9 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(final World w, final BlockPos pos, final Entity thePlayer, final boolean b) {
final EnumFacing up = this.getOrientable(w, pos).getUp();
final double xOff = -0.3 * up.getFrontOffsetX();
final double yOff = -0.3 * up.getFrontOffsetY();
final double zOff = -0.3 * up.getFrontOffsetZ();
final double xOff = -0.3 * up.getXOffset();
final double yOff = -0.3 * up.getYOffset();
final double zOff = -0.3 * up.getZOffset();
return Collections.singletonList(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
}
@@ -167,7 +168,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -44,6 +44,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
import java.util.Random;
@@ -107,9 +108,9 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(final World w, final BlockPos pos, final Entity e, final boolean isVisual) {
final EnumFacing up = this.getOrientable(w, pos).getUp();
final double xOff = -0.3 * up.getFrontOffsetX();
final double yOff = -0.3 * up.getFrontOffsetY();
final double zOff = -0.3 * up.getFrontOffsetZ();
final double xOff = -0.3 * up.getXOffset();
final double yOff = -0.3 * up.getYOffset();
final double zOff = -0.3 * up.getZOffset();
return Collections.singletonList(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
}
@@ -134,9 +135,9 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
}
final EnumFacing up = this.getOrientable(w, pos).getUp();
final double xOff = -0.3 * up.getFrontOffsetX();
final double yOff = -0.3 * up.getFrontOffsetY();
final double zOff = -0.3 * up.getFrontOffsetZ();
final double xOff = -0.3 * up.getXOffset();
final double yOff = -0.3 * up.getYOffset();
final double zOff = -0.3 * up.getZOffset();
for (int bolts = 0; bolts < 3; bolts++) {
if (AppEng.proxy.shouldAddParticles(r)) {
final LightningFX fx = new LightningFX(w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D);
@@ -192,7 +193,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -87,9 +87,9 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
double ry = 0.5 + pos.getY();
double rz = 0.5 + pos.getZ();
rx += up.getFrontOffsetX() * d0;
ry += up.getFrontOffsetY() * d0;
rz += up.getFrontOffsetZ() * d0;
rx += up.getXOffset() * d0;
ry += up.getYOffset() * d0;
rz += up.getZOffset() * d0;
final int x = pos.getX();
final int y = pos.getY();
@@ -103,25 +103,25 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
case 0:
dx = 0.6;
dz = d1;
pt = new BlockPos(x + west.getFrontOffsetX(), y + west.getFrontOffsetY(), z + west.getFrontOffsetZ());
pt = new BlockPos(x + west.getXOffset(), y + west.getYOffset(), z + west.getZOffset());
break;
case 1:
dx = d1;
dz += 0.6;
pt = new BlockPos(x + forward.getFrontOffsetX(), y + forward.getFrontOffsetY(), z + forward.getFrontOffsetZ());
pt = new BlockPos(x + forward.getXOffset(), y + forward.getYOffset(), z + forward.getZOffset());
break;
case 2:
dx = d1;
dz = -0.6;
pt = new BlockPos(x - forward.getFrontOffsetX(), y - forward.getFrontOffsetY(), z - forward.getFrontOffsetZ());
pt = new BlockPos(x - forward.getXOffset(), y - forward.getYOffset(), z - forward.getZOffset());
break;
case 3:
dx = -0.6;
dz = d1;
pt = new BlockPos(x - west.getFrontOffsetX(), y - west.getFrontOffsetY(), z - west.getFrontOffsetZ());
pt = new BlockPos(x - west.getXOffset(), y - west.getYOffset(), z - west.getZOffset());
break;
}
@@ -130,13 +130,13 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
return;
}
rx += dx * west.getFrontOffsetX();
ry += dx * west.getFrontOffsetY();
rz += dx * west.getFrontOffsetZ();
rx += dx * west.getXOffset();
ry += dx * west.getYOffset();
rz += dx * west.getZOffset();
rx += dz * forward.getFrontOffsetX();
ry += dz * forward.getFrontOffsetY();
rz += dz * forward.getFrontOffsetZ();
rx += dz * forward.getXOffset();
ry += dz * forward.getYOffset();
rz += dz * forward.getZOffset();
final LightningFX fx = new LightningFX(w, rx, ry, rz, 0.0D, 0.0D, 0.0D);
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
@@ -37,6 +37,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -56,7 +57,7 @@ public class BlockSecurityStation extends AEBaseTileBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -89,7 +89,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision {
@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
if (world.isBlockIndirectlyGettingPowered(pos) > 0) {
if (world.getRedstonePowerFromNeighbors(pos) > 0) {
this.startFuse(world, pos, null);
world.setBlockToAir(pos);
}
@@ -99,7 +99,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision {
public void onBlockAdded(final World w, final BlockPos pos, final IBlockState state) {
super.onBlockAdded(w, pos, state);
if (w.isBlockIndirectlyGettingPowered(pos) > 0) {
if (w.getRedstonePowerFromNeighbors(pos) > 0) {
this.startFuse(w, pos, null);
w.setBlockToAir(pos);
}
@@ -102,20 +102,20 @@ public final class BlockVibrationChamber extends AEBaseTileBlock {
final EnumFacing forward = tc.getForward();
final EnumFacing up = tc.getUp();
final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY();
final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ();
final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX();
final int west_x = forward.getYOffset() * up.getZOffset() - forward.getZOffset() * up.getYOffset();
final int west_y = forward.getZOffset() * up.getXOffset() - forward.getXOffset() * up.getZOffset();
final int west_z = forward.getXOffset() * up.getYOffset() - forward.getYOffset() * up.getXOffset();
f1 += forward.getFrontOffsetX() * 0.6;
f2 += forward.getFrontOffsetY() * 0.6;
f3 += forward.getFrontOffsetZ() * 0.6;
f1 += forward.getXOffset() * 0.6;
f2 += forward.getYOffset() * 0.6;
f3 += forward.getZOffset() * 0.6;
final float ox = r.nextFloat();
final float oy = r.nextFloat() * 0.2f;
f1 += up.getFrontOffsetX() * (-0.3 + oy);
f2 += up.getFrontOffsetY() * (-0.3 + oy);
f3 += up.getFrontOffsetZ() * (-0.3 + oy);
f1 += up.getXOffset() * (-0.3 + oy);
f2 += up.getYOffset() * (-0.3 + oy);
f3 += up.getZOffset() * (-0.3 + oy);
f1 += west_x * (0.3 * ox - 0.15);
f2 += west_y * (0.3 * ox - 0.15);
@@ -152,7 +152,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IAEFacade {
}
@Override
public void onEntityCollidedWithBlock(final World w, final BlockPos pos, final IBlockState state, final Entity entityIn) {
public void onEntityCollision(final World w, final BlockPos pos, final IBlockState state, final Entity entityIn) {
this.cb(w, pos).onEntityCollision(entityIn);
}
@@ -33,6 +33,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
public class BlockController extends AEBaseTileBlock {
@@ -144,7 +146,7 @@ public class BlockController extends AEBaseTileBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -40,6 +40,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
@@ -68,7 +69,7 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -44,6 +44,7 @@ import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Collections;
import java.util.Random;
@@ -81,7 +82,7 @@ public class BlockPaint extends AEBaseTileBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -37,6 +37,8 @@ import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import javax.annotation.Nonnull;
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision {
@@ -86,7 +88,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -105,9 +105,9 @@ class QnbFormedBakedModel implements IBakedModel {
for (EnumFacing facing : EnumFacing.values()) {
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
// (avoids z-fighting)
float xOffset = Math.abs(facing.getFrontOffsetX() * 0.01f);
float yOffset = Math.abs(facing.getFrontOffsetY() * 0.01f);
float zOffset = Math.abs(facing.getFrontOffsetZ() * 0.01f);
float xOffset = Math.abs(facing.getXOffset() * 0.01f);
float yOffset = Math.abs(facing.getYOffset() * 0.01f);
float zOffset = Math.abs(facing.getZOffset() * 0.01f);
builder.setDrawFaces(EnumSet.of(facing));
builder.addCube(
@@ -130,9 +130,9 @@ class QnbFormedBakedModel implements IBakedModel {
for (EnumFacing facing : EnumFacing.values()) {
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
// (avoids z-fighting)
float xOffset = Math.abs(facing.getFrontOffsetX() * 0.01f);
float yOffset = Math.abs(facing.getFrontOffsetY() * 0.01f);
float zOffset = Math.abs(facing.getFrontOffsetZ() * 0.01f);
float xOffset = Math.abs(facing.getXOffset() * 0.01f);
float yOffset = Math.abs(facing.getYOffset() * 0.01f);
float zOffset = Math.abs(facing.getZOffset() * 0.01f);
builder.setDrawFaces(EnumSet.of(facing));
builder.addCube(
@@ -34,6 +34,8 @@ import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import javax.annotation.Nonnull;
public class BlockSpatialPylon extends AEBaseTileBlock {
@@ -83,7 +85,7 @@ public class BlockSpatialPylon extends AEBaseTileBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -38,6 +38,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -56,7 +57,7 @@ public class BlockChest extends AEBaseTileBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -40,6 +40,7 @@ import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -52,7 +53,7 @@ public class BlockDrive extends AEBaseTileBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -99,18 +99,18 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision {
o = sk.getUp();
}
final double offsetX = o.getFrontOffsetX() == 0 ? AABB_OFFSET_SIDES : 0.0;
final double offsetY = o.getFrontOffsetY() == 0 ? AABB_OFFSET_SIDES : 0.0;
final double offsetZ = o.getFrontOffsetZ() == 0 ? AABB_OFFSET_SIDES : 0.0;
final double offsetX = o.getXOffset() == 0 ? AABB_OFFSET_SIDES : 0.0;
final double offsetY = o.getYOffset() == 0 ? AABB_OFFSET_SIDES : 0.0;
final double offsetZ = o.getZOffset() == 0 ? AABB_OFFSET_SIDES : 0.0;
// for x/z top and bottom is swapped
final double minX = Math.max(0.0, offsetX + (o.getFrontOffsetX() < 0 ? AABB_OFFSET_BOTTOM : (o.getFrontOffsetX() * AABB_OFFSET_TOP)));
final double minY = Math.max(0.0, offsetY + (o.getFrontOffsetY() < 0 ? AABB_OFFSET_TOP : (o.getFrontOffsetY() * AABB_OFFSET_BOTTOM)));
final double minZ = Math.max(0.0, offsetZ + (o.getFrontOffsetZ() < 0 ? AABB_OFFSET_BOTTOM : (o.getFrontOffsetZ() * AABB_OFFSET_TOP)));
final double minX = Math.max(0.0, offsetX + (o.getXOffset() < 0 ? AABB_OFFSET_BOTTOM : (o.getXOffset() * AABB_OFFSET_TOP)));
final double minY = Math.max(0.0, offsetY + (o.getYOffset() < 0 ? AABB_OFFSET_TOP : (o.getYOffset() * AABB_OFFSET_BOTTOM)));
final double minZ = Math.max(0.0, offsetZ + (o.getZOffset() < 0 ? AABB_OFFSET_BOTTOM : (o.getZOffset() * AABB_OFFSET_TOP)));
final double maxX = Math.min(1.0, 1.0 - offsetX - (o.getFrontOffsetX() < 0 ? AABB_OFFSET_TOP : (o.getFrontOffsetX() * AABB_OFFSET_BOTTOM)));
final double maxY = Math.min(1.0, 1.0 - offsetY - (o.getFrontOffsetY() < 0 ? AABB_OFFSET_BOTTOM : (o.getFrontOffsetY() * AABB_OFFSET_TOP)));
final double maxZ = Math.min(1.0, 1.0 - offsetZ - (o.getFrontOffsetZ() < 0 ? AABB_OFFSET_TOP : (o.getFrontOffsetZ() * AABB_OFFSET_BOTTOM)));
final double maxX = Math.min(1.0, 1.0 - offsetX - (o.getXOffset() < 0 ? AABB_OFFSET_TOP : (o.getXOffset() * AABB_OFFSET_BOTTOM)));
final double maxY = Math.min(1.0, 1.0 - offsetY - (o.getYOffset() < 0 ? AABB_OFFSET_BOTTOM : (o.getYOffset() * AABB_OFFSET_TOP)));
final double maxZ = Math.min(1.0, 1.0 - offsetZ - (o.getZOffset() < 0 ? AABB_OFFSET_TOP : (o.getZOffset() * AABB_OFFSET_BOTTOM)));
return new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ);
}
@@ -164,7 +164,7 @@ class BlockDefinitionBuilder implements IBlockBuilder {
// Create block and matching item, and set factory name of both
Block block = this.blockSupplier.get();
block.setRegistryName(AppEng.MOD_ID, this.registryName);
block.setUnlocalizedName("appliedenergistics2." + this.registryName);
block.setTranslationKey("appliedenergistics2." + this.registryName);
ItemBlock item = this.constructItemFromBlock(block);
if (item != null) {
@@ -116,11 +116,11 @@ class BlockRendering implements IBlockRendering, ISelectiveResourceReloadListene
}
if (this.modelCustomizer != null) {
factory.addModelOverride(block.getRegistryName().getResourcePath(), this.modelCustomizer);
factory.addModelOverride(block.getRegistryName().getPath(), this.modelCustomizer);
} else if (block instanceof AEBaseTileBlock) {
// This is a default rotating model if the base-block uses an AE tile entity which exposes UP/FRONT as
// extended props
factory.addModelOverride(block.getRegistryName().getResourcePath(), (l, m) -> {
factory.addModelOverride(block.getRegistryName().getPath(), (l, m) -> {
AutoRotatingModel model = new AutoRotatingModel(m);
BlockRendering.this.reloads.add(model);
return model;
@@ -126,7 +126,7 @@ class ItemDefinitionBuilder implements IItemBuilder {
ItemDefinition definition = new ItemDefinition(this.registryName, item);
item.setUnlocalizedName("appliedenergistics2." + this.registryName);
item.setTranslationKey("appliedenergistics2." + this.registryName);
item.setCreativeTab(this.creativeTab);
// Register all extra handlers
@@ -61,7 +61,7 @@ public class ModelOverrideComponent implements IPreInitComponent {
IModel missingModel = ModelLoaderRegistry.getMissingModel();
for (ModelResourceLocation location : keys) {
if (!location.getResourceDomain().equals(AppEng.MOD_ID)) {
if (!location.getNamespace().equals(AppEng.MOD_ID)) {
continue;
}
@@ -72,7 +72,7 @@ public class ModelOverrideComponent implements IPreInitComponent {
continue;
}
BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer = this.customizer.get(location.getResourcePath());
BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer = this.customizer.get(location.getPath());
if (customizer != null) {
IBakedModel newModel = customizer.apply(location, orgModel);
@@ -47,7 +47,7 @@ public class TesrRenderHelper {
* at the center of a block.
*/
public static void moveToFace(EnumFacing face) {
GlStateManager.translate(face.getFrontOffsetX() * 0.50, face.getFrontOffsetY() * 0.50, face.getFrontOffsetZ() * 0.50);
GlStateManager.translate(face.getXOffset() * 0.50, face.getYOffset() * 0.50, face.getZOffset() * 0.50);
}
/**
@@ -398,7 +398,7 @@ public class CubeBuilder {
builder.put(i, x, y, z);
break;
case NORMAL:
builder.put(i, face.getFrontOffsetX(), face.getFrontOffsetY(), face.getFrontOffsetZ());
builder.put(i, face.getXOffset(), face.getYOffset(), face.getZOffset());
break;
case COLOR:
// Color format is RGBA
@@ -72,7 +72,7 @@ public class QuadRotator {
// Figure out where the position is in the array
VertexFormat format = quad.getFormat();
int posIdx = this.findPositionOffset(format) / 4;
int stride = format.getNextOffset() / 4;
int stride = format.getSize() / 4;
int normalIdx = format.getNormalOffset();
VertexFormatElement.EnumType normalType = null;
// Figure out the type of the normals
@@ -43,16 +43,16 @@ public class BuiltInModelLoader implements ICustomModelLoader {
@Override
public boolean accepts(ResourceLocation modelLocation) {
if (!modelLocation.getResourceDomain().equals(AppEng.MOD_ID)) {
if (!modelLocation.getNamespace().equals(AppEng.MOD_ID)) {
return false;
}
return this.builtInModels.containsKey(modelLocation.getResourcePath());
return this.builtInModels.containsKey(modelLocation.getPath());
}
@Override
public IModel loadModel(ResourceLocation modelLocation) throws Exception {
return this.builtInModels.get(modelLocation.getResourcePath());
return this.builtInModels.get(modelLocation.getPath());
}
@Override
@@ -137,14 +137,14 @@ public enum UVLModelLoader implements ICustomModelLoader {
@Override
public boolean accepts(ResourceLocation modelLocation) {
String modelPath = modelLocation.getResourcePath();
if (modelLocation.getResourcePath().startsWith("models/")) {
String modelPath = modelLocation.getPath();
if (modelLocation.getPath().startsWith("models/")) {
modelPath = modelPath.substring("models/".length());
}
try (InputStreamReader io = new InputStreamReader(Minecraft.getMinecraft()
.getResourceManager()
.getResource(new ResourceLocation(modelLocation.getResourceDomain(), "models/" + modelPath + ".json"))
.getResource(new ResourceLocation(modelLocation.getNamespace(), "models/" + modelPath + ".json"))
.getInputStream())) {
return gson.fromJson(io, UVLMarker.class).ae2_uvl_marker;
} catch (Exception e) {
@@ -174,11 +174,11 @@ public enum UVLModelLoader implements ICustomModelLoader {
private final IModel parent;
public UVLModelWrapper(ResourceLocation modelLocation) {
String modelPath = modelLocation.getResourcePath();
if (modelLocation.getResourcePath().startsWith("models/")) {
String modelPath = modelLocation.getPath();
if (modelLocation.getPath().startsWith("models/")) {
modelPath = modelPath.substring("models/".length());
}
ResourceLocation armatureLocation = new ResourceLocation(modelLocation.getResourceDomain(), "armatures/" + modelPath + ".json");
ResourceLocation armatureLocation = new ResourceLocation(modelLocation.getNamespace(), "armatures/" + modelPath + ".json");
ModelBlockAnimation animation = ModelBlockAnimation.loadVanillaAnimation(UVLModelLoader.this.resourceManager, armatureLocation);
ModelBlock model;
{
@@ -187,12 +187,12 @@ public enum UVLModelLoader implements ICustomModelLoader {
ModelBlock lvt_5_1_ = null;
try {
String s = modelLocation.getResourcePath();
String s = modelLocation.getPath();
iresource = Minecraft.getMinecraft()
.getResourceManager()
.getResource(
new ResourceLocation(modelLocation.getResourceDomain(), "models/" + modelPath + ".json"));
new ResourceLocation(modelLocation.getNamespace(), "models/" + modelPath + ".json"));
reader = new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8);
lvt_5_1_ = JsonUtils.gsonDeserialize(this.UVLSERIALIZER, reader, ModelBlock.class, false);
@@ -41,7 +41,7 @@ public class SpatialPylonRendering extends BlockRenderingCustomizer {
@Override
@SideOnly(Side.CLIENT)
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
rendering.builtInModel(MODEL_ID.getResourcePath(), new SpatialPylonModel());
rendering.builtInModel(MODEL_ID.getPath(), new SpatialPylonModel());
rendering.stateMapper(this::mapState);
}
@@ -163,7 +163,7 @@ public final class ContainerFluidInterfaceConfigurationTerminal extends AEBaseCo
}
}
if (!this.data.hasNoTags()) {
if (!this.data.isEmpty()) {
try {
NetworkHandler.instance().sendTo(new PacketCompressedNBT(this.data), (EntityPlayerMP) this.getPlayerInv().player);
} catch (final IOException e) {
@@ -251,7 +251,7 @@ public final class ContainerFluidInterfaceConfigurationTerminal extends AEBaseCo
final String name = '=' + Long.toString(inv.which, Character.MAX_RADIX);
final NBTTagCompound tag = data.getCompoundTag(name);
if (tag.hasNoTags()) {
if (tag.isEmpty()) {
tag.setLong("sortBy", inv.sortBy);
tag.setString("un", inv.unlocalizedName);
tag.setTag("pos", NBTUtil.createPosTag(inv.pos));
@@ -153,7 +153,7 @@ public final class ContainerInterfaceConfigurationTerminal extends AEBaseContain
}
}
if (!this.data.hasNoTags()) {
if (!this.data.isEmpty()) {
try {
NetworkHandler.instance().sendTo(new PacketCompressedNBT(this.data), (EntityPlayerMP) this.getPlayerInv().player);
} catch (final IOException e) {
@@ -296,7 +296,7 @@ public final class ContainerInterfaceConfigurationTerminal extends AEBaseContain
final String name = '=' + Long.toString(inv.which, Character.MAX_RADIX);
final NBTTagCompound tag = data.getCompoundTag(name);
if (tag.hasNoTags()) {
if (tag.isEmpty()) {
tag.setLong("sortBy", inv.sortBy);
tag.setString("un", inv.unlocalizedName);
tag.setTag("pos", NBTUtil.createPosTag(inv.pos));
@@ -160,7 +160,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
}
}
if (!this.data.hasNoTags()) {
if (!this.data.isEmpty()) {
try {
NetworkHandler.instance().sendTo(new PacketCompressedNBT(this.data), (EntityPlayerMP) this.getPlayerInv().player);
} catch (final IOException e) {
@@ -330,7 +330,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
final String name = '=' + Long.toString(inv.which, Character.MAX_RADIX);
final NBTTagCompound tag = data.getCompoundTag(name);
if (tag.hasNoTags()) {
if (tag.isEmpty()) {
tag.setLong("sortBy", inv.sortBy);
tag.setString("un", inv.unlocalizedName);
tag.setTag("pos", NBTUtil.createPosTag(inv.pos));
+3 -3
View File
@@ -40,12 +40,12 @@ public final class CreativeTab extends CreativeTabs {
}
@Override
public ItemStack getTabIconItem() {
return this.getIconItemStack();
public ItemStack getIcon() {
return this.createIcon();
}
@Override
public ItemStack getIconItemStack() {
public ItemStack createIcon() {
final IDefinitions definitions = AEApi.instance().definitions();
final IBlocks blocks = definitions.blocks();
final IItems items = definitions.items();
@@ -42,12 +42,12 @@ public final class CreativeTabFacade extends CreativeTabs {
}
@Override
public ItemStack getTabIconItem() {
return this.getIconItemStack();
public ItemStack getIcon() {
return this.createIcon();
}
@Override
public ItemStack getIconItemStack() {
public ItemStack createIcon() {
final Optional<Item> maybeFacade = AEApi.instance().definitions().items().facade().maybeItem();
if (maybeFacade.isPresent()) {
return ((ItemFacade) maybeFacade.get()).getCreativeTabIcon();
@@ -252,7 +252,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry {
// Use the mod id as last option.
for (final Entry<String, TunnelType> entry : this.modIdTunnels.entrySet()) {
if (trigger.getItem().getRegistryName() != null && trigger.getItem().getRegistryName().getResourceDomain().equals(entry.getKey())) {
if (trigger.getItem().getRegistryName() != null && trigger.getItem().getRegistryName().getNamespace().equals(entry.getKey())) {
return entry.getValue();
}
}
@@ -122,7 +122,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
return null;
}
this.log("Recipe for '%1$s' found '%2$s'", input.getUnlocalizedName(), Platform.getItemDisplayName(recipe.getOutput()));
this.log("Recipe for '%1$s' found '%2$s'", input.getTranslationKey(), Platform.getItemDisplayName(recipe.getOutput()));
return recipe;
}
@@ -29,7 +29,7 @@ public class CraftBranchFailure extends Exception {
private final IAEItemStack missing;
public CraftBranchFailure(final IAEItemStack what, final long howMany) {
super("Failed: " + what.getItem().getUnlocalizedName() + " x " + howMany);
super("Failed: " + what.getItem().getTranslationKey() + " x " + howMany);
this.missing = what.copy();
this.missing.setStackSize(howMany);
}
@@ -89,9 +89,9 @@ public class ToolReplicatorCard extends AEBaseItem {
final DimensionalCoord min = sc.getMin();
final DimensionalCoord max = sc.getMax();
x += currentSideOff.getFrontOffsetX();
y += currentSideOff.getFrontOffsetY();
z += currentSideOff.getFrontOffsetZ();
x += currentSideOff.getXOffset();
y += currentSideOff.getYOffset();
z += currentSideOff.getZOffset();
final int min_x = min.x;
final int min_y = min.y;
@@ -86,8 +86,8 @@ public abstract class BlockSlabCommon extends BlockSlab {
}
@Override
public String getUnlocalizedName(int meta) {
return this.getUnlocalizedName();
public String getTranslationKey(int meta) {
return this.getTranslationKey();
}
@Override
@@ -33,6 +33,7 @@ import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import javax.annotation.Nonnull;
import java.util.EnumSet;
@@ -77,7 +78,7 @@ public class BlockQuartzGlass extends AEBaseBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -31,6 +31,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import java.util.Random;
@@ -42,7 +43,7 @@ public class BlockQuartzOre extends AEBaseBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@@ -275,8 +275,8 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
try {
Vec3d from = new Vec3d(hostTile.getPos().getX() + 0.5, hostTile.getPos().getY() + 0.5, hostTile.getPos().getZ() + 0.5);
from = from.addVector(direction.getFrontOffsetX() * 0.501, direction.getFrontOffsetY() * 0.501, direction.getFrontOffsetZ() * 0.501);
final Vec3d to = from.addVector(direction.getFrontOffsetX(), direction.getFrontOffsetY(), direction.getFrontOffsetZ());
from = from.add(direction.getXOffset() * 0.501, direction.getYOffset() * 0.501, direction.getZOffset() * 0.501);
final Vec3d to = from.add(direction.getXOffset(), direction.getYOffset(), direction.getZOffset());
final RayTraceResult mop = hostWorld.rayTraceBlocks(from, to, true);
if (mop != null && !BAD_BLOCKS.contains(directedBlock)) {
if (mop.getBlockPos().equals(directedTile.getPos())) {
@@ -296,7 +296,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
final Item item = Item.getItemFromBlock(directedBlock);
if (item == Items.AIR) {
return directedBlock.getUnlocalizedName();
return directedBlock.getTranslationKey();
}
}
}
@@ -256,7 +256,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
final NBTTagCompound c = w.getCompoundTagAt(x);
if (c != null) {
final ItemStack is = stackFromNBT(c);
this.addToSendListFacing(is, EnumFacing.getFront(s.getIndex()));
this.addToSendListFacing(is, EnumFacing.byIndex(s.getIndex()));
}
}
}
@@ -1025,14 +1025,14 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
phantomTE = ((IPhantomTile) te);
if (phantomTE.hasBoundPosition()) {
TileEntity phantom = w.getTileEntity(phantomTE.getBoundPosition());
if (NonBlockingItems.INSTANCE.getMap().containsKey(w.getBlockState(phantomTE.getBoundPosition()).getBlock().getRegistryName().getResourceDomain())) {
if (NonBlockingItems.INSTANCE.getMap().containsKey(w.getBlockState(phantomTE.getBoundPosition()).getBlock().getRegistryName().getNamespace())) {
if (isCustomInvBlocking(phantom, s)) {
visitedFaces.remove(s);
continue;
}
}
}
} else if (NonBlockingItems.INSTANCE.getMap().containsKey(w.getBlockState(tile.getPos().offset(s)).getBlock().getRegistryName().getResourceDomain())) {
} else if (NonBlockingItems.INSTANCE.getMap().containsKey(w.getBlockState(tile.getPos().offset(s)).getBlock().getRegistryName().getNamespace())) {
if (isCustomInvBlocking(te, s)) {
visitedFaces.remove(s);
continue;
@@ -1113,14 +1113,14 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
IPhantomTile phantomTE = ((IPhantomTile) te);
if (phantomTE.hasBoundPosition()) {
TileEntity phantom = w.getTileEntity(phantomTE.getBoundPosition());
if (NonBlockingItems.INSTANCE.getMap().containsKey(w.getBlockState(phantomTE.getBoundPosition()).getBlock().getRegistryName().getResourceDomain())) {
if (NonBlockingItems.INSTANCE.getMap().containsKey(w.getBlockState(phantomTE.getBoundPosition()).getBlock().getRegistryName().getNamespace())) {
if (!isCustomInvBlocking(phantom, s)) {
allAreBusy = false;
break;
}
}
}
} else if (NonBlockingItems.INSTANCE.getMap().containsKey(w.getBlockState(tile.getPos().offset(s)).getBlock().getRegistryName().getResourceDomain())) {
} else if (NonBlockingItems.INSTANCE.getMap().containsKey(w.getBlockState(tile.getPos().offset(s)).getBlock().getRegistryName().getNamespace())) {
if (!isCustomInvBlocking(te, s)) {
allAreBusy = false;
break;
@@ -1300,8 +1300,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
try {
Vec3d from = new Vec3d(hostTile.getPos().getX() + 0.5, hostTile.getPos().getY() + 0.5, hostTile.getPos().getZ() + 0.5);
from = from.addVector(direction.getFrontOffsetX() * 0.501, direction.getFrontOffsetY() * 0.501, direction.getFrontOffsetZ() * 0.501);
final Vec3d to = from.addVector(direction.getFrontOffsetX(), direction.getFrontOffsetY(), direction.getFrontOffsetZ());
from = from.add(direction.getXOffset() * 0.501, direction.getYOffset() * 0.501, direction.getZOffset() * 0.501);
final Vec3d to = from.add(direction.getXOffset(), direction.getYOffset(), direction.getZOffset());
final RayTraceResult mop = hostWorld.rayTraceBlocks(from, to, true);
if (mop != null && !BAD_BLOCKS.contains(directedBlock)) {
if (mop.getBlockPos().equals(directedTile.getPos())) {
@@ -1321,7 +1321,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
final Item item = Item.getItemFromBlock(directedBlock);
if (item == Items.AIR) {
return directedBlock.getUnlocalizedName();
return directedBlock.getTranslationKey();
}
}
}
@@ -59,7 +59,7 @@ public class InvalidPatternHelper {
NBTTagCompound in = inTag.getCompoundTagAt(i);
// skip empty slots in the crafting grid
if (in.hasNoTags()) {
if (in.isEmpty()) {
continue;
}
@@ -45,7 +45,7 @@ public class LocationRotation implements IOrientable {
@Override
public EnumFacing getForward() {
if (this.getUp().getFrontOffsetY() == 0) {
if (this.getUp().getYOffset() == 0) {
return EnumFacing.UP;
}
return EnumFacing.SOUTH;
@@ -49,7 +49,7 @@ public class MetaRotation implements IOrientable {
@Override
public EnumFacing getForward() {
if (this.getUp().getFrontOffsetY() == 0) {
if (this.getUp().getYOffset() == 0) {
return EnumFacing.UP;
}
return EnumFacing.SOUTH;
@@ -54,7 +54,7 @@ public class MultiCraftingTracker {
for (int x = 0; x < this.size; x++) {
final NBTTagCompound link = extra.getCompoundTag("links-" + x);
if (link != null && !link.hasNoTags()) {
if (link != null && !link.isEmpty()) {
this.setLink(x, AEApi.instance().storage().loadCraftingLink(link, this.owner));
}
}
@@ -95,7 +95,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
NBTTagCompound ingredient = inTag.getCompoundTagAt(x);
final ItemStack gs = stackFromNBT(ingredient);
if (!ingredient.hasNoTags() && gs.isEmpty()) {
if (!ingredient.isEmpty() && gs.isEmpty()) {
throw new IllegalArgumentException("No pattern here!");
}
@@ -126,7 +126,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
NBTTagCompound resultItemTag = outTag.getCompoundTagAt(x);
final ItemStack gs = stackFromNBT(resultItemTag);
if (!resultItemTag.hasNoTags() && gs.isEmpty()) {
if (!resultItemTag.isEmpty() && gs.isEmpty()) {
throw new IllegalArgumentException("No pattern here!");
}
@@ -34,9 +34,9 @@ public final class DispenserBehaviorTinyTNT extends BehaviorDefaultDispenseItem
protected ItemStack dispenseStack(final IBlockSource dispenser, final ItemStack dispensedItem) {
final EnumFacing enumfacing = dispenser.getBlockState().getValue(BlockDispenser.FACING);
final World world = dispenser.getWorld();
final int i = dispenser.getBlockPos().getX() + enumfacing.getFrontOffsetX();
final int j = dispenser.getBlockPos().getY() + enumfacing.getFrontOffsetY();
final int k = dispenser.getBlockPos().getZ() + enumfacing.getFrontOffsetZ();
final int i = dispenser.getBlockPos().getX() + enumfacing.getXOffset();
final int j = dispenser.getBlockPos().getY() + enumfacing.getYOffset();
final int k = dispenser.getBlockPos().getZ() + enumfacing.getZOffset();
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed(world, i + 0.5F, j + 0.5F, k + 0.5F, null);
world.spawnEntity(primedTinyTNTEntity);
dispensedItem.setCount(dispensedItem.getCount() - 1);
@@ -42,7 +42,7 @@ public final class DispenserMatterCannon extends BehaviorDefaultDispenseItem {
final EnumFacing enumfacing = dispenser.getBlockState().getValue(BlockDispenser.FACING);
AEPartLocation dir = AEPartLocation.INTERNAL;
for (final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS) {
if (enumfacing.getFrontOffsetX() == d.xOffset && enumfacing.getFrontOffsetY() == d.yOffset && enumfacing.getFrontOffsetZ() == d.zOffset) {
if (enumfacing.getXOffset() == d.xOffset && enumfacing.getYOffset() == d.yOffset && enumfacing.getZOffset() == d.zOffset) {
dir = d;
}
}
@@ -35,7 +35,7 @@ public final class PartAccessor {
public Optional<IPart> getMaybePart(final TileEntity te, final IProbeHitData data) {
if (te instanceof IPartHost) {
BlockPos pos = data.getPos();
final Vec3d position = data.getHitVec().addVector(-pos.getX(), -pos.getY(), -pos.getZ());
final Vec3d position = data.getHitVec().add(-pos.getX(), -pos.getY(), -pos.getZ());
final IPartHost host = (IPartHost) te;
final SelectedPart sp = host.selectPart(position);
@@ -51,7 +51,7 @@ public final class PartAccessor {
public Optional<IPart> getMaybePart(final TileEntity te, final RayTraceResult mop) {
if (te instanceof IPartHost) {
BlockPos pos = mop.getBlockPos();
final Vec3d position = mop.hitVec.addVector(-pos.getX(), -pos.getY(), -pos.getZ());
final Vec3d position = mop.hitVec.add(-pos.getX(), -pos.getY(), -pos.getZ());
final IPartHost host = (IPartHost) te;
final SelectedPart sp = host.selectPart(position);
@@ -51,7 +51,7 @@ public final class Tracer {
final Vec3d headVec = this.getCorrectedHeadVec(player);
final Vec3d lookVec = player.getLook(1.0F);
final double reach = this.getBlockReachDistance_server(player);
final Vec3d endVec = headVec.addVector(lookVec.x * reach, lookVec.y * reach, lookVec.z * reach);
final Vec3d endVec = headVec.add(lookVec.x * reach, lookVec.y * reach, lookVec.z * reach);
return blockState.collisionRayTrace(world, pos, headVec, endVec);
}
+1 -1
View File
@@ -39,7 +39,7 @@ public abstract class AEBaseItem extends Item {
@Override
public String toString() {
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
String regName = this.getRegistryName() != null ? this.getRegistryName().getPath() : "unregistered";
return this.getClass().getSimpleName() + "[" + regName + "]";
}
@@ -63,6 +63,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.oredict.OreDictionary;
import javax.annotation.Nonnull;
import java.util.*;
import java.util.Map.Entry;
import java.util.regex.Matcher;
@@ -209,7 +210,8 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
}
@Override
public String getUnlocalizedName(final ItemStack is) {
@Nonnull
public String getTranslationKey(final ItemStack is) {
return "item.appliedenergistics2.material." + this.nameOf(is).toLowerCase();
}
@@ -39,6 +39,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Optional;
@@ -70,7 +71,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal {
{
crystalSeedStack.setItemDamage(certus2);
crystalSeedStack = newStyle(crystalSeedStack);
String itemName = crystalSeedStack.getItem().getRegistryName().getResourcePath();
String itemName = crystalSeedStack.getItem().getRegistryName().getPath();
return new ResolverResult(itemName, crystalSeedStack.getItemDamage(), crystalSeedStack.getTagCompound());
})
.orElse(null);
@@ -154,22 +155,23 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal {
}
@Override
public String getUnlocalizedName(final ItemStack is) {
@Nonnull
public String getTranslationKey(final ItemStack is) {
final int damage = getProgress(is);
if (damage < CERTUS + SINGLE_OFFSET) {
return this.getUnlocalizedName() + ".certus";
return this.getTranslationKey() + ".certus";
}
if (damage < NETHER + SINGLE_OFFSET) {
return this.getUnlocalizedName() + ".nether";
return this.getTranslationKey() + ".nether";
}
if (damage < FLUIX + SINGLE_OFFSET) {
return this.getUnlocalizedName() + ".fluix";
return this.getTranslationKey() + ".fluix";
}
return this.getUnlocalizedName();
return this.getTranslationKey();
}
@Override
@@ -94,7 +94,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
}
final NonNullList<ItemStack> tmpList = NonNullList.create();
b.getSubBlocks(b.getCreativeTabToDisplayOn(), tmpList);
b.getSubBlocks(b.getCreativeTab(), tmpList);
for (final ItemStack l : tmpList) {
final ItemStack facade = this.createFacadeForItem(l, false);
if (!facade.isEmpty()) {
@@ -141,7 +141,8 @@ public final class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
}
@Override
public String getUnlocalizedName(final ItemStack is) {
@Nonnull
public String getTranslationKey(final ItemStack is) {
Preconditions.checkNotNull(is);
return "item.appliedenergistics2.multi_part." + this.getTypeByStack(is).getUnlocalizedName().toLowerCase();
}
@@ -80,7 +80,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
static {
for (final AEColor color : AEColor.VALID_COLORS) {
final String dyeName = color.dye.getUnlocalizedName();
final String dyeName = color.dye.getTranslationKey();
final String oreDictName = "dye" + WordUtils.capitalize(dyeName);
final int oreDictId = OreDictionary.getOreID(oreDictName);
@@ -162,7 +162,7 @@ public class QuantumCluster implements ILocatable, IAECluster {
if (qc != null) {
final World theWorld = qc.center.getWorld();
if (!qc.isDestroyed) {
final Chunk c = theWorld.getChunkFromBlockCoords(qc.center.getPos());
final Chunk c = theWorld.getChunk(qc.center.getPos());
if (c.isLoaded()) {
final int id = theWorld.provider.getDimension();
final World cur = DimensionManager.getWorld(id);
+2 -2
View File
@@ -392,7 +392,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
}
return output.hasNoTags() ? null : output;
return output.isEmpty() ? null : output;
}
public boolean useStandardMemoryCard() {
@@ -416,7 +416,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
}
final String name = is.getUnlocalizedName();
final String name = is.getTranslationKey();
if (player.isSneaking()) {
final NBTTagCompound data = this.downloadSettings(SettingsFrom.MEMORY_CARD);
@@ -109,25 +109,25 @@ public class BusCollisionHelper implements IPartCollisionHelper {
maxY /= 16.0;
maxZ /= 16.0;
double aX = minX * this.x.getFrontOffsetX() + minY * this.y.getFrontOffsetX() + minZ * this.z.getFrontOffsetX();
double aY = minX * this.x.getFrontOffsetY() + minY * this.y.getFrontOffsetY() + minZ * this.z.getFrontOffsetY();
double aZ = minX * this.x.getFrontOffsetZ() + minY * this.y.getFrontOffsetZ() + minZ * this.z.getFrontOffsetZ();
double aX = minX * this.x.getXOffset() + minY * this.y.getXOffset() + minZ * this.z.getXOffset();
double aY = minX * this.x.getYOffset() + minY * this.y.getYOffset() + minZ * this.z.getYOffset();
double aZ = minX * this.x.getZOffset() + minY * this.y.getZOffset() + minZ * this.z.getZOffset();
double bX = maxX * this.x.getFrontOffsetX() + maxY * this.y.getFrontOffsetX() + maxZ * this.z.getFrontOffsetX();
double bY = maxX * this.x.getFrontOffsetY() + maxY * this.y.getFrontOffsetY() + maxZ * this.z.getFrontOffsetY();
double bZ = maxX * this.x.getFrontOffsetZ() + maxY * this.y.getFrontOffsetZ() + maxZ * this.z.getFrontOffsetZ();
double bX = maxX * this.x.getXOffset() + maxY * this.y.getXOffset() + maxZ * this.z.getXOffset();
double bY = maxX * this.x.getYOffset() + maxY * this.y.getYOffset() + maxZ * this.z.getYOffset();
double bZ = maxX * this.x.getZOffset() + maxY * this.y.getZOffset() + maxZ * this.z.getZOffset();
if (this.x.getFrontOffsetX() + this.y.getFrontOffsetX() + this.z.getFrontOffsetX() < 0) {
if (this.x.getXOffset() + this.y.getXOffset() + this.z.getXOffset() < 0) {
aX += 1;
bX += 1;
}
if (this.x.getFrontOffsetY() + this.y.getFrontOffsetY() + this.z.getFrontOffsetY() < 0) {
if (this.x.getYOffset() + this.y.getYOffset() + this.z.getYOffset() < 0) {
aY += 1;
bY += 1;
}
if (this.x.getFrontOffsetZ() + this.y.getFrontOffsetZ() + this.z.getFrontOffsetZ() < 0) {
if (this.x.getZOffset() + this.y.getZOffset() + this.z.getZOffset() < 0) {
aZ += 1;
bZ += 1;
}
@@ -446,7 +446,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
private void updateRedstone() {
final TileEntity te = this.getTile();
this.hasRedstone = te.getWorld().isBlockIndirectlyGettingPowered(te.getPos()) != 0 ? YesNo.YES : YesNo.NO;
this.hasRedstone = te.getWorld().getRedstonePowerFromNeighbors(te.getPos()) != 0 ? YesNo.YES : YesNo.NO;
}
private void updateDynamicRender() {
@@ -91,7 +91,7 @@ public class PartPlacement {
if (mop != null) {
final List<ItemStack> is = new ArrayList<>();
final SelectedPart sp = selectPart(player, host,
mop.hitVec.addVector(-mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ()));
mop.hitVec.add(-mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ()));
if (sp.part != null) {
is.add(sp.part.getItemStack(PartItemStack.WRENCH));
@@ -170,7 +170,7 @@ public class PartPlacement {
final RayTraceResult mop = block.collisionRayTrace(world.getBlockState(pos), world, pos, dir.getA(), dir.getB());
if (mop != null) {
mop.hitVec = mop.hitVec.addVector(-mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ());
mop.hitVec = mop.hitVec.add(-mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ());
final SelectedPart sPart = selectPart(player, host, mop.hitVec);
if (sPart != null && sPart.part != null) {
if (sPart.part.onShiftActivate(player, hand, mop.hitVec)) {
@@ -263,7 +263,7 @@ public class PartPlacement {
if (mop != null) {
final SelectedPart sp = selectPart(player, host,
mop.hitVec.addVector(-mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ()));
mop.hitVec.add(-mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ()));
if (sp.part != null) {
if (!player.isSneaking() && sp.part.onActivate(player, hand, mop.hitVec)) {
@@ -399,7 +399,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
this.onTunnelConfigChange();
final ItemStack p2pItem = this.getItemStack(PartItemStack.WRENCH);
final String type = p2pItem.getUnlocalizedName();
final String type = p2pItem.getTranslationKey();
p2pItem.writeToNBT(data);
if (needsNewFrequency) {
@@ -115,7 +115,7 @@ public final class CompassService {
final int hi_y = low_y + 32;
// lower level...
final Chunk c = w.getChunkFromChunkCoords(cx, cz);
final Chunk c = w.getChunk(cx, cz);
Optional<Block> maybeBlock = AEApi.instance().definitions().blocks().skyStoneBlock().maybeBlock();
if (maybeBlock.isPresent()) {
@@ -147,7 +147,7 @@ final class MinecraftItemCSVExporter implements Exporter {
if (this.mode == ExportMode.VERBOSE) {
final Item item = input.getItem();
final String unlocalizedItem = input.getUnlocalizedName();
final String unlocalizedItem = input.getTranslationKey();
final Block block = Block.getBlockFromItem(item);
final boolean isBlock = block != Blocks.AIR && !block.equals(Blocks.AIR);
final Class<? extends ItemStack> stackClass = input.getClass();
@@ -199,7 +199,7 @@ final class MinecraftItemCSVExporter implements Exporter {
return null;
} else {
AELog.debug(EXPORTING_SUBTYPES_MESSAGE, input.getUnlocalizedName(), input.getHasSubtypes());
AELog.debug(EXPORTING_SUBTYPES_MESSAGE, input.getTranslationKey(), input.getHasSubtypes());
}
final String itemName = ForgeRegistries.ITEMS.getKey(input).toString();
@@ -212,7 +212,7 @@ final class MinecraftItemCSVExporter implements Exporter {
try {
input.getSubItems(creativeTab, stacks);
} catch (final Exception ignored) {
AELog.warn(EXPORTING_SUBTYPES_FAILED_MESSAGE, input.getUnlocalizedName());
AELog.warn(EXPORTING_SUBTYPES_FAILED_MESSAGE, input.getTranslationKey());
AELog.debug(ignored);
// ignore if mods do bullshit in their code
@@ -232,7 +232,7 @@ final class MinecraftItemCSVExporter implements Exporter {
}
final List<String> joinedBlockAttributes = Lists.newArrayListWithCapacity(5);
final String unlocalizedItem = input.getUnlocalizedName();
final String unlocalizedItem = input.getTranslationKey();
final String localization = I18n.translateToLocal(unlocalizedItem + LOCALIZATION_NAME_EXTENSION);
joinedBlockAttributes.add(itemName);
@@ -102,7 +102,7 @@ public class CachedPlane {
for (int x = 0; x < this.x_size; x++) {
for (int z = 0; z < this.z_size; z++) {
this.myColumns[x][z] = new Column(w.getChunkFromChunkCoords((minX + x) >> 4,
this.myColumns[x][z] = new Column(w.getChunk((minX + x) >> 4,
(minZ + z) >> 4), (minX + x) & 0xF, (minZ + z) & 0xF, minCY, cy_size);
}
}
@@ -114,7 +114,7 @@ public class CachedPlane {
final List<Entry<BlockPos, TileEntity>> rawTiles = new ArrayList<>();
final List<BlockPos> deadTiles = new ArrayList<>();
final Chunk c = w.getChunkFromChunkCoords(minCX + cx, minCZ + cz);
final Chunk c = w.getChunk(minCX + cx, minCZ + cz);
this.myChunks[cx][cz] = c;
rawTiles.addAll(c.getTileEntityMap().entrySet());
@@ -45,7 +45,7 @@ public class DefaultSpatialHandler implements IMovableHandler {
te.setWorld(w);
te.setPos(newPosition);
final Chunk c = w.getChunkFromBlockCoords(newPosition);
final Chunk c = w.getChunk(newPosition);
c.addTileEntity(newPosition, te);
if (c.isLoaded()) {
@@ -274,7 +274,7 @@ public class Quad implements IVertexProducer, ISmartVertexConsumer {
* @return The BakedQuad.
*/
public BakedQuad bake() {
int[] packedData = new int[this.format.format.getNextOffset()];
int[] packedData = new int[this.format.format.getSize()];
for (int v = 0; v < 4; v++) {
for (int e = 0; e < this.format.elementCount; e++) {
LightUtil.pack(this.vertices[v].raw[e], packedData, this.format.format, v, e);
+1 -1
View File
@@ -100,7 +100,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements IAEAppEngInven
if (this.hasCustomInventoryName()) {
return new TextComponentString(this.getCustomInventoryName());
}
return new TextComponentTranslation(this.getBlockType().getUnlocalizedName());
return new TextComponentTranslation(this.getBlockType().getTranslationKey());
}
protected @Nonnull
+1 -1
View File
@@ -406,7 +406,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
}
}
return output.hasNoTags() ? null : output;
return output.isEmpty()? null : output;
}
@Override
@@ -134,17 +134,17 @@ public class TileCrank extends AEBaseTile implements ICustomCollision, ITickable
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(final World w, final BlockPos pos, final Entity thePlayer, final boolean b) {
final double xOff = -0.15 * this.getUp().getFrontOffsetX();
final double yOff = -0.15 * this.getUp().getFrontOffsetY();
final double zOff = -0.15 * this.getUp().getFrontOffsetZ();
final double xOff = -0.15 * this.getUp().getXOffset();
final double yOff = -0.15 * this.getUp().getYOffset();
final double zOff = -0.15 * this.getUp().getZOffset();
return Collections.singletonList(new AxisAlignedBB(xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85));
}
@Override
public void addCollidingBlockToList(final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e) {
final double xOff = -0.15 * this.getUp().getFrontOffsetX();
final double yOff = -0.15 * this.getUp().getFrontOffsetY();
final double zOff = -0.15 * this.getUp().getFrontOffsetZ();
final double xOff = -0.15 * this.getUp().getXOffset();
final double yOff = -0.15 * this.getUp().getYOffset();
final double zOff = -0.15 * this.getUp().getZOffset();
out.add(new AxisAlignedBB(xOff + 0.15, yOff + 0.15, zOff + 0.15, // ahh
xOff + 0.85, yOff + 0.85, zOff + 0.85));
}
@@ -85,7 +85,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl
}
public void updateRedstoneState() {
final YesNo currentState = this.world.isBlockIndirectlyGettingPowered(this.pos) != 0 ? YesNo.YES : YesNo.NO;
final YesNo currentState = this.world.getRedstonePowerFromNeighbors(this.pos) != 0 ? YesNo.YES : YesNo.NO;
if (this.lastRedstoneState != currentState) {
this.lastRedstoneState = currentState;
if (this.lastRedstoneState == YesNo.YES) {
@@ -142,7 +142,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
}
public void updateRedstoneState() {
final YesNo currentState = this.world.isBlockIndirectlyGettingPowered(this.pos) != 0 ? YesNo.YES : YesNo.NO;
final YesNo currentState = this.world.getRedstonePowerFromNeighbors(this.pos) != 0 ? YesNo.YES : YesNo.NO;
if (this.lastRedstoneState != currentState) {
this.lastRedstoneState = currentState;
this.updateTask();
+7 -7
View File
@@ -220,9 +220,9 @@ public class Platform {
}
public static EnumFacing crossProduct(final EnumFacing forward, final EnumFacing up) {
final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY();
final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ();
final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX();
final int west_x = forward.getYOffset() * up.getZOffset() - forward.getZOffset() * up.getYOffset();
final int west_y = forward.getZOffset() * up.getXOffset() - forward.getXOffset() * up.getZOffset();
final int west_z = forward.getXOffset() * up.getYOffset() - forward.getYOffset() * up.getXOffset();
switch (west_x + west_y * 2 + west_z * 3) {
case 1:
@@ -571,12 +571,12 @@ public class Platform {
try {
String name = itemStack.getDisplayName();
if (name == null || name.isEmpty()) {
name = itemStack.getItem().getUnlocalizedName(itemStack);
name = itemStack.getItem().getTranslationKey(itemStack);
}
return name == null ? "** Null" : name;
} catch (final Exception errA) {
try {
final String n = itemStack.getUnlocalizedName();
final String n = itemStack.getTranslationKey();
return n == null ? "** Null" : n;
} catch (final Exception errB) {
return "** Exception";
@@ -939,7 +939,7 @@ public class Platform {
}
final Vec3d from = new Vec3d(x, y, z);
final Vec3d to = from.addVector(eyeRayX * reachDistance, eyeRayY * reachDistance, eyeRayZ * reachDistance);
final Vec3d to = from.add(eyeRayX * reachDistance, eyeRayY * reachDistance, eyeRayZ * reachDistance);
return new LookDirection(from, to);
}
@@ -962,7 +962,7 @@ public class Platform {
final float f8 = f3 * f5;
final double d3 = 32.0D;
final Vec3d vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3);
final Vec3d vec31 = vec3.add(f7 * d3, f6 * d3, f8 * d3);
final AxisAlignedBB bb = new AxisAlignedBB(Math.min(vec3.x, vec31.x), Math.min(vec3.y, vec31.y), Math.min(vec3.z, vec31.z), Math.max(vec3.x, vec31.x), Math.max(vec3.y, vec31.y), Math.max(vec3.z, vec31.z)).grow(16, 16, 16);
@@ -118,8 +118,8 @@ public class ItemComparisonHelper {
return true;
}
final boolean isLeftEmpty = left == null || left.hasNoTags();
final boolean isRightEmpty = right == null || right.hasNoTags();
final boolean isLeftEmpty = left == null || left.isEmpty();
final boolean isRightEmpty = right == null || right.isEmpty();
if (isLeftEmpty && isRightEmpty) {
return true;
@@ -12,7 +12,7 @@ public abstract class BlockingInventoryAdaptor implements Iterable<ItemSlot> {
// Attempt getting an IItemHandler for the given side via caps
IItemHandler itemHandler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, d);
if (itemHandler != null) {
return new BlockingItemHandler(itemHandler, te.getBlockType().getRegistryName().getResourceDomain());
return new BlockingItemHandler(itemHandler, te.getBlockType().getRegistryName().getNamespace());
}
}
return null;
@@ -286,7 +286,7 @@ public class AEItemStack extends AEStack<IAEItemStack> implements IAEItemStack {
@SideOnly(Side.CLIENT)
public String getModID() {
return this.getDefinition().getItem().getRegistryName().getResourceDomain();
return this.getDefinition().getItem().getRegistryName().getNamespace();
}
public Optional<OreReference> getOre() {
@@ -186,7 +186,7 @@ public class OreHelper {
@Override
public String toString() {
return "ItemRef [ref=" + this.ref.getUnlocalizedName() + ", damage=" + this.damage + ", hash=" + this.hash + ']';
return "ItemRef [ref=" + this.ref.getTranslationKey() + ", damage=" + this.damage + ", hash=" + this.hash + ']';
}
}
}
@@ -36,7 +36,7 @@ public class ChunkOnly extends StandardWorld {
public ChunkOnly(final World w, final int cx, final int cz) {
super(w);
this.target = w.getChunkFromChunkCoords(cx, cz);
this.target = w.getChunk(cx, cz);
this.cx = cx;
this.cz = cz;
}