Migrations
This commit is contained in:
@@ -1,2 +1 @@
|
||||
|
||||
archivesBaseName = artifact_basename + '-api'
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Optional;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
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.
|
||||
*/
|
||||
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.item.ItemStack;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IGrowableCrystal {
|
||||
|
||||
@@ -25,7 +25,7 @@ package appeng.api.implementations.items;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface IMemoryCard {
|
||||
* @param data the NBT tag, refer to the normal comment for special
|
||||
* 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
|
||||
@@ -72,7 +72,7 @@ public interface IMemoryCard {
|
||||
* @return the NBT Data previously saved by setMemoryCardContents, or an empty
|
||||
* NBTCompound
|
||||
*/
|
||||
CompoundNBT getData(ItemStack is);
|
||||
CompoundTag getData(ItemStack is);
|
||||
|
||||
/**
|
||||
* 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 net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.parts.BusSupport;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
package appeng.api.implementations.tiles;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
package appeng.api.implementations.tiles;
|
||||
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.implementations.tiles;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
/**
|
||||
* Crank/Crankable API,
|
||||
|
||||
@@ -29,7 +29,7 @@ import javax.annotation.Nonnegative;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.util.AEColor;
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.EnumSet;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.IWorld;
|
||||
|
||||
import appeng.api.IAppEngApi;
|
||||
@@ -130,7 +130,7 @@ public interface IGridNode {
|
||||
* @param name nbt name
|
||||
* @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
|
||||
@@ -140,7 +140,7 @@ public interface IGridNode {
|
||||
* @param name nbt name
|
||||
* @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
|
||||
|
||||
@@ -25,15 +25,15 @@ package appeng.api.networking;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
||||
public interface IGridStorage {
|
||||
|
||||
/**
|
||||
* @return an CompoundNBT that can be read, and written too.
|
||||
* @return an CompoundTag that can be read, and written too.
|
||||
*/
|
||||
@Nonnull
|
||||
CompoundNBT dataObject();
|
||||
CompoundTag dataObject();
|
||||
|
||||
/**
|
||||
* @return the id for this grid storage object, used internally
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.networking.crafting;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
||||
public interface ICraftingLink {
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface ICraftingLink {
|
||||
*
|
||||
* @param tag to be written data
|
||||
*/
|
||||
void writeToNBT(CompoundNBT tag);
|
||||
void writeToNBT(CompoundTag tag);
|
||||
|
||||
/**
|
||||
* @return the crafting ID for this link.
|
||||
|
||||
@@ -25,7 +25,7 @@ package appeng.api.parts;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
@@ -64,7 +64,7 @@ public interface IFacadeContainer {
|
||||
*
|
||||
* @param data to be written data
|
||||
*/
|
||||
void writeToNBT(CompoundNBT data);
|
||||
void writeToNBT(CompoundTag data);
|
||||
|
||||
/**
|
||||
* read from stream
|
||||
@@ -82,7 +82,7 @@ public interface IFacadeContainer {
|
||||
*
|
||||
* @param data to be read data
|
||||
*/
|
||||
void readFromNBT(CompoundNBT data);
|
||||
void readFromNBT(CompoundTag data);
|
||||
|
||||
/**
|
||||
* write to stream
|
||||
|
||||
@@ -36,13 +36,13 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -110,14 +110,14 @@ public interface IPart extends ICustomCableConnection {
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @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
|
||||
@@ -136,7 +136,7 @@ public interface IPart extends ICustomCableConnection {
|
||||
/**
|
||||
* 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
|
||||
@@ -345,7 +345,7 @@ public interface IPart extends ICustomCableConnection {
|
||||
* capabilities on the cable bus will be forwarded to parts on the appropriate
|
||||
* side.
|
||||
*
|
||||
* @see TileEntity#getCapability(Capability, net.minecraft.util.Direction)
|
||||
* @see TileEntity#getCapability(Capability, net.minecraft.util.math.Direction)
|
||||
*
|
||||
* @return The capability or null.
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.parts;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
public interface IPartCollisionHelper {
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ package appeng.api.parts;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -44,7 +44,7 @@ public interface IPartHelper {
|
||||
* @return true if placing was successful
|
||||
*/
|
||||
// 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
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.Set;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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.math.Vec3d;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import net.minecraft.item.ItemStack;
|
||||
* <code>
|
||||
*
|
||||
* {@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 );
|
||||
* }
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.Set;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
|
||||
package appeng.api.recipes;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
||||
public class ResolverResult {
|
||||
|
||||
public final String itemName;
|
||||
public final int damageValue;
|
||||
public final CompoundNBT compound;
|
||||
public final CompoundTag compound;
|
||||
|
||||
public ResolverResult(final String name, final int damage) {
|
||||
this.itemName = name;
|
||||
@@ -37,7 +37,7 @@ public class ResolverResult {
|
||||
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.damageValue = damage;
|
||||
this.compound = data;
|
||||
|
||||
@@ -29,7 +29,7 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -101,5 +101,5 @@ public interface IStorageChannel<T extends IAEStack<T>> {
|
||||
* @return
|
||||
*/
|
||||
@Nullable
|
||||
T createFromNBT(@Nonnull CompoundNBT nbt);
|
||||
T createFromNBT(@Nonnull CompoundTag nbt);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.Collection;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.crafting.ICraftingLink;
|
||||
@@ -97,7 +97,7 @@ public interface IStorageHelper {
|
||||
*
|
||||
* @return crafting link
|
||||
*/
|
||||
ICraftingLink loadCraftingLink(CompoundNBT data, ICraftingRequester req);
|
||||
ICraftingLink loadCraftingLink(CompoundTag data, ICraftingRequester req);
|
||||
|
||||
/**
|
||||
* Extracts items from a {@link IMEInventory} respecting power requirements.
|
||||
@@ -117,7 +117,7 @@ public interface IStorageHelper {
|
||||
*
|
||||
* @param energy Energy source.
|
||||
* @param inv Inventory to insert into.
|
||||
* @param request Items to insert.
|
||||
* @param input Items to insert.
|
||||
* @param src Action source.
|
||||
* @param mode Simulate or modulate
|
||||
* @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 net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -122,11 +122,11 @@ public interface IAEStack<T extends IAEStack<T>> {
|
||||
void decCountRequestable(long i);
|
||||
|
||||
/**
|
||||
* write to a CompoundNBT.
|
||||
* write to a CompoundTag.
|
||||
*
|
||||
* @param i to be written data
|
||||
*/
|
||||
void writeToNBT(CompoundNBT i);
|
||||
void writeToNBT(CompoundTag i);
|
||||
|
||||
/**
|
||||
* Compare stacks using precise logic.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
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
|
||||
|
||||
@@ -25,7 +25,7 @@ package appeng.api.util;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
|
||||
@@ -76,12 +76,12 @@ public interface IConfigManager {
|
||||
*
|
||||
* @param destination to be written nbt tag
|
||||
*/
|
||||
void writeToNBT(CompoundNBT destination);
|
||||
void writeToNBT(CompoundTag destination);
|
||||
|
||||
/**
|
||||
* Only works after settings have been registered
|
||||
*
|
||||
* @param src to be read nbt tag
|
||||
*/
|
||||
void readFromNBT(CompoundNBT src);
|
||||
void readFromNBT(CompoundTag src);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package appeng.api.util;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
/**
|
||||
* Nearly all of AE's Tile Entities implement IOrientable.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
package appeng.api.util;
|
||||
|
||||
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
|
||||
@@ -38,5 +38,5 @@ public interface IOrientableBlock {
|
||||
*
|
||||
* @return a IOrientable if applicable
|
||||
*/
|
||||
IOrientable getOrientable(IBlockReader world, BlockPos pos);
|
||||
IOrientable getOrientable(BlockView world, BlockPos pos);
|
||||
}
|
||||
+15
-10
@@ -17,12 +17,16 @@
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id 'fabric-loom' apply false
|
||||
id 'java'
|
||||
id 'fabric-loom'
|
||||
id 'maven-publish'
|
||||
id "org.jetbrains.kotlin.jvm" apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
|
||||
apply plugin: 'fabric-loom'
|
||||
|
||||
// Maven group and artifact name
|
||||
group = artifact_group
|
||||
|
||||
@@ -48,15 +52,6 @@ allprojects {
|
||||
repositories {
|
||||
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 {
|
||||
}
|
||||
@@ -70,7 +65,17 @@ subprojects {
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:0.14.0+build.371-1.16"
|
||||
|
||||
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 {
|
||||
inputs.property "version", project.version
|
||||
|
||||
@@ -20,21 +20,23 @@ package appeng.block;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
@@ -50,7 +52,7 @@ public abstract class AEBaseBlock extends Block {
|
||||
private boolean isFullSize = true;
|
||||
private boolean isInventory = false;
|
||||
|
||||
protected AEBaseBlock(final Block.Properties props) {
|
||||
protected AEBaseBlock(final Settings props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@@ -58,7 +60,7 @@ public abstract class AEBaseBlock extends Block {
|
||||
* Utility function to create block properties with some sensible defaults for
|
||||
* AE blocks.
|
||||
*/
|
||||
public static Block.Properties defaultProps(Material material) {
|
||||
public static Settings defaultProps(Material material) {
|
||||
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
|
||||
* AE blocks.
|
||||
*/
|
||||
public static Block.Properties defaultProps(Material material, MaterialColor color) {
|
||||
return Block.Properties.create(material, color)
|
||||
public static Settings defaultProps(Material material, MaterialColor color) {
|
||||
return Settings.create(material, color)
|
||||
// These values previousls were encoded in AEBaseBlock
|
||||
.hardnessAndResistance(2.2f, 11.f).harvestTool(ToolType.PICKAXE).harvestLevel(0)
|
||||
.sound(getDefaultSoundByMaterial(material));
|
||||
}
|
||||
|
||||
private static SoundType getDefaultSoundByMaterial(Material mat) {
|
||||
private static BlockSoundGroup getDefaultSoundByMaterial(Material mat) {
|
||||
if (mat == AEGlassMaterial.INSTANCE || mat == Material.GLASS) {
|
||||
return SoundType.GLASS;
|
||||
return BlockSoundGroup.GLASS;
|
||||
} else if (mat == Material.ROCK) {
|
||||
return SoundType.STONE;
|
||||
return BlockSoundGroup.STONE;
|
||||
} else if (mat == Material.WOOD) {
|
||||
return SoundType.WOOD;
|
||||
return BlockSoundGroup.WOOD;
|
||||
} else {
|
||||
return SoundType.METAL;
|
||||
return BlockSoundGroup.METAL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos) {
|
||||
public boolean isNormalCube(BlockState state, BlockView worldIn, BlockPos pos) {
|
||||
return this.isFullSize() && this.isOpaque();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride(BlockState state) {
|
||||
public boolean hasComparatorOutput(BlockState state) {
|
||||
return this.isInventory();
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@@ -129,9 +131,9 @@ public abstract class AEBaseBlock extends Block {
|
||||
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) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
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) {
|
||||
IOrientableBlock orientable = (IOrientableBlock) this;
|
||||
return orientable.getOrientable(w, pos);
|
||||
|
||||
@@ -27,8 +27,8 @@ import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -75,7 +75,7 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType tryPlace(BlockItemUseContext context) {
|
||||
public ActionResult tryPlace(BlockItemUseContext context) {
|
||||
|
||||
Direction up = null;
|
||||
Direction forward = null;
|
||||
@@ -125,11 +125,11 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
}
|
||||
|
||||
if (!this.blockType.isValidOrientation(context.getWorld(), context.getPos(), forward, up)) {
|
||||
return ActionResultType.FAIL;
|
||||
return ActionResult.FAIL;
|
||||
}
|
||||
|
||||
ActionResultType result = super.tryPlace(context);
|
||||
if (result != ActionResultType.SUCCESS) {
|
||||
ActionResult result = super.tryPlace(context);
|
||||
if (result != ActionResult.SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
ori = tile;
|
||||
|
||||
if (tile == null) {
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
if (ori.canBeRotated() && !this.blockType.hasCustomRotation()) {
|
||||
@@ -155,7 +155,7 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
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.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
@@ -61,7 +61,7 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
|
||||
final double internalMaxPower = this.getMaxEnergyCapacity();
|
||||
|
||||
if (internalMaxPower > 0) {
|
||||
final CompoundNBT tag = stack.getTag();
|
||||
final CompoundTag tag = stack.getTag();
|
||||
if (tag != null) {
|
||||
internalCurrentPower = tag.getDouble("internalCurrentPower");
|
||||
}
|
||||
@@ -135,12 +135,12 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
|
||||
}
|
||||
|
||||
private double getInternal(final ItemStack is) {
|
||||
final CompoundNBT nbt = is.getOrCreateTag();
|
||||
final CompoundTag nbt = is.getOrCreateTag();
|
||||
return nbt.getDouble("internalCurrentPower");
|
||||
}
|
||||
|
||||
private void setInternal(final ItemStack is, final double amt) {
|
||||
final CompoundNBT nbt = is.getOrCreateTag();
|
||||
final CompoundTag nbt = is.getOrCreateTag();
|
||||
nbt.putDouble("internalCurrentPower", amt);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,16 +33,16 @@ import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
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.World;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
@@ -67,7 +67,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
@Nonnull
|
||||
private Supplier<T> tileEntityFactory;
|
||||
|
||||
public AEBaseTileBlock(final Block.Properties props) {
|
||||
public AEBaseTileBlock(final Settings props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@@ -92,12 +92,12 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public T getTileEntity(final IBlockReader w, final BlockPos pos) {
|
||||
public T getTileEntity(final BlockView w, final BlockPos pos) {
|
||||
if (!this.hasBlockTileEntity()) {
|
||||
return null;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public final TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
public final TileEntity createTileEntity(BlockState state, BlockView world) {
|
||||
return this.tileEntityFactory.get();
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
}
|
||||
|
||||
@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);
|
||||
if (te instanceof AEBaseInvTileEntity) {
|
||||
AEBaseInvTileEntity invTile = (AEBaseInvTileEntity) te;
|
||||
@@ -202,7 +202,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
}
|
||||
|
||||
@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) {
|
||||
ItemStack heldItem;
|
||||
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);
|
||||
|
||||
if (tile == null) {
|
||||
return ActionResultType.FAIL;
|
||||
return ActionResult.FAIL;
|
||||
}
|
||||
|
||||
if (tile instanceof CableBusTileEntity || tile instanceof SkyChestTileEntity) {
|
||||
return ActionResultType.FAIL;
|
||||
return ActionResult.FAIL;
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
ol.setTag(tag);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
world.removeBlock(pos, false);
|
||||
}
|
||||
|
||||
return ActionResultType.FAIL;
|
||||
return ActionResult.FAIL;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (tileEntity == null) {
|
||||
return ActionResultType.FAIL;
|
||||
return ActionResult.FAIL;
|
||||
}
|
||||
|
||||
final String name = this.getTranslationKey();
|
||||
|
||||
if (player.isCrouching()) {
|
||||
final CompoundNBT data = tileEntity.downloadSettings(SettingsFrom.MEMORY_CARD);
|
||||
final CompoundTag data = tileEntity.downloadSettings(SettingsFrom.MEMORY_CARD);
|
||||
if (data != null) {
|
||||
memoryCard.setMemoryCardContents(heldItem, name, data);
|
||||
memoryCard.notifyUser(player, MemoryCardMessages.SETTINGS_SAVED);
|
||||
}
|
||||
} else {
|
||||
final String savedName = memoryCard.getSettingsName(heldItem);
|
||||
final CompoundNBT data = memoryCard.getData(heldItem);
|
||||
final CompoundTag data = memoryCard.getData(heldItem);
|
||||
|
||||
if (this.getTranslationKey().equals(savedName)) {
|
||||
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
|
||||
public IOrientable getOrientable(final IBlockReader w, final BlockPos pos) {
|
||||
public IOrientable getOrientable(final BlockView w, final BlockPos pos) {
|
||||
return this.getTileEntity(w, pos);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -41,7 +41,7 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingTileEntity> ex
|
||||
|
||||
public final CraftingUnitType type;
|
||||
|
||||
public AbstractCraftingUnitBlock(Block.Properties props, final CraftingUnitType type) {
|
||||
public AbstractCraftingUnitBlock(Settings props, final CraftingUnitType type) {
|
||||
super(props);
|
||||
this.type = type;
|
||||
this.setDefaultState(getDefaultState().with(FORMED, false).with(POWERED, false));
|
||||
@@ -78,7 +78,7 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingTileEntity> ex
|
||||
}
|
||||
|
||||
@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) {
|
||||
final CraftingTileEntity tg = this.getTileEntity(w, pos);
|
||||
|
||||
@@ -88,7 +88,7 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingTileEntity> ex
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
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.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
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 MolecularAssemblerBlock(Block.Properties props) {
|
||||
public MolecularAssemblerBlock(Settings props) {
|
||||
super(props);
|
||||
setDefaultState(getDefaultState().with(POWERED, false));
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class MolecularAssemblerBlock extends AEBaseTileBlock<MolecularAssemblerT
|
||||
}
|
||||
|
||||
@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) {
|
||||
final MolecularAssemblerTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null && !p.isCrouching()) {
|
||||
@@ -64,7 +64,7 @@ public class MolecularAssemblerBlock extends AEBaseTileBlock<MolecularAssemblerT
|
||||
ContainerOpener.openContainer(MolecularAssemblerContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
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.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
@@ -55,11 +55,11 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (player instanceof FakePlayer || player == null) {
|
||||
this.dropCrank(w, pos);
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
final CrankTileEntity tile = this.getTileEntity(w, pos);
|
||||
@@ -67,10 +67,10 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
|
||||
if (tile.power()) {
|
||||
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) {
|
||||
@@ -100,7 +100,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
|
||||
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()) {
|
||||
if (this.isCrankable(world, pos, dir)) {
|
||||
return dir;
|
||||
@@ -109,7 +109,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
|
||||
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 TileEntity te = world.getTileEntity(o);
|
||||
|
||||
@@ -139,13 +139,13 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
|
||||
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);
|
||||
return crank != null ? crank.getUp() : null;
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
if (up == null) {
|
||||
|
||||
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -42,7 +42,7 @@ public class GrinderBlock extends AEBaseTileBlock<GrinderTileEntity> {
|
||||
}
|
||||
|
||||
@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 GrinderTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null && !p.isCrouching()) {
|
||||
@@ -50,8 +50,8 @@ public class GrinderBlock extends AEBaseTileBlock<GrinderTileEntity> {
|
||||
ContainerOpener.openContainer(GrinderContainer.TYPE, p,
|
||||
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 net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -42,10 +42,10 @@ public class CellWorkbenchBlock extends AEBaseTileBlock<CellWorkbenchTileEntity>
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (p.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
final CellWorkbenchTileEntity tg = this.getTileEntity(w, pos);
|
||||
@@ -53,8 +53,8 @@ public class CellWorkbenchBlock extends AEBaseTileBlock<CellWorkbenchTileEntity>
|
||||
if (Platform.isServer()) {
|
||||
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 net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.TransformationMatrix;
|
||||
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.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -69,15 +69,15 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
}
|
||||
|
||||
@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)
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (player.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
if (Platform.isServer()) {
|
||||
@@ -87,7 +87,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
}
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,7 +120,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
}
|
||||
|
||||
@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);
|
||||
if (tile != null) {
|
||||
@@ -172,8 +172,8 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos,
|
||||
ISelectionContext context) {
|
||||
public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
|
||||
ShapeContext context) {
|
||||
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 net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -43,10 +43,10 @@ public class CondenserBlock extends AEBaseTileBlock<CondenserTileEntity> {
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (player.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
if (Platform.isServer()) {
|
||||
@@ -54,10 +54,10 @@ public class CondenserBlock extends AEBaseTileBlock<CondenserTileEntity> {
|
||||
if (tc != null && !player.isCrouching()) {
|
||||
ContainerOpener.openContainer(CondenserContainer.TYPE, player,
|
||||
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.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
@@ -43,13 +43,13 @@ public class InscriberBlock extends AEBaseTileBlock<InscriberTileEntity> {
|
||||
}
|
||||
|
||||
@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
|
||||
// range. was 2 in 1.10
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (!p.isCrouching()) {
|
||||
final InscriberTileEntity tg = this.getTileEntity(w, pos);
|
||||
@@ -58,10 +58,10 @@ public class InscriberBlock extends AEBaseTileBlock<InscriberTileEntity> {
|
||||
ContainerOpener.openContainer(InscriberContainer.TYPE, p,
|
||||
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.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -62,10 +62,10 @@ public class InterfaceBlock extends AEBaseTileBlock<InterfaceTileEntity> {
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (p.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
final InterfaceTileEntity tg = this.getTileEntity(w, pos);
|
||||
@@ -74,9 +74,9 @@ public class InterfaceBlock extends AEBaseTileBlock<InterfaceTileEntity> {
|
||||
ContainerOpener.openContainer(InterfaceContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,17 +22,17 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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.StateContainer;
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
@@ -62,7 +62,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
|
||||
}
|
||||
|
||||
@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()) {
|
||||
// FIXME: This is ... uhm... fishy
|
||||
return ((World) w).getLight(pos) - 6;
|
||||
@@ -91,14 +91,14 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
|
||||
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);
|
||||
BlockState blockstate = w.getBlockState(test);
|
||||
return blockstate.isSolidSide(w, test, dir.getOpposite());
|
||||
}
|
||||
|
||||
@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
|
||||
// called without a world
|
||||
@@ -112,8 +112,8 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos,
|
||||
ISelectionContext context) {
|
||||
public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
|
||||
ShapeContext context) {
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,20 +27,20 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
@@ -81,7 +81,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
|
||||
public QuartzFixtureBlock() {
|
||||
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));
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@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);
|
||||
return SHAPES.get(facing);
|
||||
}
|
||||
@@ -195,7 +195,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
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.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -47,7 +47,7 @@ public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAc
|
||||
private static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
|
||||
public QuartzGrowthAcceleratorBlock() {
|
||||
super(defaultProps(Material.ROCK).sound(SoundType.METAL));
|
||||
super(defaultProps(Material.ROCK).sound(BlockSoundGroup.METAL));
|
||||
this.setDefaultState(this.getDefaultState().with(POWERED, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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.item.ItemStack;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -61,22 +61,22 @@ public class SecurityStationBlock extends AEBaseTileBlock<SecurityStationTileEnt
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (p.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
final SecurityStationTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (w.isRemote()) {
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
ContainerOpener.openContainer(SecurityStationContainer.TYPE, p,
|
||||
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.BlockRenderType;
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
@@ -37,7 +37,7 @@ import appeng.tile.misc.SkyCompassTileEntity;
|
||||
|
||||
public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
|
||||
|
||||
public SkyCompassBlock(Block.Properties props) {
|
||||
public SkyCompassBlock(Settings props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
|
||||
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);
|
||||
BlockState blockstate = w.getBlockState(test);
|
||||
return blockstate.isSolidSide(w, test, dir.getOpposite());
|
||||
@@ -83,7 +83,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
|
||||
}
|
||||
|
||||
@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
|
||||
|
||||
@@ -145,8 +145,8 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos,
|
||||
ISelectionContext context) {
|
||||
public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
|
||||
ShapeContext context) {
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,18 +28,18 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.projectile.AbstractArrowEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
@@ -51,23 +51,23 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
private static final VoxelShape SHAPE = VoxelShapes
|
||||
.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);
|
||||
setFullSize(setOpaque(false));
|
||||
}
|
||||
|
||||
@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
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (heldItem != null && heldItem.getItem() == Items.FLINT_AND_STEEL) {
|
||||
this.startFuse(w, pos, player);
|
||||
@@ -75,7 +75,7 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
heldItem.damageItem(1, player, p -> {
|
||||
p.sendBreakAnimation(hand);
|
||||
}); // FIXME Check if onBroken is equivalent
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
} else {
|
||||
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.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -68,10 +68,10 @@ public final class VibrationChamberBlock extends AEBaseTileBlock<VibrationChambe
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (player.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
if (Platform.isServer()) {
|
||||
@@ -79,11 +79,11 @@ public final class VibrationChamberBlock extends AEBaseTileBlock<VibrationChambe
|
||||
if (tc != null && !player.isCrouching()) {
|
||||
ContainerOpener.openContainer(VibrationChamberContainer.TYPE, player,
|
||||
ContainerLocator.forTileEntitySide(tc, hit.getFace()));
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,16 +40,16 @@ import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.NonNullList;
|
||||
import net.minecraft.util.math.*;
|
||||
import net.minecraft.util.math.RayTraceResult.Type;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
@@ -85,7 +85,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@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:
|
||||
// IS
|
||||
// OPPOSITE!?
|
||||
@@ -117,14 +117,14 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@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:
|
||||
// IS
|
||||
// OPPOSITE!?
|
||||
}
|
||||
|
||||
@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) {
|
||||
return state.getBlock().getLightValue(state, world, pos);
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (side == null) {
|
||||
side = Direction.UP;
|
||||
@@ -166,7 +166,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@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) {
|
||||
final Vec3d v3 = target.getHitVec().subtract(pos.getX(), pos.getY(), pos.getZ());
|
||||
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);
|
||||
ICableBusContainer out = null;
|
||||
|
||||
@@ -292,7 +292,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@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);
|
||||
IFacadeContainer out = null;
|
||||
|
||||
@@ -326,12 +326,12 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@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) {
|
||||
// Transform from world into block space
|
||||
Vec3d hitVec = hit.getHitVec();
|
||||
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
|
||||
@@ -339,7 +339,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
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) {
|
||||
try {
|
||||
return this.cb(world, pos).recolourBlock(side, AEColor.values()[color.ordinal()], who);
|
||||
@@ -355,7 +355,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getFacadeState(IBlockReader world, BlockPos pos, Direction side) {
|
||||
public BlockState getFacadeState(BlockView world, BlockPos pos, Direction side) {
|
||||
if (side != null) {
|
||||
IFacadeContainer container = this.fc(world, pos);
|
||||
if (container != null) {
|
||||
@@ -369,7 +369,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@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);
|
||||
if (te == null) {
|
||||
return VoxelShapes.empty();
|
||||
@@ -379,7 +379,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
}
|
||||
|
||||
@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);
|
||||
if (te == null) {
|
||||
return VoxelShapes.empty();
|
||||
|
||||
@@ -20,10 +20,10 @@ package appeng.block.networking;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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.StateContainer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package appeng.block.networking;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.networking.EnergyAcceptorTileEntity;
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.state.IntegerProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.NonNullList;
|
||||
@@ -47,7 +47,7 @@ public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellTileEntity> {
|
||||
super.fillItemGroup(group, itemStacks);
|
||||
|
||||
final ItemStack charged = new ItemStack(this, 1);
|
||||
final CompoundNBT tag = charged.getOrCreateTag();
|
||||
final CompoundTag tag = charged.getOrCreateTag();
|
||||
tag.putDouble("internalCurrentPower", 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.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.IStringSerializable;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
@@ -84,7 +84,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
|
||||
}
|
||||
|
||||
@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) {
|
||||
final WirelessTileEntity tg = this.getTileEntity(w, pos);
|
||||
|
||||
@@ -93,14 +93,14 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
|
||||
ContainerOpener.openContainer(WirelessContainer.TYPE, player,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
return super.onBlockActivated(state, w, pos, player, hand, hit);
|
||||
}
|
||||
|
||||
@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);
|
||||
if (tile != null) {
|
||||
final Direction forward = tile.getForward();
|
||||
@@ -159,7 +159,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
|
||||
}
|
||||
|
||||
@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);
|
||||
if (tile != null) {
|
||||
@@ -220,7 +220,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
|
||||
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.texture.AtlasTexture;
|
||||
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.minecraftforge.client.model.data.IDynamicBakedModel;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
|
||||
@@ -20,18 +20,18 @@ package appeng.block.paint;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -54,7 +54,7 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntit
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntit
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
if (tp != null) {
|
||||
@@ -87,7 +87,7 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntit
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.model.Material;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
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.minecraftforge.client.model.data.IDynamicBakedModel;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
|
||||
@@ -3,7 +3,7 @@ package appeng.block.qnb;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
public class QnbFormedState {
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
public QuantumBaseBlock(Block.Properties props) {
|
||||
public QuantumBaseBlock(Settings props) {
|
||||
super(props);
|
||||
this.setFullSize(this.setOpaque(false));
|
||||
this.setDefaultState(this.getDefaultState().with(FORMED, false));
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,15 +25,15 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.client.EffectType;
|
||||
@@ -73,10 +73,10 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (p.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
final QuantumBridgeTileEntity tg = this.getTileEntity(w, pos);
|
||||
@@ -84,13 +84,13 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(QNBContainer.TYPE, p, ContainerLocator.forTileEntity(tg));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
package appeng.block.qnb;
|
||||
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
import appeng.tile.qnb.QuantumBridgeTileEntity;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class QuantumRingBlock extends QuantumBaseBlock {
|
||||
}
|
||||
|
||||
@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);
|
||||
if (bridge != null && bridge.isCorner()) {
|
||||
return SHAPE_CORNER;
|
||||
|
||||
@@ -20,19 +20,19 @@ package appeng.block.spatial;
|
||||
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.block.material.PushReaction;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -65,13 +65,13 @@ public class MatrixFrameBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos,
|
||||
ISelectionContext context) {
|
||||
public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
|
||||
ShapeContext context) {
|
||||
return VoxelShapes.fullCube();
|
||||
}
|
||||
|
||||
@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!
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
@@ -87,17 +87,17 @@ public class MatrixFrameBlock extends AEBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getAmbientOcclusionLightValue(BlockState state, IBlockReader worldIn, BlockPos pos) {
|
||||
public float getAmbientOcclusionLightValue(BlockState state, BlockView worldIn, BlockPos pos) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@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) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -54,10 +54,10 @@ public class SpatialIOPortBlock extends AEBaseTileBlock<SpatialIOPortTileEntity>
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (p.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
final SpatialIOPortTileEntity tg = this.getTileEntity(w, pos);
|
||||
@@ -66,8 +66,8 @@ public class SpatialIOPortBlock extends AEBaseTileBlock<SpatialIOPortTileEntity>
|
||||
ContainerOpener.openContainer(SpatialIOPortContainer.TYPE, p,
|
||||
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.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
@@ -44,7 +44,7 @@ public class SpatialPylonBlock extends AEBaseTileBlock<SpatialPylonTileEntity> {
|
||||
}
|
||||
|
||||
@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);
|
||||
if (tsp != null) {
|
||||
return tsp.getLightValue();
|
||||
|
||||
@@ -22,12 +22,12 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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.item.ItemStack;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -72,12 +72,12 @@ public class ChestBlock extends AEBaseTileBlock<ChestTileEntity> {
|
||||
}
|
||||
|
||||
@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 ChestTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null && !p.isCrouching()) {
|
||||
if (w.isRemote()) {
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
if (hit.getFace() == tg.getUp()) {
|
||||
@@ -89,9 +89,9 @@ public class ChestBlock extends AEBaseTileBlock<ChestTileEntity> {
|
||||
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 net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -43,10 +43,10 @@ public class DriveBlock extends AEBaseTileBlock<DriveTileEntity> {
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (p.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
final DriveTileEntity tg = this.getTileEntity(w, pos);
|
||||
@@ -54,8 +54,8 @@ public class DriveBlock extends AEBaseTileBlock<DriveTileEntity> {
|
||||
if (Platform.isServer()) {
|
||||
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.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
@@ -54,10 +54,10 @@ public class IOPortBlock extends AEBaseTileBlock<IOPortTileEntity> {
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (p.isCrouching()) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
final IOPortTileEntity tg = this.getTileEntity(w, pos);
|
||||
@@ -66,8 +66,8 @@ public class IOPortBlock extends AEBaseTileBlock<IOPortTileEntity> {
|
||||
ContainerOpener.openContainer(IOPortContainer.TYPE, p,
|
||||
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.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
@@ -66,33 +66,33 @@ public class SkyChestBlock extends AEBaseTileBlock<SkyChestTileEntity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
|
||||
public boolean propagatesSkylightDown(BlockState state, BlockView reader, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@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) {
|
||||
if (Platform.isServer()) {
|
||||
SkyChestTileEntity tile = getTileEntity(w, pos);
|
||||
if (tile == null) {
|
||||
return ActionResultType.PASS;
|
||||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
ContainerOpener.openContainer(SkyChestContainer.TYPE, player, ContainerLocator.forTileEntity(tile));
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@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!
|
||||
AxisAlignedBB aabb = computeAABB(worldIn, pos);
|
||||
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);
|
||||
Direction o = Direction.UP;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.capabilities;
|
||||
|
||||
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.CapabilityInject;
|
||||
import net.minecraftforge.common.capabilities.CapabilityManager;
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.lwjgl.glfw.GLFW;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
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_);
|
||||
}
|
||||
|
||||
public void postUpdate(final CompoundNBT in) {
|
||||
public void postUpdate(final CompoundTag in) {
|
||||
if (in.getBoolean("clear")) {
|
||||
this.byId.clear();
|
||||
this.refreshList = true;
|
||||
@@ -216,7 +216,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
if (key.startsWith("=")) {
|
||||
try {
|
||||
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"));
|
||||
final ClientDCInternalInv current = this.getById(id, invData.getLong("sortBy"), un);
|
||||
|
||||
@@ -307,7 +307,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
return false;
|
||||
}
|
||||
|
||||
final CompoundNBT encodedValue = itemStack.getTag();
|
||||
final CompoundTag encodedValue = itemStack.getTag();
|
||||
|
||||
if (encodedValue == null) {
|
||||
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.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
public abstract class DelegateBakedModel implements IBakedModel {
|
||||
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.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
/**
|
||||
* @author DrummerMC
|
||||
|
||||
@@ -38,7 +38,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
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.ItemOverrideList;
|
||||
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.IModelData;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.Quaternion;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
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.math.Vec3i;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
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.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
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.texture.MissingTextureSprite;
|
||||
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.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.client.model.data.EmptyModelData;
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
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.BlockPos;
|
||||
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.vertex.VertexFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
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.world.ILightReader;
|
||||
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.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Direction.Axis;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
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.ItemOverrideList;
|
||||
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.IModelData;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
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.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.ItemOverrideList;
|
||||
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.IModelData;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
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.OnlyIn;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.render.crafting;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
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 appeng.block.crafting.AbstractCraftingUnitBlock;
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.render.crafting;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
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 appeng.api.util.AEColor;
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.render.crafting;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
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 appeng.client.render.cablebus.CubeBuilder;
|
||||
|
||||
@@ -6,7 +6,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
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.ModelProperty;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
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.Vec3i;
|
||||
import net.minecraft.world.ILightReader;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.client.render.model;
|
||||
|
||||
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.
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
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.ItemOverrideList;
|
||||
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.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.IBakedModel;
|
||||
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.pipeline.BakedQuadBuilder;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package appeng.client.render.model;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
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.vertex.VertexFormat;
|
||||
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.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.ILightReader;
|
||||
import net.minecraftforge.client.model.data.IDynamicBakedModel;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.client.renderer.Vector4f;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
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.Lists;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
// TODO: Investigate use of CubeBuilder instead
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user