本文整理汇总了Java中net.minecraft.world.WorldProviderSurface类的典型用法代码示例。如果您正苦于以下问题:Java WorldProviderSurface类的具体用法?Java WorldProviderSurface怎么用?Java WorldProviderSurface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WorldProviderSurface类属于net.minecraft.world包,在下文中一共展示了WorldProviderSurface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleChunkData
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
/**
* Updates the specified chunk with the supplied data, marks it for re-rendering and lighting recalculation
*/
public void handleChunkData(S21PacketChunkData packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (packetIn.func_149274_i())
{
if (packetIn.getExtractedSize() == 0)
{
this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), false);
return;
}
this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), true);
}
this.clientWorldController.invalidateBlockReceiveRegion(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15);
Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(packetIn.getChunkX(), packetIn.getChunkZ());
chunk.fillChunk(packetIn.func_149272_d(), packetIn.getExtractedSize(), packetIn.func_149274_i());
this.clientWorldController.markBlockRangeForRenderUpdate(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15);
if (!packetIn.func_149274_i() || !(this.clientWorldController.provider instanceof WorldProviderSurface))
{
chunk.resetRelightChecks();
}
}
示例2: handleMapChunkBulk
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
public void handleMapChunkBulk(S26PacketMapChunkBulk packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
for (int i = 0; i < packetIn.getChunkCount(); ++i)
{
int j = packetIn.getChunkX(i);
int k = packetIn.getChunkZ(i);
this.clientWorldController.doPreChunk(j, k, true);
this.clientWorldController.invalidateBlockReceiveRegion(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);
Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(j, k);
chunk.fillChunk(packetIn.getChunkBytes(i), packetIn.getChunkSize(i), true);
this.clientWorldController.markBlockRangeForRenderUpdate(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);
if (!(this.clientWorldController.provider instanceof WorldProviderSurface))
{
chunk.resetRelightChecks();
}
}
}
示例3: handleChunkData
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
/**
* Updates the specified chunk with the supplied data, marks it for re-rendering
* and lighting recalculation
*/
public void handleChunkData(S21PacketChunkData packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (packetIn.func_149274_i()) {
if (packetIn.getExtractedSize() == 0) {
this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), false);
return;
}
this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), true);
}
this.clientWorldController.invalidateBlockReceiveRegion(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4,
(packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15);
Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(packetIn.getChunkX(), packetIn.getChunkZ());
chunk.fillChunk(packetIn.func_149272_d(), packetIn.getExtractedSize(), packetIn.func_149274_i());
this.clientWorldController.markBlockRangeForRenderUpdate(packetIn.getChunkX() << 4, 0,
packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15);
if (!packetIn.func_149274_i() || !(this.clientWorldController.provider instanceof WorldProviderSurface)) {
chunk.resetRelightChecks();
}
}
示例4: handleMapChunkBulk
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
public void handleMapChunkBulk(S26PacketMapChunkBulk packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
for (int i = 0; i < packetIn.getChunkCount(); ++i) {
int j = packetIn.getChunkX(i);
int k = packetIn.getChunkZ(i);
this.clientWorldController.doPreChunk(j, k, true);
this.clientWorldController.invalidateBlockReceiveRegion(j << 4, 0, k << 4, (j << 4) + 15, 256,
(k << 4) + 15);
Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(j, k);
chunk.fillChunk(packetIn.getChunkBytes(i), packetIn.getChunkSize(i), true);
this.clientWorldController.markBlockRangeForRenderUpdate(j << 4, 0, k << 4, (j << 4) + 15, 256,
(k << 4) + 15);
if (!(this.clientWorldController.provider instanceof WorldProviderSurface)) {
chunk.resetRelightChecks();
}
}
}
示例5: init
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
public static void init()
{
if (hasInit)
{
return;
}
hasInit = true;
registerProviderType( 0, WorldProviderSurface.class, true);
registerProviderType(-1, WorldProviderHell.class, true);
registerProviderType( 1, WorldProviderEnd.class, false);
registerDimension( 0, 0);
registerDimension(-1, -1);
registerDimension( 1, 1);
}
示例6: onReceiveClient
import net.minecraft.world.WorldProviderSurface; //导入依赖的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) {
BlockSystemClient clientSystem = (BlockSystemClient) blockSystem;
if (this.loadChunk) {
clientSystem.loadChunkAction(this.x, this.z, true);
}
BlockSystemChunk chunk = (BlockSystemChunk) clientSystem.getChunkFromChunkCoords(this.x, this.z);
chunk.setPartitionPosition(this.partitionPosition);
chunk.fillChunk(this.getReadBuffer(), this.availableSections, this.loadChunk);
clientSystem.markBlockRangeForRenderUpdate(this.x << 4, 0, this.z << 4, (this.x << 4) + 15, 256, (this.z << 4) + 15);
if (!this.loadChunk || !(clientSystem.provider instanceof WorldProviderSurface)) {
chunk.resetRelightChecks();
}
for (NBTTagCompound tag : this.tileEntityTags) {
BlockPos pos = new BlockPos(tag.getInteger("x"), tag.getInteger("y"), tag.getInteger("z"));
TileEntity tile = clientSystem.getTileEntity(pos);
if (tile != null) {
tile.handleUpdateTag(tag);
}
}
}
}
示例7: placeInExistingPortal
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
@Override
public boolean placeInExistingPortal(Entity entity, float f) {
if (entity instanceof EntityPlayerMP) {
EntityPlayerMP player = (EntityPlayerMP)entity;
if(world.provider instanceof WorldProviderSurface){
int x, y, z;
BlockPos pos = player.getBedLocation(0);
if(pos == null){
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
WorldServer overworld = server.worldServerForDimension(0);
x = overworld.getSpawnPoint().getX();
y = overworld.getTopSolidOrLiquidBlock(overworld.getSpawnPoint()).getY();
z = overworld.getSpawnPoint().getZ();
}else{
x = pos.getX();
y = pos.getY();
z = pos.getZ();
}
player.setPosition(x, y, z);
}else{
player.setPosition(75.5d, 63d, 75.5d);
}
return true;
}
return false;
}
示例8: handleChunkData
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
/**
* Updates the specified chunk with the supplied data, marks it for re-rendering and lighting recalculation
*/
public void handleChunkData(S21PacketChunkData p_147263_1_)
{
if (p_147263_1_.func_149274_i())
{
if (p_147263_1_.func_149276_g() == 0)
{
this.clientWorldController.doPreChunk(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f(), false);
return;
}
this.clientWorldController.doPreChunk(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f(), true);
}
this.clientWorldController.invalidateBlockReceiveRegion(p_147263_1_.func_149273_e() << 4, 0, p_147263_1_.func_149271_f() << 4, (p_147263_1_.func_149273_e() << 4) + 15, 256, (p_147263_1_.func_149271_f() << 4) + 15);
Chunk var2 = this.clientWorldController.getChunkFromChunkCoords(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f());
var2.fillChunk(p_147263_1_.func_149272_d(), p_147263_1_.func_149276_g(), p_147263_1_.func_149270_h(), p_147263_1_.func_149274_i());
this.clientWorldController.markBlockRangeForRenderUpdate(p_147263_1_.func_149273_e() << 4, 0, p_147263_1_.func_149271_f() << 4, (p_147263_1_.func_149273_e() << 4) + 15, 256, (p_147263_1_.func_149271_f() << 4) + 15);
if (!p_147263_1_.func_149274_i() || !(this.clientWorldController.provider instanceof WorldProviderSurface))
{
var2.resetRelightChecks();
}
}
示例9: handleMapChunkBulk
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
public void handleMapChunkBulk(S26PacketMapChunkBulk p_147269_1_)
{
for (int var2 = 0; var2 < p_147269_1_.func_149254_d(); ++var2)
{
int var3 = p_147269_1_.func_149255_a(var2);
int var4 = p_147269_1_.func_149253_b(var2);
this.clientWorldController.doPreChunk(var3, var4, true);
this.clientWorldController.invalidateBlockReceiveRegion(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15);
Chunk var5 = this.clientWorldController.getChunkFromChunkCoords(var3, var4);
var5.fillChunk(p_147269_1_.func_149256_c(var2), p_147269_1_.func_149252_e()[var2], p_147269_1_.func_149257_f()[var2], true);
this.clientWorldController.markBlockRangeForRenderUpdate(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15);
if (!(this.clientWorldController.provider instanceof WorldProviderSurface))
{
var5.resetRelightChecks();
}
}
}
示例10: handleChunkData
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
public void handleChunkData(S21PacketChunkData p_147263_1_)
{
if (p_147263_1_.func_149274_i())
{
if (p_147263_1_.func_149276_g() == 0)
{
this.clientWorldController.doPreChunk(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f(), false);
return;
}
this.clientWorldController.doPreChunk(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f(), true);
}
this.clientWorldController.invalidateBlockReceiveRegion(p_147263_1_.func_149273_e() << 4, 0, p_147263_1_.func_149271_f() << 4, (p_147263_1_.func_149273_e() << 4) + 15, 256, (p_147263_1_.func_149271_f() << 4) + 15);
Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f());
chunk.fillChunk(p_147263_1_.func_149272_d(), p_147263_1_.func_149276_g(), p_147263_1_.func_149270_h(), p_147263_1_.func_149274_i());
this.clientWorldController.markBlockRangeForRenderUpdate(p_147263_1_.func_149273_e() << 4, 0, p_147263_1_.func_149271_f() << 4, (p_147263_1_.func_149273_e() << 4) + 15, 256, (p_147263_1_.func_149271_f() << 4) + 15);
if (!p_147263_1_.func_149274_i() || !(this.clientWorldController.provider instanceof WorldProviderSurface))
{
chunk.resetRelightChecks();
}
}
示例11: handleMapChunkBulk
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
public void handleMapChunkBulk(S26PacketMapChunkBulk p_147269_1_)
{
for (int i = 0; i < p_147269_1_.func_149254_d(); ++i)
{
int j = p_147269_1_.func_149255_a(i);
int k = p_147269_1_.func_149253_b(i);
this.clientWorldController.doPreChunk(j, k, true);
this.clientWorldController.invalidateBlockReceiveRegion(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);
Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(j, k);
chunk.fillChunk(p_147269_1_.func_149256_c(i), p_147269_1_.func_149252_e()[i], p_147269_1_.func_149257_f()[i], true);
this.clientWorldController.markBlockRangeForRenderUpdate(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);
if (!(this.clientWorldController.provider instanceof WorldProviderSurface))
{
chunk.resetRelightChecks();
}
}
}
示例12: getProvider
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
/**
* Returns a provider with the specified id.
* @param id
* @return
*/
public static final WorldProvider getProvider(int id)
{
try
{
return providerMap.get(id).newInstance();
}
catch (IllegalAccessException | InstantiationException e)
{
e.printStackTrace();
if (e instanceof IllegalAccessException)
{
NAPILogHelper.instance.logError("If your provider has a constructor, make it public!");
}
if (e instanceof InstantiationException)
{
NAPILogHelper.instance.logError("Please make sure your provider is NOT abstract and that your constructor does not take any args!");
}
//Default to avoid nasty errors Minecraft side.
return new WorldProviderSurface();
}
}
示例13: func_72463_a
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
public void func_72463_a(Packet51MapChunk p_72463_1_) {
if(p_72463_1_.field_73598_e) {
if(p_72463_1_.field_73600_c == 0) {
this.field_72564_i.func_73025_a(p_72463_1_.field_73601_a, p_72463_1_.field_73599_b, false);
return;
}
this.field_72564_i.func_73025_a(p_72463_1_.field_73601_a, p_72463_1_.field_73599_b, true);
}
this.field_72564_i.func_73031_a(p_72463_1_.field_73601_a << 4, 0, p_72463_1_.field_73599_b << 4, (p_72463_1_.field_73601_a << 4) + 15, 256, (p_72463_1_.field_73599_b << 4) + 15);
Chunk var2 = this.field_72564_i.func_72964_e(p_72463_1_.field_73601_a, p_72463_1_.field_73599_b);
if(p_72463_1_.field_73598_e && var2 == null) {
this.field_72564_i.func_73025_a(p_72463_1_.field_73601_a, p_72463_1_.field_73599_b, true);
var2 = this.field_72564_i.func_72964_e(p_72463_1_.field_73601_a, p_72463_1_.field_73599_b);
}
if(var2 != null) {
var2.func_76607_a(p_72463_1_.func_73593_d(), p_72463_1_.field_73600_c, p_72463_1_.field_73597_d, p_72463_1_.field_73598_e);
this.field_72564_i.func_72909_d(p_72463_1_.field_73601_a << 4, 0, p_72463_1_.field_73599_b << 4, (p_72463_1_.field_73601_a << 4) + 15, 256, (p_72463_1_.field_73599_b << 4) + 15);
if(!p_72463_1_.field_73598_e || !(this.field_72564_i.field_73011_w instanceof WorldProviderSurface)) {
var2.func_76613_n();
}
}
}
示例14: func_72453_a
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
public void func_72453_a(Packet56MapChunks p_72453_1_) {
for(int var2 = 0; var2 < p_72453_1_.func_73581_d(); ++var2) {
int var3 = p_72453_1_.func_73582_a(var2);
int var4 = p_72453_1_.func_73580_b(var2);
this.field_72564_i.func_73025_a(var3, var4, true);
this.field_72564_i.func_73031_a(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15);
Chunk var5 = this.field_72564_i.func_72964_e(var3, var4);
if(var5 == null) {
this.field_72564_i.func_73025_a(var3, var4, true);
var5 = this.field_72564_i.func_72964_e(var3, var4);
}
if(var5 != null) {
var5.func_76607_a(p_72453_1_.func_73583_c(var2), p_72453_1_.field_73590_a[var2], p_72453_1_.field_73588_b[var2], true);
this.field_72564_i.func_72909_d(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15);
if(!(this.field_72564_i.field_73011_w instanceof WorldProviderSurface)) {
var5.func_76613_n();
}
}
}
}
示例15: handleChunkData
import net.minecraft.world.WorldProviderSurface; //导入依赖的package包/类
/**
* Updates the specified chunk with the supplied data, marks it for re-rendering and lighting recalculation
*/
public void handleChunkData(SPacketChunkData packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (packetIn.doChunkLoad())
{
this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), true);
}
this.clientWorldController.invalidateBlockReceiveRegion(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15);
Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(packetIn.getChunkX(), packetIn.getChunkZ());
chunk.fillChunk(packetIn.getReadBuffer(), packetIn.getExtractedSize(), packetIn.doChunkLoad());
this.clientWorldController.markBlockRangeForRenderUpdate(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15);
if (!packetIn.doChunkLoad() || !(this.clientWorldController.provider instanceof WorldProviderSurface))
{
chunk.resetRelightChecks();
}
for (NBTTagCompound nbttagcompound : packetIn.getTileEntityTags())
{
BlockPos blockpos = new BlockPos(nbttagcompound.getInteger("x"), nbttagcompound.getInteger("y"), nbttagcompound.getInteger("z"));
TileEntity tileentity = this.clientWorldController.getTileEntity(blockpos);
if (tileentity != null)
{
tileentity.readFromNBT(nbttagcompound);
}
}
}