当前位置: 首页>>代码示例>>Java>>正文


Java ContainerRepair类代码示例

本文整理汇总了Java中net.minecraft.inventory.ContainerRepair的典型用法代码示例。如果您正苦于以下问题:Java ContainerRepair类的具体用法?Java ContainerRepair怎么用?Java ContainerRepair使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ContainerRepair类属于net.minecraft.inventory包,在下文中一共展示了ContainerRepair类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onTick

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
@Override
public void onTick() {
	if (this.repairGuiTask==null||!(this.repairGuiTask instanceof GuiRepair))
		return;
	final EntryId entryId = CurrentMode.instance.getEntryId();
	if (!entryId.isNameable())
		return;
	try {
		final GuiTextField textField = guiRepairTextField.get(this.repairGuiTask);
		final ContainerRepair containerRepair = guiRepairContainer.get(this.repairGuiTask);
		if (textField!=null&&containerRepair!=null) {
			final String text = textField.getText();
			if (!StringUtils.isEmpty(text)&&!StringUtils.equals(this.repairGuiTextFieldCache, text)) {
				final String name = entryId.id();
				Sign.setRepairName(name, textField, containerRepair);
				this.repairGuiTextFieldCache = name;
			}
		}
		return;
	} catch (final Exception e) {
		Log.notice(I18n.format("signpic.chat.error.place"));
	}
	Log.notice(I18n.format("signpic.chat.error.place"));
}
 
开发者ID:Team-Fruit,项目名称:SignPicture,代码行数:25,代码来源:AnvilHandler.java

示例2: displayGUIAnvil

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_)
{
    // CraftBukkit start - Inventory open hook
    Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerRepair(this.inventory, this.worldObj, p_82244_1_, p_82244_2_, p_82244_3_, this));

    if (container == null)
    {
        return;
    }

    // CraftBukkit end
    this.getNextWindowId();
    this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 8, "Repairing", 9, true));
    this.openContainer = container; // CraftBukkit - Use container we passed to event
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:18,代码来源:EntityPlayerMP.java

示例3: ContainerAnvil

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public ContainerAnvil(EntityPlayer player, World world, int x, int y, int z) {
	super(player.inventory, world, x, y, z, player);
	this.player = player;
	this.x = x;
	this.y = y;
	this.z = z;
	this.world = world;

	inputSlots = ReflectionHelper.getPrivateValue(ContainerRepair.class, this, "inputSlots", "field_82853_g");
	outputSlot = ReflectionHelper.getPrivateValue(ContainerRepair.class, this, "outputSlot", "field_82852_f");
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:12,代码来源:ContainerAnvil.java

示例4: onAnvilChange

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public static boolean onAnvilChange(ContainerRepair container, ItemStack left, ItemStack right, IInventory outputSlot, String name, int baseCost)
{
    AnvilUpdateEvent e = new AnvilUpdateEvent(left, right, name, baseCost);
    if (MinecraftForge.EVENT_BUS.post(e)) return false;
    if (e.getOutput() == null) return true;

    outputSlot.setInventorySlotContents(0, e.getOutput());
    container.maximumCost = e.getCost();
    container.materialCost = e.getMaterialCost();
    return false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:ForgeHooks.java

示例5: onAnvilChange

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public static boolean onAnvilChange(ContainerRepair container, ItemStack left, ItemStack right, IInventory outputSlot, String name, int baseCost)
{
    AnvilUpdateEvent e = new AnvilUpdateEvent(left, right, name, baseCost);
    if (MinecraftForge.EVENT_BUS.post(e)) return false;
    if (e.output == null) return true;

    outputSlot.func_70299_a(0, e.output);
    container.field_82854_e = e.cost;
    container.field_82856_l = e.materialCost;
    return false;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:12,代码来源:ForgeHooks.java

示例6: onAnvilChange

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public static boolean onAnvilChange(ContainerRepair container, ItemStack left, ItemStack right, IInventory outputSlot, String name, int baseCost)
{
    AnvilUpdateEvent e = new AnvilUpdateEvent(left, right, name, baseCost);
    if (MinecraftForge.EVENT_BUS.post(e)) return false;
    if (e.output == null) return true;

    outputSlot.setInventorySlotContents(0, e.output);
    container.maximumCost = e.cost;
    container.stackSizeToBeUsedInRepair = e.materialCost;
    return false;
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:12,代码来源:ForgeHooks.java

示例7: displayGUIAnvil

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
/**
 * Displays the GUI for interacting with an anvil.
 */
public void displayGUIAnvil(int par1, int par2, int par3)
{
    this.getNextWindowId();
    this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 8, "Repairing", 9, true));
    this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:12,代码来源:EntityPlayerMP.java

示例8: getAnvilData

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
private AnvilData getAnvilData(ItemStack a, ItemStack b, String name) {
	ContainerRepair anvil = getFakeAnvil();
	IInventory input = anvil.getSlot(0).inventory;
	IInventory output = anvil.getSlot(2).inventory;
	
	input.setInventorySlotContents(0, a);
	input.setInventorySlotContents(1, b);
	anvil.updateItemName(name);
	
	return new AnvilData(anvil.maximumCost, output.getStackInSlot(0));
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:12,代码来源:PeripheralAnvil.java

示例9: displayGUIAnvil

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_)
{
    this.getNextWindowId();
    this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 8, "Repairing", 9, true));
    this.openContainer = new ContainerRepair(this.inventory, this.worldObj, p_82244_1_, p_82244_2_, p_82244_3_, this);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:9,代码来源:EntityPlayerMP.java

示例10: func_82244_d

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public void func_82244_d(int p_82244_1_, int p_82244_2_, int p_82244_3_) {
   this.func_71117_bO();
   this.field_71135_a.func_72567_b(new Packet100OpenWindow(this.field_71139_cq, 8, "Repairing", 9, true));
   this.field_71070_bA = new ContainerRepair(this.field_71071_by, this.field_70170_p, p_82244_1_, p_82244_2_, p_82244_3_, this);
   this.field_71070_bA.field_75152_c = this.field_71139_cq;
   this.field_71070_bA.func_75132_a(this);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:8,代码来源:EntityPlayerMP.java

示例11: ContainerRepairINNER2

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
ContainerRepairINNER2(ContainerRepair p_i1799_1_, IInventory p_i1799_2_, int p_i1799_3_, int p_i1799_4_, int p_i1799_5_, World p_i1799_6_, int p_i1799_7_, int p_i1799_8_, int p_i1799_9_) {
   super(p_i1799_2_, p_i1799_3_, p_i1799_4_, p_i1799_5_);
   this.field_135068_e = p_i1799_1_;
   this.field_135071_a = p_i1799_6_;
   this.field_135069_b = p_i1799_7_;
   this.field_135070_c = p_i1799_8_;
   this.field_135067_d = p_i1799_9_;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:ContainerRepairINNER2.java

示例12: func_82870_a

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public void func_82870_a(EntityPlayer p_82870_1_, ItemStack p_82870_2_) {
   if(!p_82870_1_.field_71075_bZ.field_75098_d) {
      p_82870_1_.func_82242_a(-this.field_135068_e.field_82854_e);
   }

   ContainerRepair.func_82851_a(this.field_135068_e).func_70299_a(0, (ItemStack)null);
   if(ContainerRepair.func_82849_b(this.field_135068_e) > 0) {
      ItemStack var3 = ContainerRepair.func_82851_a(this.field_135068_e).func_70301_a(1);
      if(var3 != null && var3.field_77994_a > ContainerRepair.func_82849_b(this.field_135068_e)) {
         var3.field_77994_a -= ContainerRepair.func_82849_b(this.field_135068_e);
         ContainerRepair.func_82851_a(this.field_135068_e).func_70299_a(1, var3);
      } else {
         ContainerRepair.func_82851_a(this.field_135068_e).func_70299_a(1, (ItemStack)null);
      }
   } else {
      ContainerRepair.func_82851_a(this.field_135068_e).func_70299_a(1, (ItemStack)null);
   }

   this.field_135068_e.field_82854_e = 0;
   if(!p_82870_1_.field_71075_bZ.field_75098_d && !this.field_135071_a.field_72995_K && this.field_135071_a.func_72798_a(this.field_135069_b, this.field_135070_c, this.field_135067_d) == Block.field_82510_ck.field_71990_ca && p_82870_1_.func_70681_au().nextFloat() < 0.12F) {
      int var6 = this.field_135071_a.func_72805_g(this.field_135069_b, this.field_135070_c, this.field_135067_d);
      int var4 = var6 & 3;
      int var5 = var6 >> 2;
      ++var5;
      if(var5 > 2) {
         this.field_135071_a.func_94571_i(this.field_135069_b, this.field_135070_c, this.field_135067_d);
         this.field_135071_a.func_72926_e(1020, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0);
      } else {
         this.field_135071_a.func_72921_c(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2);
         this.field_135071_a.func_72926_e(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0);
      }
   } else if(!this.field_135071_a.field_72995_K) {
      this.field_135071_a.func_72926_e(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0);
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:37,代码来源:ContainerRepairINNER2.java

示例13: displayGUIAnvil

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
/**
 * Displays the GUI for interacting with an anvil.
 */
public void displayGUIAnvil(int par1, int par2, int par3)
{
    this.incrementWindowID();
    this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true));
    this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:12,代码来源:EntityPlayerMP.java

示例14: createContainer

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
{
    return new ContainerRepair(playerInventory, this.world, this.position, playerIn);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:BlockAnvil.java

示例15: GuiRepair

import net.minecraft.inventory.ContainerRepair; //导入依赖的package包/类
public GuiRepair(InventoryPlayer inventoryIn, World worldIn)
{
    super(new ContainerRepair(inventoryIn, worldIn, Minecraft.getMinecraft().thePlayer));
    this.playerInventory = inventoryIn;
    this.anvil = (ContainerRepair)this.inventorySlots;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:GuiRepair.java


注:本文中的net.minecraft.inventory.ContainerRepair类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。