Migrations

This commit is contained in:
Sebastian Hartte
2020-06-27 16:18:20 +02:00
parent d638d083c2
commit ba71a82288
303 changed files with 1216 additions and 1210 deletions
-1
View File
@@ -1,2 +1 @@
archivesBaseName = artifact_basename + '-api' archivesBaseName = artifact_basename + '-api'
@@ -23,7 +23,7 @@ import java.util.Optional;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
public interface IBlockDefinition extends IItemDefinition { public interface IBlockDefinition extends IItemDefinition {
/** /**
@@ -52,5 +52,5 @@ public interface IBlockDefinition extends IItemDefinition {
* *
* @return if the block is placed in the world at the specific location. * @return if the block is placed in the world at the specific location.
*/ */
boolean isSameAs(IBlockReader world, BlockPos pos); boolean isSameAs(BlockView world, BlockPos pos);
} }
@@ -26,7 +26,7 @@ package appeng.api.features;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
/** /**
* Registration record for a Custom Cell handler. * Registration record for a Custom Cell handler.
@@ -58,5 +58,5 @@ public interface IWirelessTermRegistry {
* opens the wireless terminal gui, the wireless terminal item, must be in the * opens the wireless terminal gui, the wireless terminal item, must be in the
* active slot on the tool bar. * active slot on the tool bar.
*/ */
void openWirelessTerminalGui(ItemStack item, IBlockReader world, PlayerEntity player, Hand hand); void openWirelessTerminalGui(ItemStack item, BlockView world, PlayerEntity player, Hand hand);
} }
@@ -24,7 +24,7 @@
package appeng.api.implementations.items; package appeng.api.implementations.items;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public interface IGrowableCrystal { public interface IGrowableCrystal {
@@ -25,7 +25,7 @@ package appeng.api.implementations.items;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
@@ -53,7 +53,7 @@ public interface IMemoryCard {
* @param data the NBT tag, refer to the normal comment for special * @param data the NBT tag, refer to the normal comment for special
* keys. * keys.
*/ */
void setMemoryCardContents(ItemStack is, String settingsName, CompoundNBT data); void setMemoryCardContents(ItemStack is, String settingsName, CompoundTag data);
/** /**
* returns the settings name provided by a previous call to * returns the settings name provided by a previous call to
@@ -72,7 +72,7 @@ public interface IMemoryCard {
* @return the NBT Data previously saved by setMemoryCardContents, or an empty * @return the NBT Data previously saved by setMemoryCardContents, or an empty
* NBTCompound * NBTCompound
*/ */
CompoundNBT getData(ItemStack is); CompoundTag getData(ItemStack is);
/** /**
* This represent as 4x2 grid of {@link AEColor} without transparent/fluix * This represent as 4x2 grid of {@link AEColor} without transparent/fluix
@@ -26,7 +26,7 @@ package appeng.api.implementations.parts;
import java.util.EnumSet; import java.util.EnumSet;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import appeng.api.networking.IGridHost; import appeng.api.networking.IGridHost;
import appeng.api.parts.BusSupport; import appeng.api.parts.BusSupport;
@@ -24,7 +24,7 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
@@ -24,7 +24,7 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
import net.minecraft.inventory.CraftingInventory; import net.minecraft.inventory.CraftingInventory;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import appeng.api.networking.crafting.ICraftingPatternDetails; import appeng.api.networking.crafting.ICraftingPatternDetails;
@@ -23,7 +23,7 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
/** /**
* Crank/Crankable API, * Crank/Crankable API,
@@ -29,7 +29,7 @@ import javax.annotation.Nonnegative;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import appeng.api.parts.IPart; import appeng.api.parts.IPart;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
@@ -27,7 +27,7 @@ import java.util.EnumSet;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import appeng.api.IAppEngApi; import appeng.api.IAppEngApi;
@@ -130,7 +130,7 @@ public interface IGridNode {
* @param name nbt name * @param name nbt name
* @param nodeData to be loaded data * @param nodeData to be loaded data
*/ */
void loadFromNBT(@Nonnull String name, @Nonnull CompoundNBT nodeData); void loadFromNBT(@Nonnull String name, @Nonnull CompoundTag nodeData);
/** /**
* this should be called for each node you maintain, you can save all your nodes * this should be called for each node you maintain, you can save all your nodes
@@ -140,7 +140,7 @@ public interface IGridNode {
* @param name nbt name * @param name nbt name
* @param nodeData to be saved data * @param nodeData to be saved data
*/ */
void saveToNBT(@Nonnull String name, @Nonnull CompoundNBT nodeData); void saveToNBT(@Nonnull String name, @Nonnull CompoundTag nodeData);
/** /**
* @return if the node's channel requirements are currently met, use this for * @return if the node's channel requirements are currently met, use this for
@@ -25,15 +25,15 @@ package appeng.api.networking;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
public interface IGridStorage { public interface IGridStorage {
/** /**
* @return an CompoundNBT that can be read, and written too. * @return an CompoundTag that can be read, and written too.
*/ */
@Nonnull @Nonnull
CompoundNBT dataObject(); CompoundTag dataObject();
/** /**
* @return the id for this grid storage object, used internally * @return the id for this grid storage object, used internally
@@ -23,7 +23,7 @@
package appeng.api.networking.crafting; package appeng.api.networking.crafting;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
public interface ICraftingLink { public interface ICraftingLink {
@@ -53,7 +53,7 @@ public interface ICraftingLink {
* *
* @param tag to be written data * @param tag to be written data
*/ */
void writeToNBT(CompoundNBT tag); void writeToNBT(CompoundTag tag);
/** /**
* @return the crafting ID for this link. * @return the crafting ID for this link.
@@ -25,7 +25,7 @@ package appeng.api.parts;
import java.io.IOException; import java.io.IOException;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketBuffer;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
@@ -64,7 +64,7 @@ public interface IFacadeContainer {
* *
* @param data to be written data * @param data to be written data
*/ */
void writeToNBT(CompoundNBT data); void writeToNBT(CompoundTag data);
/** /**
* read from stream * read from stream
@@ -82,7 +82,7 @@ public interface IFacadeContainer {
* *
* @param data to be read data * @param data to be read data
*/ */
void readFromNBT(CompoundNBT data); void readFromNBT(CompoundTag data);
/** /**
* write to stream * write to stream
@@ -36,13 +36,13 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -110,14 +110,14 @@ public interface IPart extends ICustomCableConnection {
* *
* @param data to be written nbt data * @param data to be written nbt data
*/ */
void writeToNBT(CompoundNBT data); void writeToNBT(CompoundTag data);
/** /**
* Read the previously written NBT Data. this is the mirror for writeToNBT * Read the previously written NBT Data. this is the mirror for writeToNBT
* *
* @param data to be read nbt data * @param data to be read nbt data
*/ */
void readFromNBT(CompoundNBT data); void readFromNBT(CompoundTag data);
/** /**
* @return get the amount of light produced by the bus * @return get the amount of light produced by the bus
@@ -136,7 +136,7 @@ public interface IPart extends ICustomCableConnection {
/** /**
* a block around the bus's host has been changed. * a block around the bus's host has been changed.
*/ */
void onNeighborChanged(IBlockReader w, BlockPos pos, BlockPos neighbor); void onNeighborChanged(BlockView w, BlockPos pos, BlockPos neighbor);
/** /**
* @return output redstone on facing side * @return output redstone on facing side
@@ -345,7 +345,7 @@ public interface IPart extends ICustomCableConnection {
* capabilities on the cable bus will be forwarded to parts on the appropriate * capabilities on the cable bus will be forwarded to parts on the appropriate
* side. * side.
* *
* @see TileEntity#getCapability(Capability, net.minecraft.util.Direction) * @see TileEntity#getCapability(Capability, net.minecraft.util.math.Direction)
* *
* @return The capability or null. * @return The capability or null.
*/ */
@@ -23,7 +23,7 @@
package appeng.api.parts; package appeng.api.parts;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
public interface IPartCollisionHelper { public interface IPartCollisionHelper {
@@ -25,8 +25,8 @@ package appeng.api.parts;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -44,7 +44,7 @@ public interface IPartHelper {
* @return true if placing was successful * @return true if placing was successful
*/ */
// TODO, this should probably take ItemStack + ItemUseContext // TODO, this should probably take ItemStack + ItemUseContext
ActionResultType placeBus(ItemStack is, BlockPos pos, Direction side, PlayerEntity player, Hand hand, World world); ActionResult placeBus(ItemStack is, BlockPos pos, Direction side, PlayerEntity player, Hand hand, World world);
/** /**
* @return the render mode * @return the render mode
@@ -28,7 +28,7 @@ import java.util.Set;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
@@ -40,7 +40,7 @@ import net.minecraft.item.ItemStack;
* <code> * <code>
* *
* {@literal @}Override * {@literal @}Override
* public default ActionResultType onItemUse(ItemStack is, PlayerEntity player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) * public default ActionResult onItemUse(ItemStack is, PlayerEntity player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
* { * {
* return Api.INSTANCE.partHelper().placeBus( is, pos, side, player, hand, world ); * return Api.INSTANCE.partHelper().placeBus( is, pos, side, player, hand, world );
* } * }
@@ -27,7 +27,7 @@ import java.util.Set;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType; import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
@@ -23,13 +23,13 @@
package appeng.api.recipes; package appeng.api.recipes;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
public class ResolverResult { public class ResolverResult {
public final String itemName; public final String itemName;
public final int damageValue; public final int damageValue;
public final CompoundNBT compound; public final CompoundTag compound;
public ResolverResult(final String name, final int damage) { public ResolverResult(final String name, final int damage) {
this.itemName = name; this.itemName = name;
@@ -37,7 +37,7 @@ public class ResolverResult {
this.compound = null; this.compound = null;
} }
public ResolverResult(final String name, final int damage, final CompoundNBT data) { public ResolverResult(final String name, final int damage, final CompoundTag data) {
this.itemName = name; this.itemName = name;
this.damageValue = damage; this.damageValue = damage;
this.compound = data; this.compound = data;
@@ -29,7 +29,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketBuffer;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
@@ -101,5 +101,5 @@ public interface IStorageChannel<T extends IAEStack<T>> {
* @return * @return
*/ */
@Nullable @Nullable
T createFromNBT(@Nonnull CompoundNBT nbt); T createFromNBT(@Nonnull CompoundTag nbt);
} }
@@ -28,7 +28,7 @@ import java.util.Collection;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.networking.crafting.ICraftingLink; import appeng.api.networking.crafting.ICraftingLink;
@@ -97,7 +97,7 @@ public interface IStorageHelper {
* *
* @return crafting link * @return crafting link
*/ */
ICraftingLink loadCraftingLink(CompoundNBT data, ICraftingRequester req); ICraftingLink loadCraftingLink(CompoundTag data, ICraftingRequester req);
/** /**
* Extracts items from a {@link IMEInventory} respecting power requirements. * Extracts items from a {@link IMEInventory} respecting power requirements.
@@ -117,7 +117,7 @@ public interface IStorageHelper {
* *
* @param energy Energy source. * @param energy Energy source.
* @param inv Inventory to insert into. * @param inv Inventory to insert into.
* @param request Items to insert. * @param input Items to insert.
* @param src Action source. * @param src Action source.
* @param mode Simulate or modulate * @param mode Simulate or modulate
* @return items not inserted or {@code null} if everything was inserted. * @return items not inserted or {@code null} if everything was inserted.
@@ -26,7 +26,7 @@ package appeng.api.storage.data;
import java.io.IOException; import java.io.IOException;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketBuffer;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
@@ -122,11 +122,11 @@ public interface IAEStack<T extends IAEStack<T>> {
void decCountRequestable(long i); void decCountRequestable(long i);
/** /**
* write to a CompoundNBT. * write to a CompoundTag.
* *
* @param i to be written data * @param i to be written data
*/ */
void writeToNBT(CompoundNBT i); void writeToNBT(CompoundTag i);
/** /**
* Compare stacks using precise logic. * Compare stacks using precise logic.
@@ -18,7 +18,7 @@
package appeng.api.util; package appeng.api.util;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
/** /**
* Stand in for previous Forge Direction, Several uses of this class are simply * Stand in for previous Forge Direction, Several uses of this class are simply
@@ -25,7 +25,7 @@ package appeng.api.util;
import java.util.Set; import java.util.Set;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import appeng.api.config.Settings; import appeng.api.config.Settings;
@@ -76,12 +76,12 @@ public interface IConfigManager {
* *
* @param destination to be written nbt tag * @param destination to be written nbt tag
*/ */
void writeToNBT(CompoundNBT destination); void writeToNBT(CompoundTag destination);
/** /**
* Only works after settings have been registered * Only works after settings have been registered
* *
* @param src to be read nbt tag * @param src to be read nbt tag
*/ */
void readFromNBT(CompoundNBT src); void readFromNBT(CompoundTag src);
} }
@@ -23,7 +23,7 @@
package appeng.api.util; package appeng.api.util;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
/** /**
* Nearly all of AE's Tile Entities implement IOrientable. * Nearly all of AE's Tile Entities implement IOrientable.
@@ -24,7 +24,7 @@
package appeng.api.util; package appeng.api.util;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
/** /**
* Implemented on many of AE's non Tile Entity Blocks as a way to get a * Implemented on many of AE's non Tile Entity Blocks as a way to get a
@@ -38,5 +38,5 @@ public interface IOrientableBlock {
* *
* @return a IOrientable if applicable * @return a IOrientable if applicable
*/ */
IOrientable getOrientable(IBlockReader world, BlockPos pos); IOrientable getOrientable(BlockView world, BlockPos pos);
} }
+15 -10
View File
@@ -17,12 +17,16 @@
*/ */
plugins { plugins {
id 'fabric-loom' apply false id 'java'
id 'fabric-loom'
id 'maven-publish' id 'maven-publish'
id "org.jetbrains.kotlin.jvm" apply false id "org.jetbrains.kotlin.jvm" apply false
} }
allprojects { allprojects {
apply plugin: 'fabric-loom'
// Maven group and artifact name // Maven group and artifact name
group = artifact_group group = artifact_group
@@ -48,15 +52,6 @@ allprojects {
repositories { repositories {
maven { url = "http://maven.fabricmc.net/" } maven { url = "http://maven.fabricmc.net/" }
} }
}
subprojects {
apply plugin: 'fabric-loom'
apply plugin: 'kotlin-platform-jvm'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
minecraft { minecraft {
} }
@@ -70,7 +65,17 @@ subprojects {
modImplementation "net.fabricmc.fabric-api:fabric-api:0.14.0+build.371-1.16" modImplementation "net.fabricmc.fabric-api:fabric-api:0.14.0+build.371-1.16"
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}" modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
compile 'com.google.code.findbugs:jsr305:3.0.2'
} }
}
subprojects {
apply plugin: 'kotlin-platform-jvm'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
processResources { processResources {
inputs.property "version", project.version inputs.property "version", project.version
+25 -23
View File
@@ -20,21 +20,23 @@ package appeng.block;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType; import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.block.material.MaterialColor; import net.minecraft.block.MaterialColor;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Direction; import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ToolType; import net.minecraftforge.common.ToolType;
@@ -50,7 +52,7 @@ public abstract class AEBaseBlock extends Block {
private boolean isFullSize = true; private boolean isFullSize = true;
private boolean isInventory = false; private boolean isInventory = false;
protected AEBaseBlock(final Block.Properties props) { protected AEBaseBlock(final Settings props) {
super(props); super(props);
} }
@@ -58,7 +60,7 @@ public abstract class AEBaseBlock extends Block {
* Utility function to create block properties with some sensible defaults for * Utility function to create block properties with some sensible defaults for
* AE blocks. * AE blocks.
*/ */
public static Block.Properties defaultProps(Material material) { public static Settings defaultProps(Material material) {
return defaultProps(material, material.getColor()); return defaultProps(material, material.getColor());
} }
@@ -66,37 +68,37 @@ public abstract class AEBaseBlock extends Block {
* Utility function to create block properties with some sensible defaults for * Utility function to create block properties with some sensible defaults for
* AE blocks. * AE blocks.
*/ */
public static Block.Properties defaultProps(Material material, MaterialColor color) { public static Settings defaultProps(Material material, MaterialColor color) {
return Block.Properties.create(material, color) return Settings.create(material, color)
// These values previousls were encoded in AEBaseBlock // These values previousls were encoded in AEBaseBlock
.hardnessAndResistance(2.2f, 11.f).harvestTool(ToolType.PICKAXE).harvestLevel(0) .hardnessAndResistance(2.2f, 11.f).harvestTool(ToolType.PICKAXE).harvestLevel(0)
.sound(getDefaultSoundByMaterial(material)); .sound(getDefaultSoundByMaterial(material));
} }
private static SoundType getDefaultSoundByMaterial(Material mat) { private static BlockSoundGroup getDefaultSoundByMaterial(Material mat) {
if (mat == AEGlassMaterial.INSTANCE || mat == Material.GLASS) { if (mat == AEGlassMaterial.INSTANCE || mat == Material.GLASS) {
return SoundType.GLASS; return BlockSoundGroup.GLASS;
} else if (mat == Material.ROCK) { } else if (mat == Material.ROCK) {
return SoundType.STONE; return BlockSoundGroup.STONE;
} else if (mat == Material.WOOD) { } else if (mat == Material.WOOD) {
return SoundType.WOOD; return BlockSoundGroup.WOOD;
} else { } else {
return SoundType.METAL; return BlockSoundGroup.METAL;
} }
} }
@Override @Override
public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos) { public boolean isNormalCube(BlockState state, BlockView worldIn, BlockPos pos) {
return this.isFullSize() && this.isOpaque(); return this.isFullSize() && this.isOpaque();
} }
@Override @Override
public boolean hasComparatorInputOverride(BlockState state) { public boolean hasComparatorOutput(BlockState state) {
return this.isInventory(); return this.isInventory();
} }
@Override @Override
public int getComparatorInputOverride(BlockState state, final World worldIn, final BlockPos pos) { public int getComparatorOutput(BlockState state, final World worldIn, final BlockPos pos) {
return 0; return 0;
} }
@@ -129,9 +131,9 @@ public abstract class AEBaseBlock extends Block {
return false; return false;
} }
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
public final Direction mapRotation(final IOrientable ori, final Direction dir) { public final Direction mapRotation(final IOrientable ori, final Direction dir) {
@@ -206,7 +208,7 @@ public abstract class AEBaseBlock extends Block {
} }
protected IOrientable getOrientable(final IBlockReader w, final BlockPos pos) { protected IOrientable getOrientable(final BlockView w, final BlockPos pos) {
if (this instanceof IOrientableBlock) { if (this instanceof IOrientableBlock) {
IOrientableBlock orientable = (IOrientableBlock) this; IOrientableBlock orientable = (IOrientableBlock) this;
return orientable.getOrientable(w, pos); return orientable.getOrientable(w, pos);
@@ -27,8 +27,8 @@ import net.minecraft.item.BlockItem;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
@@ -75,7 +75,7 @@ public class AEBaseBlockItem extends BlockItem {
} }
@Override @Override
public ActionResultType tryPlace(BlockItemUseContext context) { public ActionResult tryPlace(BlockItemUseContext context) {
Direction up = null; Direction up = null;
Direction forward = null; Direction forward = null;
@@ -125,11 +125,11 @@ public class AEBaseBlockItem extends BlockItem {
} }
if (!this.blockType.isValidOrientation(context.getWorld(), context.getPos(), forward, up)) { if (!this.blockType.isValidOrientation(context.getWorld(), context.getPos(), forward, up)) {
return ActionResultType.FAIL; return ActionResult.FAIL;
} }
ActionResultType result = super.tryPlace(context); ActionResult result = super.tryPlace(context);
if (result != ActionResultType.SUCCESS) { if (result != ActionResult.SUCCESS) {
return result; return result;
} }
@@ -139,7 +139,7 @@ public class AEBaseBlockItem extends BlockItem {
ori = tile; ori = tile;
if (tile == null) { if (tile == null) {
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
if (ori.canBeRotated() && !this.blockType.hasCustomRotation()) { if (ori.canBeRotated() && !this.blockType.hasCustomRotation()) {
@@ -155,7 +155,7 @@ public class AEBaseBlockItem extends BlockItem {
ori.setOrientation(forward, up); ori.setOrientation(forward, up);
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
} }
@@ -24,7 +24,7 @@ import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.util.text.TranslationTextComponent;
@@ -61,7 +61,7 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
final double internalMaxPower = this.getMaxEnergyCapacity(); final double internalMaxPower = this.getMaxEnergyCapacity();
if (internalMaxPower > 0) { if (internalMaxPower > 0) {
final CompoundNBT tag = stack.getTag(); final CompoundTag tag = stack.getTag();
if (tag != null) { if (tag != null) {
internalCurrentPower = tag.getDouble("internalCurrentPower"); internalCurrentPower = tag.getDouble("internalCurrentPower");
} }
@@ -135,12 +135,12 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
} }
private double getInternal(final ItemStack is) { private double getInternal(final ItemStack is) {
final CompoundNBT nbt = is.getOrCreateTag(); final CompoundTag nbt = is.getOrCreateTag();
return nbt.getDouble("internalCurrentPower"); return nbt.getDouble("internalCurrentPower");
} }
private void setInternal(final ItemStack is, final double amt) { private void setInternal(final ItemStack is, final double amt) {
final CompoundNBT nbt = is.getOrCreateTag(); final CompoundTag nbt = is.getOrCreateTag();
nbt.putDouble("internalCurrentPower", amt); nbt.putDouble("internalCurrentPower", amt);
} }
+19 -19
View File
@@ -33,16 +33,16 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.DyeColor; import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemHandlerHelper;
@@ -67,7 +67,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
@Nonnull @Nonnull
private Supplier<T> tileEntityFactory; private Supplier<T> tileEntityFactory;
public AEBaseTileBlock(final Block.Properties props) { public AEBaseTileBlock(final Settings props) {
super(props); super(props);
} }
@@ -92,12 +92,12 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
} }
@Nullable @Nullable
public T getTileEntity(final IBlockReader w, final int x, final int y, final int z) { public T getTileEntity(final BlockView w, final int x, final int y, final int z) {
return this.getTileEntity(w, new BlockPos(x, y, z)); return this.getTileEntity(w, new BlockPos(x, y, z));
} }
@Nullable @Nullable
public T getTileEntity(final IBlockReader w, final BlockPos pos) { public T getTileEntity(final BlockView w, final BlockPos pos) {
if (!this.hasBlockTileEntity()) { if (!this.hasBlockTileEntity()) {
return null; return null;
} }
@@ -112,7 +112,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
} }
@Override @Override
public final TileEntity createTileEntity(BlockState state, IBlockReader world) { public final TileEntity createTileEntity(BlockState state, BlockView world) {
return this.tileEntityFactory.get(); return this.tileEntityFactory.get();
} }
@@ -165,7 +165,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
} }
@Override @Override
public int getComparatorInputOverride(BlockState state, final World w, final BlockPos pos) { public int getComparatorOutput(BlockState state, final World w, final BlockPos pos) {
final TileEntity te = this.getTileEntity(w, pos); final TileEntity te = this.getTileEntity(w, pos);
if (te instanceof AEBaseInvTileEntity) { if (te instanceof AEBaseInvTileEntity) {
AEBaseInvTileEntity invTile = (AEBaseInvTileEntity) te; AEBaseInvTileEntity invTile = (AEBaseInvTileEntity) te;
@@ -202,7 +202,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
} }
@Override @Override
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, public ActionResult onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player,
Hand hand, BlockRayTraceResult hit) { Hand hand, BlockRayTraceResult hit) {
ItemStack heldItem; ItemStack heldItem;
if (player != null && !player.getHeldItem(hand).isEmpty()) { if (player != null && !player.getHeldItem(hand).isEmpty()) {
@@ -215,11 +215,11 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
final AEBaseTileEntity tile = this.getTileEntity(world, pos); final AEBaseTileEntity tile = this.getTileEntity(world, pos);
if (tile == null) { if (tile == null) {
return ActionResultType.FAIL; return ActionResult.FAIL;
} }
if (tile instanceof CableBusTileEntity || tile instanceof SkyChestTileEntity) { if (tile instanceof CableBusTileEntity || tile instanceof SkyChestTileEntity) {
return ActionResultType.FAIL; return ActionResult.FAIL;
} }
final ItemStack[] itemDropCandidates = Platform.getBlockDrops(world, pos); final ItemStack[] itemDropCandidates = Platform.getBlockDrops(world, pos);
@@ -227,7 +227,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
for (final ItemStack ol : itemDropCandidates) { for (final ItemStack ol : itemDropCandidates) {
if (Platform.itemComparisons().isEqualItemType(ol, op)) { if (Platform.itemComparisons().isEqualItemType(ol, op)) {
final CompoundNBT tag = tile.downloadSettings(SettingsFrom.DISMANTLE_ITEM); final CompoundTag tag = tile.downloadSettings(SettingsFrom.DISMANTLE_ITEM);
if (tag != null) { if (tag != null) {
ol.setTag(tag); ol.setTag(tag);
} }
@@ -240,7 +240,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
world.removeBlock(pos, false); world.removeBlock(pos, false);
} }
return ActionResultType.FAIL; return ActionResult.FAIL;
} }
if (heldItem.getItem() instanceof IMemoryCard && !(this instanceof CableBusBlock)) { if (heldItem.getItem() instanceof IMemoryCard && !(this instanceof CableBusBlock)) {
@@ -248,20 +248,20 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
final AEBaseTileEntity tileEntity = this.getTileEntity(world, pos); final AEBaseTileEntity tileEntity = this.getTileEntity(world, pos);
if (tileEntity == null) { if (tileEntity == null) {
return ActionResultType.FAIL; return ActionResult.FAIL;
} }
final String name = this.getTranslationKey(); final String name = this.getTranslationKey();
if (player.isCrouching()) { if (player.isCrouching()) {
final CompoundNBT data = tileEntity.downloadSettings(SettingsFrom.MEMORY_CARD); final CompoundTag data = tileEntity.downloadSettings(SettingsFrom.MEMORY_CARD);
if (data != null) { if (data != null) {
memoryCard.setMemoryCardContents(heldItem, name, data); memoryCard.setMemoryCardContents(heldItem, name, data);
memoryCard.notifyUser(player, MemoryCardMessages.SETTINGS_SAVED); memoryCard.notifyUser(player, MemoryCardMessages.SETTINGS_SAVED);
} }
} else { } else {
final String savedName = memoryCard.getSettingsName(heldItem); final String savedName = memoryCard.getSettingsName(heldItem);
final CompoundNBT data = memoryCard.getData(heldItem); final CompoundTag data = memoryCard.getData(heldItem);
if (this.getTranslationKey().equals(savedName)) { if (this.getTranslationKey().equals(savedName)) {
tileEntity.uploadSettings(SettingsFrom.MEMORY_CARD, data); tileEntity.uploadSettings(SettingsFrom.MEMORY_CARD, data);
@@ -271,7 +271,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
} }
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
} }
@@ -279,7 +279,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
} }
@Override @Override
public IOrientable getOrientable(final IBlockReader w, final BlockPos pos) { public IOrientable getOrientable(final BlockView w, final BlockPos pos) {
return this.getTileEntity(w, pos); return this.getTileEntity(w, pos);
} }
@@ -23,7 +23,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -41,7 +41,7 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingTileEntity> ex
public final CraftingUnitType type; public final CraftingUnitType type;
public AbstractCraftingUnitBlock(Block.Properties props, final CraftingUnitType type) { public AbstractCraftingUnitBlock(Settings props, final CraftingUnitType type) {
super(props); super(props);
this.type = type; this.type = type;
this.setDefaultState(getDefaultState().with(FORMED, false).with(POWERED, false)); this.setDefaultState(getDefaultState().with(FORMED, false).with(POWERED, false));
@@ -78,7 +78,7 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingTileEntity> ex
} }
@Override @Override
public ActionResultType onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity p, Hand hand, public ActionResult onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity p, Hand hand,
BlockRayTraceResult hit) { BlockRayTraceResult hit) {
final CraftingTileEntity tg = this.getTileEntity(w, pos); final CraftingTileEntity tg = this.getTileEntity(w, pos);
@@ -88,7 +88,7 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingTileEntity> ex
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return super.onBlockActivated(state, w, pos, p, hand, hit); return super.onBlockActivated(state, w, pos, p, hand, hit);
@@ -23,7 +23,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -39,7 +39,7 @@ public class MolecularAssemblerBlock extends AEBaseTileBlock<MolecularAssemblerT
public static final BooleanProperty POWERED = BooleanProperty.create("powered"); public static final BooleanProperty POWERED = BooleanProperty.create("powered");
public MolecularAssemblerBlock(Block.Properties props) { public MolecularAssemblerBlock(Settings props) {
super(props); super(props);
setDefaultState(getDefaultState().with(POWERED, false)); setDefaultState(getDefaultState().with(POWERED, false));
} }
@@ -56,7 +56,7 @@ public class MolecularAssemblerBlock extends AEBaseTileBlock<MolecularAssemblerT
} }
@Override @Override
public ActionResultType onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity p, Hand hand, public ActionResult onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity p, Hand hand,
BlockRayTraceResult hit) { BlockRayTraceResult hit) {
final MolecularAssemblerTileEntity tg = this.getTileEntity(w, pos); final MolecularAssemblerTileEntity tg = this.getTileEntity(w, pos);
if (tg != null && !p.isCrouching()) { if (tg != null && !p.isCrouching()) {
@@ -64,7 +64,7 @@ public class MolecularAssemblerBlock extends AEBaseTileBlock<MolecularAssemblerT
ContainerOpener.openContainer(MolecularAssemblerContainer.TYPE, p, ContainerOpener.openContainer(MolecularAssemblerContainer.TYPE, p,
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return super.onBlockActivated(state, w, pos, p, hand, hit); return super.onBlockActivated(state, w, pos, p, hand, hit);
@@ -27,16 +27,16 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -55,11 +55,11 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (player instanceof FakePlayer || player == null) { if (player instanceof FakePlayer || player == null) {
this.dropCrank(w, pos); this.dropCrank(w, pos);
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
final CrankTileEntity tile = this.getTileEntity(w, pos); final CrankTileEntity tile = this.getTileEntity(w, pos);
@@ -67,10 +67,10 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
if (tile.power()) { if (tile.power()) {
AeStats.TurnedCranks.addToPlayer(player, 1); AeStats.TurnedCranks.addToPlayer(player, 1);
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
private void dropCrank(final World world, final BlockPos pos) { private void dropCrank(final World world, final BlockPos pos) {
@@ -100,7 +100,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
return !(te instanceof CrankTileEntity) || this.isCrankable(w, pos, up.getOpposite()); return !(te instanceof CrankTileEntity) || this.isCrankable(w, pos, up.getOpposite());
} }
private Direction findCrankable(final IBlockReader world, final BlockPos pos) { private Direction findCrankable(final BlockView world, final BlockPos pos) {
for (final Direction dir : Direction.values()) { for (final Direction dir : Direction.values()) {
if (this.isCrankable(world, pos, dir)) { if (this.isCrankable(world, pos, dir)) {
return dir; return dir;
@@ -109,7 +109,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
return null; return null;
} }
private boolean isCrankable(final IBlockReader world, final BlockPos pos, final Direction offset) { private boolean isCrankable(final BlockView world, final BlockPos pos, final Direction offset) {
final BlockPos o = pos.offset(offset); final BlockPos o = pos.offset(offset);
final TileEntity te = world.getTileEntity(o); final TileEntity te = world.getTileEntity(o);
@@ -139,13 +139,13 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
return this.findCrankable(w, pos) != null; return this.findCrankable(w, pos) != null;
} }
private Direction getUp(IBlockReader world, BlockPos pos) { private Direction getUp(BlockView world, BlockPos pos) {
CrankTileEntity crank = getTileEntity(world, pos); CrankTileEntity crank = getTileEntity(world, pos);
return crank != null ? crank.getUp() : null; return crank != null ? crank.getUp() : null;
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
Direction up = getUp(world, pos); Direction up = getUp(world, pos);
if (up == null) { if (up == null) {
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -42,7 +42,7 @@ public class GrinderBlock extends AEBaseTileBlock<GrinderTileEntity> {
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
final GrinderTileEntity tg = this.getTileEntity(w, pos); final GrinderTileEntity tg = this.getTileEntity(w, pos);
if (tg != null && !p.isCrouching()) { if (tg != null && !p.isCrouching()) {
@@ -50,8 +50,8 @@ public class GrinderBlock extends AEBaseTileBlock<GrinderTileEntity> {
ContainerOpener.openContainer(GrinderContainer.TYPE, p, ContainerOpener.openContainer(GrinderContainer.TYPE, p,
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
} }
@@ -20,10 +20,10 @@ package appeng.block.misc;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -42,10 +42,10 @@ public class CellWorkbenchBlock extends AEBaseTileBlock<CellWorkbenchTileEntity>
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (p.isCrouching()) { if (p.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
final CellWorkbenchTileEntity tg = this.getTileEntity(w, pos); final CellWorkbenchTileEntity tg = this.getTileEntity(w, pos);
@@ -53,8 +53,8 @@ public class CellWorkbenchBlock extends AEBaseTileBlock<CellWorkbenchTileEntity>
if (Platform.isServer()) { if (Platform.isServer()) {
CellWorkbenchContainer.open(p, ContainerLocator.forTileEntity(tg)); CellWorkbenchContainer.open(p, ContainerLocator.forTileEntity(tg));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
} }
@@ -27,7 +27,7 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.TransformationMatrix; import net.minecraft.client.renderer.TransformationMatrix;
import net.minecraft.client.renderer.Vector3f; import net.minecraft.client.renderer.Vector3f;
@@ -35,16 +35,16 @@ import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -69,15 +69,15 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
} }
@Override @Override
public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { public int getOpacity(BlockState state, BlockView worldIn, BlockPos pos) {
return 2; // FIXME Double check this (esp. value range) return 2; // FIXME Double check this (esp. value range)
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (player.isCrouching()) { if (player.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
if (Platform.isServer()) { if (Platform.isServer()) {
@@ -87,7 +87,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
} }
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
@Override @Override
@@ -120,7 +120,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
final ChargerTileEntity tile = this.getTileEntity(w, pos); final ChargerTileEntity tile = this.getTileEntity(w, pos);
if (tile != null) { if (tile != null) {
@@ -172,8 +172,8 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
} }
@Override @Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
ISelectionContext context) { ShapeContext context) {
return VoxelShapes.create(new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 1.0, 1.0)); return VoxelShapes.create(new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
} }
@@ -20,10 +20,10 @@ package appeng.block.misc;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -43,10 +43,10 @@ public class CondenserBlock extends AEBaseTileBlock<CondenserTileEntity> {
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (player.isCrouching()) { if (player.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
if (Platform.isServer()) { if (Platform.isServer()) {
@@ -54,10 +54,10 @@ public class CondenserBlock extends AEBaseTileBlock<CondenserTileEntity> {
if (tc != null && !player.isCrouching()) { if (tc != null && !player.isCrouching()) {
ContainerOpener.openContainer(CondenserContainer.TYPE, player, ContainerOpener.openContainer(CondenserContainer.TYPE, player,
ContainerLocator.forTileEntitySide(tc, hit.getFace())); ContainerLocator.forTileEntitySide(tc, hit.getFace()));
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
} }
@@ -23,11 +23,11 @@ import javax.annotation.Nullable;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
@@ -43,13 +43,13 @@ public class InscriberBlock extends AEBaseTileBlock<InscriberTileEntity> {
} }
@Override @Override
public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { public int getOpacity(BlockState state, BlockView worldIn, BlockPos pos) {
return 2; // FIXME validate this. a) possibly not required because of getShape b) value return 2; // FIXME validate this. a) possibly not required because of getShape b) value
// range. was 2 in 1.10 // range. was 2 in 1.10
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (!p.isCrouching()) { if (!p.isCrouching()) {
final InscriberTileEntity tg = this.getTileEntity(w, pos); final InscriberTileEntity tg = this.getTileEntity(w, pos);
@@ -58,10 +58,10 @@ public class InscriberBlock extends AEBaseTileBlock<InscriberTileEntity> {
ContainerOpener.openContainer(InscriberContainer.TYPE, p, ContainerOpener.openContainer(InscriberContainer.TYPE, p,
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
@@ -22,13 +22,13 @@ import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -62,10 +62,10 @@ public class InterfaceBlock extends AEBaseTileBlock<InterfaceTileEntity> {
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (p.isCrouching()) { if (p.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
final InterfaceTileEntity tg = this.getTileEntity(w, pos); final InterfaceTileEntity tg = this.getTileEntity(w, pos);
@@ -74,9 +74,9 @@ public class InterfaceBlock extends AEBaseTileBlock<InterfaceTileEntity> {
ContainerOpener.openContainer(InterfaceContainer.TYPE, p, ContainerOpener.openContainer(InterfaceContainer.TYPE, p,
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
@Override @Override
@@ -22,17 +22,17 @@ import java.util.Random;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -62,7 +62,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
} }
@Override @Override
public int getWeakPower(final BlockState state, final IBlockReader w, final BlockPos pos, final Direction side) { public int getWeakPower(final BlockState state, final BlockView w, final BlockPos pos, final Direction side) {
if (w instanceof World && this.getTileEntity(w, pos).isReady()) { if (w instanceof World && this.getTileEntity(w, pos).isReady()) {
// FIXME: This is ... uhm... fishy // FIXME: This is ... uhm... fishy
return ((World) w).getLight(pos) - 6; return ((World) w).getLight(pos) - 6;
@@ -91,14 +91,14 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
return this.canPlaceAt(w, pos, up.getOpposite()); return this.canPlaceAt(w, pos, up.getOpposite());
} }
private boolean canPlaceAt(final IBlockReader w, final BlockPos pos, final Direction dir) { private boolean canPlaceAt(final BlockView w, final BlockPos pos, final Direction dir) {
final BlockPos test = pos.offset(dir); final BlockPos test = pos.offset(dir);
BlockState blockstate = w.getBlockState(test); BlockState blockstate = w.getBlockState(test);
return blockstate.isSolidSide(w, test, dir.getOpposite()); return blockstate.isSolidSide(w, test, dir.getOpposite());
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
// FIXME: We should / rather MUST use state here because at startup, this gets // FIXME: We should / rather MUST use state here because at startup, this gets
// called without a world // called without a world
@@ -112,8 +112,8 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
} }
@Override @Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
ISelectionContext context) { ShapeContext context) {
return VoxelShapes.empty(); return VoxelShapes.empty();
} }
@@ -143,7 +143,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
} }
@Override @Override
public IOrientable getOrientable(final IBlockReader w, final BlockPos pos) { public IOrientable getOrientable(final BlockView w, final BlockPos pos) {
return new MetaRotation(w, pos, BlockStateProperties.FACING); return new MetaRotation(w, pos, BlockStateProperties.FACING);
} }
@@ -27,20 +27,20 @@ import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.SoundType; import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.DirectionProperty; import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -81,7 +81,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
public QuartzFixtureBlock() { public QuartzFixtureBlock() {
super(defaultProps(Material.MISCELLANEOUS).doesNotBlockMovement().hardnessAndResistance(0).lightValue(14) super(defaultProps(Material.MISCELLANEOUS).doesNotBlockMovement().hardnessAndResistance(0).lightValue(14)
.sound(SoundType.GLASS)); .sound(BlockSoundGroup.GLASS));
this.setDefaultState(getDefaultState().with(FACING, Direction.UP).with(ODD, false)); this.setDefaultState(getDefaultState().with(FACING, Direction.UP).with(ODD, false));
} }
@@ -140,7 +140,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
Direction facing = state.get(FACING); Direction facing = state.get(FACING);
return SHAPES.get(facing); return SHAPES.get(facing);
} }
@@ -195,7 +195,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
} }
@Override @Override
public IOrientable getOrientable(final IBlockReader w, final BlockPos pos) { public IOrientable getOrientable(final BlockView w, final BlockPos pos) {
return new MetaRotation(w, pos, FACING); return new MetaRotation(w, pos, FACING);
} }
@@ -22,12 +22,12 @@ import java.util.Random;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType; import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
@@ -47,7 +47,7 @@ public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAc
private static final BooleanProperty POWERED = BooleanProperty.create("powered"); private static final BooleanProperty POWERED = BooleanProperty.create("powered");
public QuartzGrowthAcceleratorBlock() { public QuartzGrowthAcceleratorBlock() {
super(defaultProps(Material.ROCK).sound(SoundType.METAL)); super(defaultProps(Material.ROCK).sound(BlockSoundGroup.METAL));
this.setDefaultState(this.getDefaultState().with(POWERED, false)); this.setDefaultState(this.getDefaultState().with(POWERED, false));
} }
@@ -22,12 +22,12 @@ import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -61,22 +61,22 @@ public class SecurityStationBlock extends AEBaseTileBlock<SecurityStationTileEnt
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (p.isCrouching()) { if (p.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
final SecurityStationTileEntity tg = this.getTileEntity(w, pos); final SecurityStationTileEntity tg = this.getTileEntity(w, pos);
if (tg != null) { if (tg != null) {
if (w.isRemote()) { if (w.isRemote()) {
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
ContainerOpener.openContainer(SecurityStationContainer.TYPE, p, ContainerOpener.openContainer(SecurityStationContainer.TYPE, p,
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
} }
@@ -21,13 +21,13 @@ package appeng.block.misc;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -37,7 +37,7 @@ import appeng.tile.misc.SkyCompassTileEntity;
public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> { public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
public SkyCompassBlock(Block.Properties props) { public SkyCompassBlock(Settings props) {
super(props); super(props);
} }
@@ -50,7 +50,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
return this.canPlaceAt(w, pos, forward.getOpposite()); return this.canPlaceAt(w, pos, forward.getOpposite());
} }
private boolean canPlaceAt(final IBlockReader w, final BlockPos pos, final Direction dir) { private boolean canPlaceAt(final BlockView w, final BlockPos pos, final Direction dir) {
final BlockPos test = pos.offset(dir); final BlockPos test = pos.offset(dir);
BlockState blockstate = w.getBlockState(test); BlockState blockstate = w.getBlockState(test);
return blockstate.isSolidSide(w, test, dir.getOpposite()); return blockstate.isSolidSide(w, test, dir.getOpposite());
@@ -83,7 +83,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
// TODO: This definitely needs to be memoized // TODO: This definitely needs to be memoized
@@ -145,8 +145,8 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
} }
@Override @Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
ISelectionContext context) { ShapeContext context) {
return VoxelShapes.empty(); return VoxelShapes.empty();
} }
@@ -28,18 +28,18 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.AbstractArrowEntity; import net.minecraft.entity.projectile.AbstractArrowEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents; import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.Explosion; import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@@ -51,23 +51,23 @@ public class TinyTNTBlock extends AEBaseBlock {
private static final VoxelShape SHAPE = VoxelShapes private static final VoxelShape SHAPE = VoxelShapes
.create(new AxisAlignedBB(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f)); .create(new AxisAlignedBB(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
public TinyTNTBlock(Block.Properties props) { public TinyTNTBlock(Settings props) {
super(props); super(props);
setFullSize(setOpaque(false)); setFullSize(setOpaque(false));
} }
@Override @Override
public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { public int getOpacity(BlockState state, BlockView worldIn, BlockPos pos) {
return 2; // FIXME: Validate that this is the correct value range return 2; // FIXME: Validate that this is the correct value range
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
return SHAPE; return SHAPE;
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (heldItem != null && heldItem.getItem() == Items.FLINT_AND_STEEL) { if (heldItem != null && heldItem.getItem() == Items.FLINT_AND_STEEL) {
this.startFuse(w, pos, player); this.startFuse(w, pos, player);
@@ -75,7 +75,7 @@ public class TinyTNTBlock extends AEBaseBlock {
heldItem.damageItem(1, player, p -> { heldItem.damageItem(1, player, p -> {
p.sendBreakAnimation(hand); p.sendBreakAnimation(hand);
}); // FIXME Check if onBroken is equivalent }); // FIXME Check if onBroken is equivalent
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} else { } else {
return super.onActivated(w, pos, player, hand, heldItem, hit); return super.onActivated(w, pos, player, hand, heldItem, hit);
} }
@@ -24,14 +24,14 @@ import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.particles.ParticleTypes; import net.minecraft.particles.ParticleTypes;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -68,10 +68,10 @@ public final class VibrationChamberBlock extends AEBaseTileBlock<VibrationChambe
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (player.isCrouching()) { if (player.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
if (Platform.isServer()) { if (Platform.isServer()) {
@@ -79,11 +79,11 @@ public final class VibrationChamberBlock extends AEBaseTileBlock<VibrationChambe
if (tc != null && !player.isCrouching()) { if (tc != null && !player.isCrouching()) {
ContainerOpener.openContainer(VibrationChamberContainer.TYPE, player, ContainerOpener.openContainer(VibrationChamberContainer.TYPE, player,
ContainerLocator.forTileEntitySide(tc, hit.getFace())); ContainerLocator.forTileEntitySide(tc, hit.getFace()));
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
@Override @Override
@@ -40,16 +40,16 @@ import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.*; import net.minecraft.util.math.*;
import net.minecraft.util.math.RayTraceResult.Type; import net.minecraft.util.math.RayTraceResult.Type;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -85,7 +85,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
return true; return true;
} }
@@ -100,7 +100,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public int getWeakPower(final BlockState state, final IBlockReader w, final BlockPos pos, final Direction side) { public int getWeakPower(final BlockState state, final BlockView w, final BlockPos pos, final Direction side) {
return this.cb(w, pos).isProvidingWeakPower(side.getOpposite()); // TODO: return this.cb(w, pos).isProvidingWeakPower(side.getOpposite()); // TODO:
// IS // IS
// OPPOSITE!? // OPPOSITE!?
@@ -117,14 +117,14 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public int getStrongPower(final BlockState state, final IBlockReader w, final BlockPos pos, final Direction side) { public int getStrongPower(final BlockState state, final BlockView w, final BlockPos pos, final Direction side) {
return this.cb(w, pos).isProvidingStrongPower(side.getOpposite()); // TODO: return this.cb(w, pos).isProvidingStrongPower(side.getOpposite()); // TODO:
// IS // IS
// OPPOSITE!? // OPPOSITE!?
} }
@Override @Override
public int getLightValue(final BlockState state, final IBlockReader world, final BlockPos pos) { public int getLightValue(final BlockState state, final BlockView world, final BlockPos pos) {
if (state.getBlock() != this) { if (state.getBlock() != this) {
return state.getBlock().getLightValue(state, world, pos); return state.getBlock().getLightValue(state, world, pos);
} }
@@ -156,7 +156,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public boolean canConnectRedstone(final BlockState state, final IBlockReader w, final BlockPos pos, public boolean canConnectRedstone(final BlockState state, final BlockView w, final BlockPos pos,
Direction side) { Direction side) {
if (side == null) { if (side == null) {
side = Direction.UP; side = Direction.UP;
@@ -166,7 +166,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, public ItemStack getPickBlock(BlockState state, RayTraceResult target, BlockView world, BlockPos pos,
PlayerEntity player) { PlayerEntity player) {
final Vec3d v3 = target.getHitVec().subtract(pos.getX(), pos.getY(), pos.getZ()); final Vec3d v3 = target.getHitVec().subtract(pos.getX(), pos.getY(), pos.getZ());
final SelectedPart sp = this.cb(world, pos).selectPart(v3); final SelectedPart sp = this.cb(world, pos).selectPart(v3);
@@ -280,7 +280,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
} }
private ICableBusContainer cb(final IBlockReader w, final BlockPos pos) { private ICableBusContainer cb(final BlockView w, final BlockPos pos) {
final TileEntity te = w.getTileEntity(pos); final TileEntity te = w.getTileEntity(pos);
ICableBusContainer out = null; ICableBusContainer out = null;
@@ -292,7 +292,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Nullable @Nullable
private IFacadeContainer fc(final IBlockReader w, final BlockPos pos) { private IFacadeContainer fc(final BlockView w, final BlockPos pos) {
final TileEntity te = w.getTileEntity(pos); final TileEntity te = w.getTileEntity(pos);
IFacadeContainer out = null; IFacadeContainer out = null;
@@ -326,12 +326,12 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
// Transform from world into block space // Transform from world into block space
Vec3d hitVec = hit.getHitVec(); Vec3d hitVec = hit.getHitVec();
Vec3d hitInBlock = new Vec3d(hitVec.x - pos.getX(), hitVec.y - pos.getY(), hitVec.z - pos.getZ()); Vec3d hitInBlock = new Vec3d(hitVec.x - pos.getX(), hitVec.y - pos.getY(), hitVec.z - pos.getZ());
return this.cb(w, pos).activate(player, hand, hitInBlock) ? ActionResultType.SUCCESS : ActionResultType.PASS; return this.cb(w, pos).activate(player, hand, hitInBlock) ? ActionResult.SUCCESS : ActionResult.PASS;
} }
@Override @Override
@@ -339,7 +339,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
return recolorBlock(world, pos, side, color, null); return recolorBlock(world, pos, side, color, null);
} }
public boolean recolorBlock(final IBlockReader world, final BlockPos pos, final Direction side, public boolean recolorBlock(final BlockView world, final BlockPos pos, final Direction side,
final DyeColor color, final PlayerEntity who) { final DyeColor color, final PlayerEntity who) {
try { try {
return this.cb(world, pos).recolourBlock(side, AEColor.values()[color.ordinal()], who); return this.cb(world, pos).recolourBlock(side, AEColor.values()[color.ordinal()], who);
@@ -355,7 +355,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public BlockState getFacadeState(IBlockReader world, BlockPos pos, Direction side) { public BlockState getFacadeState(BlockView world, BlockPos pos, Direction side) {
if (side != null) { if (side != null) {
IFacadeContainer container = this.fc(world, pos); IFacadeContainer container = this.fc(world, pos);
if (container != null) { if (container != null) {
@@ -369,7 +369,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
CableBusTileEntity te = getTileEntity(w, pos); CableBusTileEntity te = getTileEntity(w, pos);
if (te == null) { if (te == null) {
return VoxelShapes.empty(); return VoxelShapes.empty();
@@ -379,7 +379,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getCollisionShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
CableBusTileEntity te = getTileEntity(w, pos); CableBusTileEntity te = getTileEntity(w, pos);
if (te == null) { if (te == null) {
return VoxelShapes.empty(); return VoxelShapes.empty();
@@ -20,10 +20,10 @@ package appeng.block.networking;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld; import net.minecraft.world.IWorld;
@@ -18,7 +18,7 @@
package appeng.block.networking; package appeng.block.networking;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
import appeng.tile.networking.EnergyAcceptorTileEntity; import appeng.tile.networking.EnergyAcceptorTileEntity;
@@ -22,7 +22,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import net.minecraft.state.IntegerProperty; import net.minecraft.state.IntegerProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
@@ -47,7 +47,7 @@ public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellTileEntity> {
super.fillItemGroup(group, itemStacks); super.fillItemGroup(group, itemStacks);
final ItemStack charged = new ItemStack(this, 1); final ItemStack charged = new ItemStack(this, 1);
final CompoundNBT tag = charged.getOrCreateTag(); final CompoundTag tag = charged.getOrCreateTag();
tag.putDouble("internalCurrentPower", this.getMaxPower()); tag.putDouble("internalCurrentPower", this.getMaxPower());
tag.putDouble("internalMaxPower", this.getMaxPower()); tag.putDouble("internalMaxPower", this.getMaxPower());
@@ -23,17 +23,17 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
@@ -84,7 +84,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
} }
@Override @Override
public ActionResultType onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity player, Hand hand, public ActionResult onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity player, Hand hand,
BlockRayTraceResult hit) { BlockRayTraceResult hit) {
final WirelessTileEntity tg = this.getTileEntity(w, pos); final WirelessTileEntity tg = this.getTileEntity(w, pos);
@@ -93,14 +93,14 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
ContainerOpener.openContainer(WirelessContainer.TYPE, player, ContainerOpener.openContainer(WirelessContainer.TYPE, player,
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return super.onBlockActivated(state, w, pos, player, hand, hit); return super.onBlockActivated(state, w, pos, player, hand, hit);
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
final WirelessTileEntity tile = this.getTileEntity(w, pos); final WirelessTileEntity tile = this.getTileEntity(w, pos);
if (tile != null) { if (tile != null) {
final Direction forward = tile.getForward(); final Direction forward = tile.getForward();
@@ -159,7 +159,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
} }
@Override @Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getCollisionShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
final WirelessTileEntity tile = this.getTileEntity(w, pos); final WirelessTileEntity tile = this.getTileEntity(w, pos);
if (tile != null) { if (tile != null) {
@@ -220,7 +220,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
} }
@Override @Override
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
return true; return true;
} }
@@ -18,7 +18,7 @@ import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material; import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture; import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.data.IDynamicBakedModel; import net.minecraftforge.client.model.data.IDynamicBakedModel;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
@@ -20,18 +20,18 @@ package appeng.block.paint;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.block.material.MaterialColor; import net.minecraft.block.MaterialColor;
import net.minecraft.fluid.Fluid; import net.minecraft.fluid.Fluid;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -54,7 +54,7 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntit
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
return VoxelShapes.empty(); return VoxelShapes.empty();
} }
@@ -76,7 +76,7 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntit
} }
@Override @Override
public int getLightValue(final BlockState state, final IBlockReader w, final BlockPos pos) { public int getLightValue(final BlockState state, final BlockView w, final BlockPos pos) {
final PaintSplotchesTileEntity tp = this.getTileEntity(w, pos); final PaintSplotchesTileEntity tp = this.getTileEntity(w, pos);
if (tp != null) { if (tp != null) {
@@ -87,7 +87,7 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntit
} }
@Override @Override
public boolean isAir(final BlockState state, final IBlockReader world, final BlockPos pos) { public boolean isAir(final BlockState state, final BlockView world, final BlockPos pos) {
return true; return true;
} }
@@ -20,7 +20,7 @@ import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material; import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture; import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.data.IDynamicBakedModel; import net.minecraftforge.client.model.data.IDynamicBakedModel;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
@@ -3,7 +3,7 @@ package appeng.block.qnb;
import java.util.Set; import java.util.Set;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
public class QnbFormedState { public class QnbFormedState {
@@ -24,10 +24,10 @@ import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
@@ -44,14 +44,14 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeTile
SHAPE = VoxelShapes.create(new AxisAlignedBB(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave)); SHAPE = VoxelShapes.create(new AxisAlignedBB(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave));
} }
public QuantumBaseBlock(Block.Properties props) { public QuantumBaseBlock(Settings props) {
super(props); super(props);
this.setFullSize(this.setOpaque(false)); this.setFullSize(this.setOpaque(false));
this.setDefaultState(this.getDefaultState().with(FORMED, false)); this.setDefaultState(this.getDefaultState().with(FORMED, false));
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
return SHAPE; return SHAPE;
} }
@@ -25,15 +25,15 @@ import javax.annotation.Nullable;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.client.EffectType; import appeng.client.EffectType;
@@ -73,10 +73,10 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (p.isCrouching()) { if (p.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
final QuantumBridgeTileEntity tg = this.getTileEntity(w, pos); final QuantumBridgeTileEntity tg = this.getTileEntity(w, pos);
@@ -84,13 +84,13 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
if (Platform.isServer()) { if (Platform.isServer()) {
ContainerOpener.openContainer(QNBContainer.TYPE, p, ContainerLocator.forTileEntity(tg)); ContainerOpener.openContainer(QNBContainer.TYPE, p, ContainerLocator.forTileEntity(tg));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
return SHAPE; return SHAPE;
} }
@@ -19,13 +19,13 @@
package appeng.block.qnb; package appeng.block.qnb;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import appeng.tile.qnb.QuantumBridgeTileEntity; import appeng.tile.qnb.QuantumBridgeTileEntity;
@@ -40,7 +40,7 @@ public class QuantumRingBlock extends QuantumBaseBlock {
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView w, BlockPos pos, ShapeContext context) {
final QuantumBridgeTileEntity bridge = this.getTileEntity(w, pos); final QuantumBridgeTileEntity bridge = this.getTileEntity(w, pos);
if (bridge != null && bridge.isCorner()) { if (bridge != null && bridge.isCorner()) {
return SHAPE_CORNER; return SHAPE_CORNER;
@@ -20,19 +20,19 @@ package appeng.block.spatial;
import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.block.material.MaterialColor; import net.minecraft.block.MaterialColor;
import net.minecraft.block.material.PushReaction; import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.Explosion; import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
@@ -65,13 +65,13 @@ public class MatrixFrameBlock extends AEBaseBlock {
} }
@Override @Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
ISelectionContext context) { ShapeContext context) {
return VoxelShapes.fullCube(); return VoxelShapes.fullCube();
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
// This also prevents any blocks from being placed on this block! // This also prevents any blocks from being placed on this block!
return VoxelShapes.empty(); return VoxelShapes.empty();
} }
@@ -87,17 +87,17 @@ public class MatrixFrameBlock extends AEBaseBlock {
} }
@Override @Override
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
return true; return true;
} }
@Override @Override
public float getAmbientOcclusionLightValue(BlockState state, IBlockReader worldIn, BlockPos pos) { public float getAmbientOcclusionLightValue(BlockState state, BlockView worldIn, BlockPos pos) {
return 1.0f; return 1.0f;
} }
@Override @Override
public boolean canEntityDestroy(final BlockState state, final IBlockReader world, final BlockPos pos, public boolean canEntityDestroy(final BlockState state, final BlockView world, final BlockPos pos,
final Entity entity) { final Entity entity) {
return false; return false;
} }
@@ -22,10 +22,10 @@ import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -54,10 +54,10 @@ public class SpatialIOPortBlock extends AEBaseTileBlock<SpatialIOPortTileEntity>
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (p.isCrouching()) { if (p.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
final SpatialIOPortTileEntity tg = this.getTileEntity(w, pos); final SpatialIOPortTileEntity tg = this.getTileEntity(w, pos);
@@ -66,8 +66,8 @@ public class SpatialIOPortBlock extends AEBaseTileBlock<SpatialIOPortTileEntity>
ContainerOpener.openContainer(SpatialIOPortContainer.TYPE, p, ContainerOpener.openContainer(SpatialIOPortContainer.TYPE, p,
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
} }
@@ -21,7 +21,7 @@ package appeng.block.spatial;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
@@ -44,7 +44,7 @@ public class SpatialPylonBlock extends AEBaseTileBlock<SpatialPylonTileEntity> {
} }
@Override @Override
public int getLightValue(final BlockState state, final IBlockReader w, final BlockPos pos) { public int getLightValue(final BlockState state, final BlockView w, final BlockPos pos) {
final SpatialPylonTileEntity tsp = this.getTileEntity(w, pos); final SpatialPylonTileEntity tsp = this.getTileEntity(w, pos);
if (tsp != null) { if (tsp != null) {
return tsp.getLightValue(); return tsp.getLightValue();
@@ -22,12 +22,12 @@ import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.state.EnumProperty; import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -72,12 +72,12 @@ public class ChestBlock extends AEBaseTileBlock<ChestTileEntity> {
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
final ChestTileEntity tg = this.getTileEntity(w, pos); final ChestTileEntity tg = this.getTileEntity(w, pos);
if (tg != null && !p.isCrouching()) { if (tg != null && !p.isCrouching()) {
if (w.isRemote()) { if (w.isRemote()) {
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
if (hit.getFace() == tg.getUp()) { if (hit.getFace() == tg.getUp()) {
@@ -89,9 +89,9 @@ public class ChestBlock extends AEBaseTileBlock<ChestTileEntity> {
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
} }
@@ -20,10 +20,10 @@ package appeng.block.storage;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -43,10 +43,10 @@ public class DriveBlock extends AEBaseTileBlock<DriveTileEntity> {
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (p.isCrouching()) { if (p.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
final DriveTileEntity tg = this.getTileEntity(w, pos); final DriveTileEntity tg = this.getTileEntity(w, pos);
@@ -54,8 +54,8 @@ public class DriveBlock extends AEBaseTileBlock<DriveTileEntity> {
if (Platform.isServer()) { if (Platform.isServer()) {
ContainerOpener.openContainer(DriveContainer.TYPE, p, ContainerLocator.forTileEntity(tg)); ContainerOpener.openContainer(DriveContainer.TYPE, p, ContainerLocator.forTileEntity(tg));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
} }
@@ -22,10 +22,10 @@ import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
@@ -54,10 +54,10 @@ public class IOPortBlock extends AEBaseTileBlock<IOPortTileEntity> {
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (p.isCrouching()) { if (p.isCrouching()) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
final IOPortTileEntity tg = this.getTileEntity(w, pos); final IOPortTileEntity tg = this.getTileEntity(w, pos);
@@ -66,8 +66,8 @@ public class IOPortBlock extends AEBaseTileBlock<IOPortTileEntity> {
ContainerOpener.openContainer(IOPortContainer.TYPE, p, ContainerOpener.openContainer(IOPortContainer.TYPE, p,
ContainerLocator.forTileEntitySide(tg, hit.getFace())); ContainerLocator.forTileEntitySide(tg, hit.getFace()));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
return ActionResultType.PASS; return ActionResult.PASS;
} }
} }
@@ -24,16 +24,16 @@ import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
@@ -66,33 +66,33 @@ public class SkyChestBlock extends AEBaseTileBlock<SkyChestTileEntity> {
} }
@Override @Override
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
return true; return true;
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, public ActionResult onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) { final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
if (Platform.isServer()) { if (Platform.isServer()) {
SkyChestTileEntity tile = getTileEntity(w, pos); SkyChestTileEntity tile = getTileEntity(w, pos);
if (tile == null) { if (tile == null) {
return ActionResultType.PASS; return ActionResult.PASS;
} }
ContainerOpener.openContainer(SkyChestContainer.TYPE, player, ContainerLocator.forTileEntity(tile)); ContainerOpener.openContainer(SkyChestContainer.TYPE, player, ContainerLocator.forTileEntity(tile));
} }
return ActionResultType.SUCCESS; return ActionResult.SUCCESS;
} }
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
// TODO Cache this! It can't be that hard! // TODO Cache this! It can't be that hard!
AxisAlignedBB aabb = computeAABB(worldIn, pos); AxisAlignedBB aabb = computeAABB(worldIn, pos);
return VoxelShapes.create(aabb); return VoxelShapes.create(aabb);
} }
private AxisAlignedBB computeAABB(final IBlockReader w, final BlockPos pos) { private AxisAlignedBB computeAABB(final BlockView w, final BlockPos pos) {
final SkyChestTileEntity sk = this.getTileEntity(w, pos); final SkyChestTileEntity sk = this.getTileEntity(w, pos);
Direction o = Direction.UP; Direction o = Direction.UP;
@@ -19,7 +19,7 @@
package appeng.capabilities; package appeng.capabilities;
import net.minecraft.nbt.INBT; import net.minecraft.nbt.INBT;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraftforge.common.capabilities.CapabilityManager;
@@ -35,7 +35,7 @@ import org.lwjgl.glfw.GLFW;
import net.minecraft.client.util.InputMappings; import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListNBT; import net.minecraft.nbt.ListNBT;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils; import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -205,7 +205,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
return super.keyPressed(keyCode, scanCode, p_keyPressed_3_); return super.keyPressed(keyCode, scanCode, p_keyPressed_3_);
} }
public void postUpdate(final CompoundNBT in) { public void postUpdate(final CompoundTag in) {
if (in.getBoolean("clear")) { if (in.getBoolean("clear")) {
this.byId.clear(); this.byId.clear();
this.refreshList = true; this.refreshList = true;
@@ -216,7 +216,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
if (key.startsWith("=")) { if (key.startsWith("=")) {
try { try {
final long id = Long.parseLong(key.substring(1), Character.MAX_RADIX); final long id = Long.parseLong(key.substring(1), Character.MAX_RADIX);
final CompoundNBT invData = in.getCompound(key); final CompoundTag invData = in.getCompound(key);
ITextComponent un = ITextComponent.Serializer.fromJson(invData.getString("un")); ITextComponent un = ITextComponent.Serializer.fromJson(invData.getString("un"));
final ClientDCInternalInv current = this.getById(id, invData.getLong("sortBy"), un); final ClientDCInternalInv current = this.getById(id, invData.getLong("sortBy"), un);
@@ -307,7 +307,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
return false; return false;
} }
final CompoundNBT encodedValue = itemStack.getTag(); final CompoundTag encodedValue = itemStack.getTag();
if (encodedValue == null) { if (encodedValue == null) {
return false; return false;
@@ -31,7 +31,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
public abstract class DelegateBakedModel implements IBakedModel { public abstract class DelegateBakedModel implements IBakedModel {
private final IBakedModel baseModel; private final IBakedModel baseModel;
@@ -30,7 +30,7 @@ import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
/** /**
* @author DrummerMC * @author DrummerMC
@@ -38,7 +38,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.fluid.Fluids; import net.minecraft.fluid.Fluids;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.client.model.ItemLayerModel; import net.minecraftforge.client.model.ItemLayerModel;
@@ -30,7 +30,7 @@ import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.client.model.data.EmptyModelData;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
@@ -24,7 +24,7 @@ import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.Quaternion; import net.minecraft.client.renderer.Quaternion;
import net.minecraft.client.renderer.Vector3f; import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.Vector4f; import net.minecraft.client.renderer.Vector4f;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.Vec3i; import net.minecraft.util.math.Vec3i;
@@ -27,7 +27,7 @@ import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
import appeng.util.IWideReadableNumberConverter; import appeng.util.IWideReadableNumberConverter;
@@ -29,7 +29,7 @@ import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.Material; import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture; import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import appeng.api.util.AECableType; import appeng.api.util.AECableType;
@@ -38,7 +38,7 @@ import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.MissingTextureSprite; import net.minecraft.client.renderer.texture.MissingTextureSprite;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.client.model.data.EmptyModelData;
@@ -25,7 +25,7 @@ import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader; import net.minecraft.world.ILightReader;
@@ -30,7 +30,7 @@ import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement; import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.pipeline.BakedQuadBuilder; import net.minecraftforge.client.model.pipeline.BakedQuadBuilder;
/** /**
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.fluid.IFluidState; import net.minecraft.fluid.IFluidState;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader; import net.minecraft.world.ILightReader;
import net.minecraft.world.level.ColorResolver; import net.minecraft.world.level.ColorResolver;
@@ -39,8 +39,8 @@ import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.Direction.Axis;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@@ -13,7 +13,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.data.IDynamicBakedModel; import net.minecraftforge.client.model.data.IDynamicBakedModel;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
@@ -25,7 +25,7 @@ import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.Vector3f; import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import appeng.client.render.FacingToRotation; import appeng.client.render.FacingToRotation;
import appeng.thirdparty.codechicken.lib.model.CachedFormat; import appeng.thirdparty.codechicken.lib.model.CachedFormat;
@@ -31,7 +31,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.data.IDynamicBakedModel; import net.minecraftforge.client.model.data.IDynamicBakedModel;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
@@ -23,7 +23,7 @@ import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@@ -20,7 +20,7 @@ package appeng.client.render.crafting;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
import appeng.block.crafting.AbstractCraftingUnitBlock; import appeng.block.crafting.AbstractCraftingUnitBlock;
@@ -20,7 +20,7 @@ package appeng.client.render.crafting;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
@@ -20,7 +20,7 @@ package appeng.client.render.crafting;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
import appeng.client.render.cablebus.CubeBuilder; import appeng.client.render.cablebus.CubeBuilder;
@@ -6,7 +6,7 @@ import javax.annotation.Nullable;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.data.ModelProperty; import net.minecraftforge.client.model.data.ModelProperty;
@@ -40,7 +40,7 @@ import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement; import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i; import net.minecraft.util.math.Vec3i;
import net.minecraft.world.ILightReader; import net.minecraft.world.ILightReader;
@@ -19,7 +19,7 @@
package appeng.client.render.model; package appeng.client.render.model;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
/** /**
* Used as the cache key for caching automatically rotated baked models. * Used as the cache key for caching automatically rotated baked models.
@@ -21,7 +21,7 @@ import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.client.model.data.EmptyModelData;
@@ -16,7 +16,7 @@ import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.PerspectiveMapWrapper; import net.minecraftforge.client.model.PerspectiveMapWrapper;
import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.client.model.data.EmptyModelData;
@@ -31,7 +31,7 @@ import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.pipeline.BakedQuadBuilder; import net.minecraftforge.client.model.pipeline.BakedQuadBuilder;
@@ -2,7 +2,7 @@ package appeng.client.render.model;
import java.util.Objects; import java.util.Objects;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import appeng.block.storage.DriveSlotsState; import appeng.block.storage.DriveSlotsState;
@@ -39,12 +39,12 @@ import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement; import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockReader; import net.minecraft.world.BlockView;
import net.minecraft.world.ILightReader; import net.minecraft.world.ILightReader;
import net.minecraftforge.client.model.data.IDynamicBakedModel; import net.minecraftforge.client.model.data.IDynamicBakedModel;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
@@ -321,7 +321,7 @@ class GlassBakedModel implements IDynamicBakedModel {
} }
private static boolean isGlassBlock(IBlockReader world, BlockPos pos, Direction facing) { private static boolean isGlassBlock(BlockView world, BlockPos pos, Direction facing) {
return world.getBlockState(pos.offset(facing)).getBlock() instanceof QuartzGlassBlock; return world.getBlockState(pos.offset(facing)).getBlock() instanceof QuartzGlassBlock;
} }
@@ -25,7 +25,7 @@ import net.minecraft.client.renderer.Vector4f;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement; import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.pipeline.QuadGatheringTransformer; import net.minecraftforge.client.model.pipeline.QuadGatheringTransformer;
/** /**
@@ -21,7 +21,7 @@ import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.client.model.data.EmptyModelData;
@@ -24,7 +24,7 @@ import java.util.List;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import net.minecraft.util.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
// TODO: Investigate use of CubeBuilder instead // TODO: Investigate use of CubeBuilder instead

Some files were not shown because too many files have changed in this diff Show More