mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Initial 1.11-pre1 update
This commit is contained in:
1 parent
c177219ff3
commit
4e6a774075
294 files changed
+3099
-2846
No files matched your search
@@ -21,6 +21,7 @@ import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -187,8 +188,9 @@ public class DynBucketTest
|
||||
|
||||
public static class TestItem extends Item {
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand)
|
||||
{
|
||||
ItemStack itemStackIn = playerIn.getHeldItem(hand);
|
||||
if(worldIn.isRemote)
|
||||
return new ActionResult<ItemStack>(EnumActionResult.PASS, itemStackIn);
|
||||
|
||||
@@ -235,7 +237,7 @@ public class DynBucketTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -276,8 +278,9 @@ public class DynBucketTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
ItemStack heldItem = playerIn.getHeldItem(hand);
|
||||
TileEntity te = worldIn.getTileEntity(pos);
|
||||
if (!(te instanceof IFluidHandler))
|
||||
{
|
||||
@@ -286,7 +289,7 @@ public class DynBucketTest
|
||||
IFluidHandler tank = (IFluidHandler) te;
|
||||
side = side.getOpposite();
|
||||
|
||||
if (heldItem == null)
|
||||
if (null == null)
|
||||
{
|
||||
sendText(playerIn, tank, side);
|
||||
return false;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ForgeBlockStatesLoaderDebug {
|
||||
public static void registerItems(RegistryEvent.Register<Item> event)
|
||||
{
|
||||
event.getRegistry().registerAll(
|
||||
new ItemMultiTexture(BLOCKS.custom_wall, BLOCKS.custom_wall, new Function<ItemStack, String>()
|
||||
new ItemMultiTexture(BLOCKS.custom_wall, BLOCKS.custom_wall, new ItemMultiTexture.Mapper()
|
||||
{
|
||||
@Override
|
||||
public String apply(ItemStack stack)
|
||||
|
||||
@@ -136,7 +136,7 @@ public class ItemTileDebug
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
public boolean isVisuallyOpaque(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
|
||||
@@ -100,7 +100,7 @@ public class ModelAnimationDebug
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, BlockPistonBase.getFacingFromEntity(pos, placer));
|
||||
return this.getDefaultState().withProperty(FACING, EnumFacing.func_190914_a(pos, placer));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,7 +139,7 @@ public class ModelAnimationDebug
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
|
||||
@@ -148,7 +148,7 @@ public class ModelBakeEventDebug
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
public boolean isVisuallyOpaque(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
@@ -157,7 +157,7 @@ public class ModelBakeEventDebug
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
if(te instanceof CustomTileEntity)
|
||||
|
||||
@@ -139,7 +139,7 @@ public class ModelLoaderRegistryDebug
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
public boolean isVisuallyOpaque(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
@@ -168,7 +168,7 @@ public class ModelLoaderRegistryDebug
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
@@ -244,10 +244,10 @@ public class ModelLoaderRegistryDebug
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
public boolean isVisuallyOpaque(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.getTileEntity(pos) == null) world.setTileEntity(pos, new OBJTesseractTileEntity());
|
||||
OBJTesseractTileEntity tileEntity = (OBJTesseractTileEntity) world.getTileEntity(pos);
|
||||
@@ -381,7 +381,7 @@ public class ModelLoaderRegistryDebug
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
public boolean isVisuallyOpaque(IBlockState state) { return false; }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -438,7 +438,7 @@ public class ModelLoaderRegistryDebug
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
public boolean isVisuallyOpaque(IBlockState state) { return false; }
|
||||
|
||||
public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn)
|
||||
{
|
||||
@@ -488,7 +488,7 @@ public class ModelLoaderRegistryDebug
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof OBJVertexColoring2TileEntity)
|
||||
{
|
||||
@@ -591,7 +591,7 @@ public class ModelLoaderRegistryDebug
|
||||
public boolean isFullCube(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque() { return false; }
|
||||
public boolean isVisuallyOpaque(IBlockState state) { return false; }
|
||||
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
|
||||
+3
-2
@@ -17,6 +17,7 @@ import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -32,10 +33,10 @@ public class ItemBlockSubstitutionRemoveRestoreTest
|
||||
private static class ItemMyDirt extends ItemMultiTexture
|
||||
{
|
||||
public ItemMyDirt() {
|
||||
super(Blocks.DIRT, Blocks.DIRT, new Function<ItemStack, String>()
|
||||
super(Blocks.DIRT, Blocks.DIRT, new Mapper()
|
||||
{
|
||||
@Nullable
|
||||
public String apply(@Nullable ItemStack p_apply_1_)
|
||||
public String apply(@Nonnull ItemStack p_apply_1_)
|
||||
{
|
||||
return BlockDirt.DirtType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -74,7 +75,7 @@ public class FluidHandlerTest
|
||||
|
||||
private static String stackString(ItemStack stack)
|
||||
{
|
||||
if (stack == null || stack.stackSize <= 0)
|
||||
if (stack.func_190926_b())
|
||||
{
|
||||
return "no item";
|
||||
}
|
||||
@@ -89,13 +90,13 @@ public class FluidHandlerTest
|
||||
{
|
||||
resourceDomain = stack.getItem().getRegistryName().getResourceDomain();
|
||||
}
|
||||
return stack.stackSize + " " + stack.getDisplayName() + " (" + resourceDomain + ")";
|
||||
return stack.func_190916_E() + " " + stack.getDisplayName() + " (" + resourceDomain + ")";
|
||||
}
|
||||
}
|
||||
|
||||
private static List<ItemStack> getAllItems()
|
||||
{
|
||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||
NonNullList<ItemStack> list = NonNullList.func_191196_a();
|
||||
for (Item item : ForgeRegistries.ITEMS.getValues())
|
||||
{
|
||||
for (CreativeTabs tab : item.getCreativeTabs())
|
||||
|
||||
@@ -161,8 +161,9 @@ public class NoBedSleepingTest
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (!world.isRemote)
|
||||
{
|
||||
final SleepResult result = player.trySleep(player.getPosition());
|
||||
|
||||
@@ -3,7 +3,6 @@ package net.minecraftforge.test;
|
||||
import net.minecraft.entity.item.EntityArmorStand;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.SkeletonType;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -136,8 +135,8 @@ public class PlayerInteractEventTest
|
||||
&& evt.getTarget() instanceof EntitySkeleton
|
||||
&& evt.getLocalPos().yCoord > evt.getTarget().height / 2.0)
|
||||
{
|
||||
// If we right click the upper half of a skeleton it becomes wither skeleton. Otherwise nothing happens.
|
||||
((EntitySkeleton) evt.getTarget()).setSkeletonType(SkeletonType.WITHER);
|
||||
// If we right click the upper half of a skeleton it dies.
|
||||
((EntitySkeleton) evt.getTarget()).setDead();
|
||||
evt.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user