本文整理汇总了Java中net.minecraft.tileentity.TileEntityStructure类的典型用法代码示例。如果您正苦于以下问题:Java TileEntityStructure类的具体用法?Java TileEntityStructure怎么用?Java TileEntityStructure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TileEntityStructure类属于net.minecraft.tileentity包,在下文中一共展示了TileEntityStructure类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handleUpdateTileEntity
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的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
示例2: neighborChanged
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
/**
* Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
* change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
* block, etc.
*/
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos p_189540_5_)
{
if (!worldIn.isRemote)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityStructure)
{
TileEntityStructure tileentitystructure = (TileEntityStructure)tileentity;
boolean flag = worldIn.isBlockPowered(pos);
boolean flag1 = tileentitystructure.isPowered();
if (flag && !flag1)
{
tileentitystructure.setPowered(true);
this.trigger(tileentitystructure);
}
else if (!flag && flag1)
{
tileentitystructure.setPowered(false);
}
}
}
}
开发者ID:sudofox,项目名称:Backmemed,代码行数:30,代码来源:BlockStructure.java
示例3: trigger
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
private void trigger(TileEntityStructure p_189874_1_)
{
switch (p_189874_1_.getMode())
{
case SAVE:
p_189874_1_.save(false);
break;
case LOAD:
p_189874_1_.load(false);
break;
case CORNER:
p_189874_1_.unloadStructure();
case DATA:
}
}
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:BlockStructure.java
示例4: TileEntityRendererDispatcher
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的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: neighborChanged
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
/**
* Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
* change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
* block, etc.
*/
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
{
if (!worldIn.isRemote)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityStructure)
{
TileEntityStructure tileentitystructure = (TileEntityStructure)tileentity;
boolean flag = worldIn.isBlockPowered(pos);
boolean flag1 = tileentitystructure.isPowered();
if (flag && !flag1)
{
tileentitystructure.setPowered(true);
this.trigger(tileentitystructure);
}
else if (!flag && flag1)
{
tileentitystructure.setPowered(false);
}
}
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:BlockStructure.java
示例6: TileEntityRendererDispatcher
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的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
示例7: onReceiveClient
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的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
示例8: neighborChanged
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
/**
* Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
* change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
* block, etc.
*/
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
{
if (!worldIn.isRemote)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityStructure)
{
TileEntityStructure tileentitystructure = (TileEntityStructure)tileentity;
boolean flag = worldIn.isBlockPowered(pos);
boolean flag1 = tileentitystructure.func_189722_G();
if (flag && !flag1)
{
tileentitystructure.func_189723_d(true);
this.func_189874_a(tileentitystructure);
}
else if (!flag && flag1)
{
tileentitystructure.func_189723_d(false);
}
}
}
}
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:30,代码来源:BlockStructure.java
示例9: handleUpdateTileEntity
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的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.theWorld.isBlockLoaded(packetIn.getPos()))
{
TileEntity tileentity = this.gameController.theWorld.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)
{
tileentity.readFromNBT(packetIn.getNbtCompound());
}
else
{
tileentity.onDataPacket(netManager, packetIn);
}
if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
{
((GuiCommandBlock)this.gameController.currentScreen).updateGui();
}
}
}
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:30,代码来源:NetHandlerPlayClient.java
示例10: getDataBlocks
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
public Map<BlockPos, String> getDataBlocks(BlockPos pos, PlacementSettings placementIn)
{
Map<BlockPos, String> map = Maps.<BlockPos, String>newHashMap();
StructureBoundingBox structureboundingbox = placementIn.getBoundingBox();
for (Template.BlockInfo template$blockinfo : this.blocks)
{
BlockPos blockpos = transformedBlockPos(placementIn, template$blockinfo.pos).add(pos);
if (structureboundingbox == null || structureboundingbox.isVecInside(blockpos))
{
IBlockState iblockstate = template$blockinfo.blockState;
if (iblockstate.getBlock() instanceof BlockStructure && template$blockinfo.tileentityData != null)
{
TileEntityStructure.Mode tileentitystructure$mode = TileEntityStructure.Mode.valueOf(template$blockinfo.tileentityData.getString("mode"));
if (tileentitystructure$mode == TileEntityStructure.Mode.DATA)
{
map.put(blockpos, template$blockinfo.tileentityData.getString("metadata"));
}
}
}
}
return map;
}
开发者ID:kenijey,项目名称:harshencastle,代码行数:28,代码来源:HarshenTemplate.java
示例11: openEditStructure
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
@Override
public void openEditStructure(TileEntityStructure structure) {
if (m_realPlayer == null) {
super.openEditStructure(structure);
} else {
syncToRealPlayer();
m_realPlayer.openEditStructure(structure);
syncPublicFieldsFromReal();
}
}
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:11,代码来源:EntityPlayerMPProxy.java
示例12: openEditStructure
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
@Override
public void openEditStructure(TileEntityStructure structure) {
if (m_realPlayer == null) {
super.openEditStructure(structure);
} else {
m_realPlayer.openEditStructure(structure);
}
}
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:9,代码来源:EntityPlayerProxy.java
示例13: getDataBlocks
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
public Map<BlockPos, String> getDataBlocks(BlockPos pos, PlacementSettings placementIn)
{
Map<BlockPos, String> map = Maps.<BlockPos, String>newHashMap();
StructureBoundingBox structureboundingbox = placementIn.getBoundingBox();
for (Template.BlockInfo template$blockinfo : this.blocks)
{
BlockPos blockpos = transformedBlockPos(placementIn, template$blockinfo.pos).add(pos);
if (structureboundingbox == null || structureboundingbox.isVecInside(blockpos))
{
IBlockState iblockstate = template$blockinfo.blockState;
if (iblockstate.getBlock() == Blocks.STRUCTURE_BLOCK && template$blockinfo.tileentityData != null)
{
TileEntityStructure.Mode tileentitystructure$mode = TileEntityStructure.Mode.valueOf(template$blockinfo.tileentityData.getString("mode"));
if (tileentitystructure$mode == TileEntityStructure.Mode.DATA)
{
map.put(blockpos, template$blockinfo.tileentityData.getString("metadata"));
}
}
}
}
return map;
}
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:Template.java
示例14: onBlockPlacedBy
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
/**
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
*/
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
if (!worldIn.isRemote)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityStructure)
{
TileEntityStructure tileentitystructure = (TileEntityStructure)tileentity;
tileentitystructure.createdBy(placer);
}
}
}
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:BlockStructure.java
示例15: trigger
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
private void trigger(TileEntityStructure p_189874_1_)
{
switch (p_189874_1_.getMode())
{
case SAVE:
p_189874_1_.save(false);
break;
case LOAD:
p_189874_1_.load(false);
break;
case CORNER:
p_189874_1_.unloadStructure();
case DATA:
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:BlockStructure.java
示例16: handleUpdateTileEntity
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的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.theWorld.isBlockLoaded(packetIn.getPos()))
{
TileEntity tileentity = this.gameController.theWorld.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)
{
tileentity.readFromNBT(packetIn.getNbtCompound());
}
else
{
if(tileentity == null)
{
LOGGER.error("Received invalid update packet for null tile entity at {} with data: {}", packetIn.getPos(), packetIn.getNbtCompound());
return;
}
tileentity.onDataPacket(netManager, packetIn);
}
if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
{
((GuiCommandBlock)this.gameController.currentScreen).updateGui();
}
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:35,代码来源:NetHandlerPlayClient.java
示例17: onBlockPlacedBy
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
/**
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
*/
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
if (!worldIn.isRemote)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityStructure)
{
TileEntityStructure tileentitystructure = (TileEntityStructure)tileentity;
tileentitystructure.func_189720_a(placer);
}
}
}
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:17,代码来源:BlockStructure.java
示例18: func_189874_a
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
private void func_189874_a(TileEntityStructure p_189874_1_)
{
switch (p_189874_1_.func_189700_k())
{
case SAVE:
p_189874_1_.func_189712_b(false);
break;
case LOAD:
p_189874_1_.func_189714_c(false);
break;
case CORNER:
p_189874_1_.func_189706_E();
case DATA:
}
}
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:16,代码来源:BlockStructure.java
示例19: openEditStructure
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
public void openEditStructure(TileEntityStructure structure)
{
}
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:4,代码来源:EntityPlayer.java
示例20: openEditStructure
import net.minecraft.tileentity.TileEntityStructure; //导入依赖的package包/类
public void openEditStructure(TileEntityStructure structure)
{
this.mc.displayGuiScreen(new GuiEditStructure(structure));
}
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:5,代码来源:EntityPlayerSP.java
注:本文中的net.minecraft.tileentity.TileEntityStructure类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论