當前位置: 首頁>>代碼示例>>Java>>正文


Java TileEntitySign類代碼示例

本文整理匯總了Java中net.minecraft.tileentity.TileEntitySign的典型用法代碼示例。如果您正苦於以下問題:Java TileEntitySign類的具體用法?Java TileEntitySign怎麽用?Java TileEntitySign使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TileEntitySign類屬於net.minecraft.tileentity包,在下文中一共展示了TileEntitySign類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TileEntityRendererDispatcher

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());

    for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())
    {
        tileentityspecialrenderer.setRendererDispatcher(this);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:TileEntityRendererDispatcher.java

示例2: handleUpdateSign

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
/**
 * Updates a specified sign with the specified text lines
 */
public void handleUpdateSign(S33PacketUpdateSign packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	boolean flag = false;

	if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos())) {
		TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());

		if (tileentity instanceof TileEntitySign) {
			TileEntitySign tileentitysign = (TileEntitySign) tileentity;

			if (tileentitysign.getIsEditable()) {
				System.arraycopy(packetIn.getLines(), 0, tileentitysign.signText, 0, 4);
				tileentitysign.markDirty();
			}

			flag = true;
		}
	}

	if (!flag && this.gameController.thePlayer != null) {
		this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at "
				+ packetIn.getPos().getX() + ", " + packetIn.getPos().getY() + ", " + packetIn.getPos().getZ()));
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:28,代碼來源:NetHandlerPlayClient.java

示例3: handleUpdateTileEntity

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.world.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.world.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();
        boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign || i == 10 && tileentity instanceof TileEntityShulkerBox)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }

        if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
        {
            ((GuiCommandBlock)this.gameController.currentScreen).updateGui();
        }
    }
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:26,代碼來源:NetHandlerPlayClient.java

示例4: TileEntityRendererDispatcher

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
    this.mapSpecialRenderers.put(TileEntityEndGateway.class, new TileEntityEndGatewayRenderer());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());
    this.mapSpecialRenderers.put(TileEntityStructure.class, new TileEntityStructureRenderer());
    this.mapSpecialRenderers.put(TileEntityShulkerBox.class, new TileEntityShulkerBoxRenderer(new ModelShulker()));

    for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())
    {
        tileentityspecialrenderer.setRendererDispatcher(this);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:22,代碼來源:TileEntityRendererDispatcher.java

示例5: TileEntityRendererDispatcher

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer());
    this.mapSpecialRenderers.put(TileEntityEndGateway.class, new TileEntityEndGatewayRenderer());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());
    this.mapSpecialRenderers.put(TileEntityStructure.class, new TileEntityStructureRenderer());

    for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())
    {
        tileentityspecialrenderer.setRendererDispatcher(this);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:21,代碼來源:TileEntityRendererDispatcher.java

示例6: wrapSignText

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
private static void wrapSignText(String containerProperty,
		TileEntitySign sign) {
	if (containerProperty.length() < 14) {
		sign.signText[1] = new ChatComponentText(containerProperty);
	} else if (containerProperty.length() < 27) {
		sign.signText[1] = new ChatComponentText(
				containerProperty.substring(0, 13));
		sign.signText[2] = new ChatComponentText(
				containerProperty.substring(13, containerProperty.length()));
	} else {
		sign.signText[1] = new ChatComponentText(
				containerProperty.substring(0, 13));
		sign.signText[1] = new ChatComponentText(
				containerProperty.substring(13, 26));
		sign.signText[2] = new ChatComponentText(
				containerProperty.substring(26, containerProperty.length()));
	}
}
 
開發者ID:AdityaGupta1,項目名稱:mobycraft,代碼行數:19,代碼來源:StructureBuilder.java

示例7: init

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
@Override
public void init(final @Nonnull FMLInitializationEvent event) {
	super.init(event);

	// Replace Sign Renderer
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySign.class, Client.renderer);
	MinecraftForgeClient.registerItemRenderer(Items.sign, new CustomItemSignRenderer());

	// Event Register
	Client.handler.init();
	ClientCommandHandler.instance.registerCommand(Client.rootCommand);
}
 
開發者ID:Team-Fruit,項目名稱:SignPicture,代碼行數:13,代碼來源:ClientProxy.java

示例8: getSignRotate

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
public @Nonnull Quat4f getSignRotate(final @Nonnull TileEntitySign tile) {
	// Vanilla Translate
	final Block block = tile.getBlockType();
	if (block==Blocks.standing_sign) {
		final float f2 = tile.getBlockMetadata()*360f/16f;
		return RotationMath.quatDeg(-f2, 0f, 1f, 0f);
	} else {
		final int j = tile.getBlockMetadata();
		float f3;
		switch (j) {
			case 2:
				f3 = 180f;
				break;
			case 4:
				f3 = 90f;
				break;
			case 5:
				f3 = -90f;
				break;
			default:
				f3 = 0f;
				break;
		}
		return RotationMath.quatDeg(-f3, 0f, 1f, 0f);
	}
}
 
開發者ID:Team-Fruit,項目名稱:SignPicture,代碼行數:27,代碼來源:CustomTileEntitySignRenderer.java

示例9: signContains

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
private boolean signContains(TileEntitySign sign, String str) {
	// If the sign's text is messed up or something
	if (sign.signText == null) {
		return false;
	}

	// makes the subsequence
	final CharSequence mySeq = str.subSequence(0, str.length() - 1);

	// loops through for all sign lines
	for (int i = 0; i < sign.signText.length; i++) {
		// name just has to be included in full on one of the lines.
		if (sign.signText[i].contains(mySeq)) {
			return true;
		}
	}

	return false;
}
 
開發者ID:allaryin,項目名稱:FairyFactions,代碼行數:20,代碼來源:EntityFairy.java

示例10: onReceiveClient

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
@Override
public void onReceiveClient(Minecraft client, WorldClient world, EntityPlayerSP player, MessageContext context) {
    BlockSystem blockSystem = BlockSystems.PROXY.getBlockSystemHandler(world).getBlockSystem(this.blockSystem);
    if (blockSystem != null) {
        if (blockSystem.isBlockLoaded(this.pos)) {
            TileEntity blockEntity = blockSystem.getTileEntity(this.pos);
            boolean commandBlock = this.type == 2 && blockEntity instanceof TileEntityCommandBlock;
            if (this.type == 1 && blockEntity instanceof TileEntityMobSpawner || commandBlock || this.type == 3 && blockEntity instanceof TileEntityBeacon || this.type == 4 && blockEntity instanceof TileEntitySkull || this.type == 5 && blockEntity instanceof TileEntityFlowerPot || this.type == 6 && blockEntity instanceof TileEntityBanner || this.type == 7 && blockEntity instanceof TileEntityStructure || this.type == 8 && blockEntity instanceof TileEntityEndGateway || this.type == 9 && blockEntity instanceof TileEntitySign) {
                blockEntity.readFromNBT(this.data);
            } else {
                blockEntity.onDataPacket(client.getConnection().getNetworkManager(), new SPacketUpdateTileEntity(this.pos, this.type, this.data));
            }
            if (commandBlock && client.currentScreen instanceof GuiCommandBlock) {
                ((GuiCommandBlock) client.currentScreen).updateGui();
            }
        }
    }
}
 
開發者ID:gegy1000,項目名稱:BlockSystems,代碼行數:19,代碼來源:UpdateBlockEntityMessage.java

示例11: doGen

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
ColossalBuilder doGen(Coord at, int randSeed) {
    Coord signAt = at.copy();
    ColossalBuilder builder = new ColossalBuilder(randSeed, at);
    builder.construct();
    
    if (signAt.getTE(TileEntityCommandBlock.class) != null) {
        signAt.set(BlockStandingSign.ROTATION, 12, true);
        TileEntitySign sign = signAt.getTE(TileEntitySign.class);
        if (sign != null) {
            sign.signText[0] = new ChatComponentText("Colossus Seed");
            sign.signText[1] = new ChatComponentText("" + randSeed);
            signAt.markBlockForUpdate();
        }
    }
    return builder;
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:17,代碼來源:BuildColossusCommand.java

示例12: cleanPosters

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
int cleanPosters() {
    int ret = 0;
    for (EntityPoster poster : getPosters()) {
        if (!poster.isLocked()) continue;
        if (!ItemUtil.is(poster.getItem(), Core.registry.brokenTool)) continue;
        poster.setItem(null);
        poster.setLocked(false);
        poster.syncData();
        ret++;
        ICoordFunction clearSign = new ICoordFunction() {
            @Override
            public void handle(Coord here) {
                if (!(here.getBlock() instanceof BlockSign)) return;
                TileEntitySign sign = here.getTE(TileEntitySign.class);
                if (sign == null) return;
                for (int i = 0; i < sign.signText.length; i++) {
                    sign.signText[i] = new ChatComponentText("");
                }
                here.markBlockForUpdate();
            }
        };
        iterateSign(poster, clearSign);
    }
    return ret;
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:26,代碼來源:TileEntityLegendarium.java

示例13: populate

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
@Override
public boolean populate(World world) {
	Block curBlock = world.getBlock(x, y, z);
	if(curBlock == Blocks.standing_sign || curBlock == Blocks.wall_sign) {
		TileEntitySign sign = (TileEntitySign) world.getTileEntity(x, y, z);

        if (sign != null)
        {
    		sign.signText = this.signText;
    		sign.markDirty();
    		world.markBlockForUpdate(x, y, z);
    		return true;
        }
	}
	return false;
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:17,代碼來源:SetSignText.java

示例14: TileEntityRendererDispatcher

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
private TileEntityRendererDispatcher()
{
    this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer());
    this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityRendererPiston());
    this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable());
    this.mapSpecialRenderers.put(TileEntityEndPortal.class, new RenderEndPortal());
    this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
    this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
    Iterator var1 = this.mapSpecialRenderers.values().iterator();

    while (var1.hasNext())
    {
        TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)var1.next();
        var2.func_147497_a(this);
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:20,代碼來源:TileEntityRendererDispatcher.java

示例15: callMethod

import net.minecraft.tileentity.TileEntitySign; //導入依賴的package包/類
@Override
public Object[] callMethod(IComputerAccess computer, int method, Object[] arguments) throws Exception {
	switch (method) {
		case 0:
		case 1:
		case 2: {
			int direction = method == 0 ? turtle.getFacingDir() : (method == 1 ? 1 : 0);
			Vec3 pos = turtle.getPosition();
			int x = (int)Math.floor(pos.xCoord) + Facing.offsetsXForSide[direction];
			int y = (int)Math.floor(pos.yCoord) + Facing.offsetsYForSide[direction];
			int z = (int)Math.floor(pos.zCoord) + Facing.offsetsZForSide[direction];
			
			TileEntity te = turtle.getWorld().getBlockTileEntity(x, y, z);
			if (te instanceof TileEntitySign) {
				return ((TileEntitySign)te).signText.clone();
			}
		}
	}
	
	return new Object[0];
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:22,代碼來源:PeripheralSignReader.java


注:本文中的net.minecraft.tileentity.TileEntitySign類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。