本文整理汇总了Java中net.minecraft.world.WorldType.DEBUG_WORLD属性的典型用法代码示例。如果您正苦于以下问题:Java WorldType.DEBUG_WORLD属性的具体用法?Java WorldType.DEBUG_WORLD怎么用?Java WorldType.DEBUG_WORLD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.world.WorldType
的用法示例。
在下文中一共展示了WorldType.DEBUG_WORLD属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getModelFromBlockState
public IBakedModel getModelFromBlockState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
Block block = state.getBlock();
if (worldIn.getWorldType() != WorldType.DEBUG_WORLD)
{
try
{
state = block.getActualState(state, worldIn, pos);
}
catch (Exception var6)
{
;
}
}
IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state);
if (pos != null && this.gameSettings.allowBlockAlternatives && ibakedmodel instanceof WeightedBakedModel)
{
ibakedmodel = ((WeightedBakedModel)ibakedmodel).getAlternativeModel(MathHelper.getPositionRandom(pos));
}
return ibakedmodel;
}
示例2: getBlockState
public IBlockState getBlockState(final BlockPos pos)
{
if (this.worldObj.getWorldType() == WorldType.DEBUG_WORLD)
{
IBlockState iblockstate = null;
if (pos.getY() == 60)
{
iblockstate = Blocks.barrier.getDefaultState();
}
if (pos.getY() == 70)
{
iblockstate = ChunkProviderDebug.func_177461_b(pos.getX(), pos.getZ());
}
return iblockstate == null ? Blocks.air.getDefaultState() : iblockstate;
}
else
{
try
{
if (pos.getY() >= 0 && pos.getY() >> 4 < this.storageArrays.length)
{
ExtendedBlockStorage extendedblockstorage = this.storageArrays[pos.getY() >> 4];
if (extendedblockstorage != null)
{
int j = pos.getX() & 15;
int k = pos.getY() & 15;
int i = pos.getZ() & 15;
return extendedblockstorage.get(j, k, i);
}
}
return Blocks.air.getDefaultState();
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block state");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being got");
crashreportcategory.addCrashSectionCallable("Location", new Callable<String>()
{
public String call() throws Exception
{
return CrashReportCategory.getCoordinateInfo(pos);
}
});
throw new ReportedException(crashreport);
}
}
}
示例3: func_175299_g
private boolean func_175299_g()
{
WorldType worldtype = WorldType.worldTypes[this.selectedIndex];
return worldtype != null && worldtype.getCanBeCreated() ? (worldtype == WorldType.DEBUG_WORLD ? isShiftKeyDown() : true) : false;
}
示例4: showMoreWorldOptions
/**
* Shows additional world-creation options if toggle is true, otherwise shows main world-creation elements
*/
private void showMoreWorldOptions(boolean toggle)
{
this.inMoreWorldOptionsDisplay = toggle;
if (WorldType.WORLD_TYPES[this.selectedIndex] == WorldType.DEBUG_WORLD)
{
this.btnGameMode.visible = !this.inMoreWorldOptionsDisplay;
this.btnGameMode.enabled = false;
if (this.savedGameMode == null)
{
this.savedGameMode = this.gameMode;
}
this.gameMode = "spectator";
this.btnMapFeatures.visible = false;
this.btnBonusItems.visible = false;
this.btnMapType.visible = this.inMoreWorldOptionsDisplay;
this.btnAllowCommands.visible = false;
this.btnCustomizeType.visible = false;
}
else
{
this.btnGameMode.visible = !this.inMoreWorldOptionsDisplay;
this.btnGameMode.enabled = true;
if (this.savedGameMode != null)
{
this.gameMode = this.savedGameMode;
this.savedGameMode = null;
}
this.btnMapFeatures.visible = this.inMoreWorldOptionsDisplay && WorldType.WORLD_TYPES[this.selectedIndex] != WorldType.CUSTOMIZED;
this.btnBonusItems.visible = this.inMoreWorldOptionsDisplay;
this.btnMapType.visible = this.inMoreWorldOptionsDisplay;
this.btnAllowCommands.visible = this.inMoreWorldOptionsDisplay;
this.btnCustomizeType.visible = this.inMoreWorldOptionsDisplay && WorldType.WORLD_TYPES[this.selectedIndex].isCustomizable();
}
this.updateDisplayState();
if (this.inMoreWorldOptionsDisplay)
{
this.btnMoreOptions.displayString = I18n.format("gui.done", new Object[0]);
}
else
{
this.btnMoreOptions.displayString = I18n.format("selectWorld.moreWorldOptions", new Object[0]);
}
}
示例5: getDebugInfoRight
protected List<String> getDebugInfoRight()
{
long i = Runtime.getRuntime().maxMemory();
long j = Runtime.getRuntime().totalMemory();
long k = Runtime.getRuntime().freeMemory();
long l = j - k;
List<String> list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)});
if (this.isReducedDebug())
{
return list;
}
else
{
if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.mc.objectMouseOver.getBlockPos() != null)
{
BlockPos blockpos = this.mc.objectMouseOver.getBlockPos();
IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
if (this.mc.theWorld.getWorldType() != WorldType.DEBUG_WORLD)
{
iblockstate = iblockstate.getBlock().getActualState(iblockstate, this.mc.theWorld, blockpos);
}
list.add("");
list.add(String.valueOf(Block.blockRegistry.getNameForObject(iblockstate.getBlock())));
for (Entry<IProperty, Comparable> entry : iblockstate.getProperties().entrySet())
{
String s = ((Comparable)entry.getValue()).toString();
if (entry.getValue() == Boolean.TRUE)
{
s = EnumChatFormatting.GREEN + s;
}
else if (entry.getValue() == Boolean.FALSE)
{
s = EnumChatFormatting.RED + s;
}
list.add(((IProperty)entry.getKey()).getName() + ": " + s);
}
}
return list;
}
}
示例6: func_146316_a
private void func_146316_a(boolean p_146316_1_)
{
this.field_146344_y = p_146316_1_;
if (WorldType.worldTypes[this.selectedIndex] == WorldType.DEBUG_WORLD)
{
this.btnGameMode.visible = !this.field_146344_y;
this.btnGameMode.enabled = false;
if (this.field_175300_s == null)
{
this.field_175300_s = this.gameMode;
}
this.gameMode = "spectator";
this.btnMapFeatures.visible = false;
this.btnBonusItems.visible = false;
this.btnMapType.visible = this.field_146344_y;
this.btnAllowCommands.visible = false;
this.btnCustomizeType.visible = false;
}
else
{
this.btnGameMode.visible = !this.field_146344_y;
this.btnGameMode.enabled = true;
if (this.field_175300_s != null)
{
this.gameMode = this.field_175300_s;
this.field_175300_s = null;
}
this.btnMapFeatures.visible = this.field_146344_y && WorldType.worldTypes[this.selectedIndex] != WorldType.CUSTOMIZED;
this.btnBonusItems.visible = this.field_146344_y;
this.btnMapType.visible = this.field_146344_y;
this.btnAllowCommands.visible = this.field_146344_y;
this.btnCustomizeType.visible = this.field_146344_y && (WorldType.worldTypes[this.selectedIndex] == WorldType.FLAT || WorldType.worldTypes[this.selectedIndex] == WorldType.CUSTOMIZED);
}
this.func_146319_h();
if (this.field_146344_y)
{
this.btnMoreOptions.displayString = I18n.format("gui.done", new Object[0]);
}
else
{
this.btnMoreOptions.displayString = I18n.format("selectWorld.moreWorldOptions", new Object[0]);
}
}
示例7: getBlockState
public IBlockState getBlockState(final int x, final int y, final int z)
{
if (this.worldObj.getWorldType() == WorldType.DEBUG_WORLD)
{
IBlockState iblockstate = null;
if (y == 60)
{
iblockstate = Blocks.BARRIER.getDefaultState();
}
if (y == 70)
{
iblockstate = ChunkProviderDebug.getBlockStateFor(x, z);
}
return iblockstate == null ? Blocks.AIR.getDefaultState() : iblockstate;
}
else
{
try
{
if (y >= 0 && y >> 4 < this.storageArrays.length)
{
ExtendedBlockStorage extendedblockstorage = this.storageArrays[y >> 4];
if (extendedblockstorage != NULL_BLOCK_STORAGE)
{
return extendedblockstorage.get(x & 15, y & 15, z & 15);
}
}
return Blocks.AIR.getDefaultState();
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block state");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being got");
crashreportcategory.setDetail("Location", new ICrashReportDetail<String>()
{
public String call() throws Exception
{
return CrashReportCategory.getCoordinateInfo(x, y, z);
}
});
throw new ReportedException(crashreport);
}
}
}
示例8: renderBlock
public boolean renderBlock(IBlockState state, BlockPos pos, IBlockAccess blockAccess, VertexBuffer worldRendererIn)
{
try
{
EnumBlockRenderType enumblockrendertype = state.getRenderType();
if (enumblockrendertype == EnumBlockRenderType.INVISIBLE)
{
return false;
}
else
{
if (blockAccess.getWorldType() != WorldType.DEBUG_WORLD)
{
try
{
state = state.getActualState(blockAccess, pos);
}
catch (Exception var8)
{
;
}
}
switch (enumblockrendertype)
{
case MODEL:
return this.blockModelRenderer.renderModel(blockAccess, this.getModelForState(state), state, pos, worldRendererIn, true);
case ENTITYBLOCK_ANIMATED:
return false;
case LIQUID:
return this.fluidRenderer.renderFluid(blockAccess, state, pos, worldRendererIn);
default:
return false;
}
}
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block in world");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being tesselated");
CrashReportCategory.addBlockInfo(crashreportcategory, pos, state.getBlock(), state.getBlock().getMetaFromState(state));
throw new ReportedException(crashreport);
}
}
示例9: canSelectCurWorldType
/**
* Returns whether the currently-selected world type is actually acceptable for selection
* Used to hide the "debug" world type unless the shift key is depressed.
*/
private boolean canSelectCurWorldType()
{
WorldType worldtype = WorldType.WORLD_TYPES[this.selectedIndex];
return worldtype != null && worldtype.getCanBeCreated() ? (worldtype == WorldType.DEBUG_WORLD ? isShiftKeyDown() : true) : false;
}
示例10: getDebugInfoRight
protected <T extends Comparable<T>> List<String> getDebugInfoRight()
{
long i = Runtime.getRuntime().maxMemory();
long j = Runtime.getRuntime().totalMemory();
long k = Runtime.getRuntime().freeMemory();
long l = j - k;
List<String> list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.getCpu()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GlStateManager.glGetString(7936)}), GlStateManager.glGetString(7937), GlStateManager.glGetString(7938)});
list.add("");
list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false));
if (this.mc.isReducedDebug())
{
return list;
}
else
{
if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == RayTraceResult.Type.BLOCK && this.mc.objectMouseOver.getBlockPos() != null)
{
BlockPos blockpos = this.mc.objectMouseOver.getBlockPos();
IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
if (this.mc.theWorld.getWorldType() != WorldType.DEBUG_WORLD)
{
iblockstate = iblockstate.getActualState(this.mc.theWorld, blockpos);
}
list.add("");
list.add(String.valueOf(Block.REGISTRY.getNameForObject(iblockstate.getBlock())));
for (Entry < IProperty<?>, Comparable<? >> entry : iblockstate.getProperties().entrySet())
{
IProperty<T> iproperty = (IProperty)entry.getKey();
T t = (T)entry.getValue();
String s = iproperty.getName(t);
if (Boolean.TRUE.equals(t))
{
s = TextFormatting.GREEN + s;
}
else if (Boolean.FALSE.equals(t))
{
s = TextFormatting.RED + s;
}
list.add(iproperty.getName() + ": " + s);
}
}
return list;
}
}
示例11: renderBlock
public boolean renderBlock(IBlockState state, BlockPos pos, IBlockAccess blockAccess, VertexBuffer worldRendererIn)
{
try
{
EnumBlockRenderType enumblockrendertype = state.getRenderType();
if (enumblockrendertype == EnumBlockRenderType.INVISIBLE)
{
return false;
}
else
{
if (blockAccess.getWorldType() != WorldType.DEBUG_WORLD)
{
try
{
state = state.getActualState(blockAccess, pos);
}
catch (Exception var8)
{
;
}
}
switch (enumblockrendertype)
{
case MODEL:
IBakedModel model = this.getModelForState(state);
state = state.getBlock().getExtendedState(state, blockAccess, pos);
return this.blockModelRenderer.renderModel(blockAccess, model, state, pos, worldRendererIn, true);
case ENTITYBLOCK_ANIMATED:
return false;
case LIQUID:
return this.fluidRenderer.renderFluid(blockAccess, state, pos, worldRendererIn);
default:
return false;
}
}
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block in world");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being tesselated");
CrashReportCategory.addBlockInfo(crashreportcategory, pos, state.getBlock(), state.getBlock().getMetaFromState(state));
throw new ReportedException(crashreport);
}
}