本文整理汇总了Java中net.minecraftforge.common.ForgeModContainer类的典型用法代码示例。如果您正苦于以下问题:Java ForgeModContainer类的具体用法?Java ForgeModContainer怎么用?Java ForgeModContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ForgeModContainer类属于net.minecraftforge.common包,在下文中一共展示了ForgeModContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFluid
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
@Nullable
public FluidStack getFluid()
{
Item item = container.getItem();
if (item == Items.WATER_BUCKET)
{
return new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME);
}
else if (item == Items.LAVA_BUCKET)
{
return new FluidStack(FluidRegistry.LAVA, Fluid.BUCKET_VOLUME);
}
else if (item == Items.MILK_BUCKET)
{
return FluidRegistry.getFluidStack("milk", Fluid.BUCKET_VOLUME);
}
else if (item == ForgeModContainer.getInstance().universalBucket)
{
return ForgeModContainer.getInstance().universalBucket.getFluid(container);
}
else
{
return null;
}
}
示例2: setFluid
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
protected void setFluid(Fluid fluid) {
if (fluid == null)
{
container.deserializeNBT(new ItemStack(Items.BUCKET).serializeNBT());
}
else if (fluid == FluidRegistry.WATER)
{
container.deserializeNBT(new ItemStack(Items.WATER_BUCKET).serializeNBT());
}
else if (fluid == FluidRegistry.LAVA)
{
container.deserializeNBT(new ItemStack(Items.LAVA_BUCKET).serializeNBT());
}
else if (fluid.getName().equals("milk"))
{
container.deserializeNBT(new ItemStack(Items.MILK_BUCKET).serializeNBT());
}
else if (FluidRegistry.isUniversalBucketEnabled() && FluidRegistry.getBucketFluids().contains(fluid))
{
ItemStack filledBucket = UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, fluid);
container.deserializeNBT(filledBucket.serializeNBT());
}
}
示例3: renderModelFlat
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
@Override
public boolean renderModelFlat(IBlockAccess world, IBakedModel model, IBlockState state, BlockPos pos, VertexBuffer buffer, boolean checkSides, long rand)
{
if(ForgeModContainer.forgeLightPipelineEnabled)
{
if(buffer != lastRendererFlat.get())
{
lastRendererFlat.set(buffer);
VertexBufferConsumer newCons = new VertexBufferConsumer(buffer);
wrFlat.set(newCons);
lighterFlat.get().setParent(newCons);
}
wrFlat.get().setOffset(pos);
return render(lighterFlat.get(), world, model, state, pos, buffer, checkSides, rand);
}
else
{
return super.renderModelFlat(world, model, state, pos, buffer, checkSides, rand);
}
}
示例4: renderModelSmooth
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
@Override
public boolean renderModelSmooth(IBlockAccess world, IBakedModel model, IBlockState state, BlockPos pos, VertexBuffer buffer, boolean checkSides, long rand)
{
if(ForgeModContainer.forgeLightPipelineEnabled)
{
if(buffer != lastRendererSmooth.get())
{
lastRendererSmooth.set(buffer);
VertexBufferConsumer newCons = new VertexBufferConsumer(buffer);
wrSmooth.set(newCons);
lighterSmooth.get().setParent(newCons);
}
wrSmooth.get().setOffset(pos);
return render(lighterSmooth.get(), world, model, state, pos, buffer, checkSides, rand);
}
else
{
return super.renderModelSmooth(world, model, state, pos, buffer, checkSides, rand);
}
}
示例5: drawScreen
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
/**
* Draws the screen and all the components in it.
*/
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
if (showNotification == null || !showNotification.shouldDraw() || ForgeModContainer.disableVersionCheck)
{
return;
}
Minecraft.getMinecraft().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
GlStateManager.color(1, 1, 1, 1);
GlStateManager.pushMatrix();
int x = modButton.xPosition;
int y = modButton.yPosition;
int w = modButton.width;
int h = modButton.height;
drawModalRectWithCustomSizedTexture(x + w - (h / 2 + 4), y + (h / 2 - 4), showNotification.getSheetOffset() * 8, (showNotification.isAnimated() && ((System.currentTimeMillis() / 800 & 1) == 1)) ? 8 : 0, 8, 8, 64, 16);
GlStateManager.popMatrix();
}
示例6: setBlock
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
public Fluid setBlock(Block block)
{
if (this.block == null || this.block == block)
{
this.block = block;
}
else if (!ForgeModContainer.forceDuplicateFluidBlockCrash)
{
FMLLog.warning("A mod has attempted to assign Block " + block + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to BlockID "
+ this.block + ". Configure your mods to prevent this from happening.");
}
else
{
FMLLog.severe("A mod has attempted to assign BlockID " + block + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to BlockID "
+ this.block + ". Configure your mods to prevent this from happening.");
throw new LoaderException(new RuntimeException("A mod has attempted to assign BlockID " + block + " to the Fluid '" + fluidName
+ "' but this Fluid has already been linked to BlockID " + this.block + ". Configure your mods to prevent this from happening."));
}
return this;
}
示例7: createDisplay
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
public static void createDisplay() throws LWJGLException
{
ImageIO.setUseCache(false); //Disable on-disc stream cache should speed up texture pack reloading.
PixelFormat format = new PixelFormat().withDepthBits(24);
if (!ForgeModContainer.enableStencilBits || Boolean.parseBoolean(System.getProperty("forge.forceNoStencil", "false")))
{
Display.create(format);
stencilBits = 0;
return;
}
try
{
//TODO: Figure out how to determine the max bits.
Display.create(format.withStencilBits(8));
stencilBits = 8;
}
catch(LWJGLException e)
{
Display.create(format);
stencilBits = 0;
}
}
示例8: init
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
public void init()
{
MinecraftForge.EVENT_BUS.register(new NetworkHandler());
PlayerHandlers.PlayerSleepHandler sleepHandler = new PlayerHandlers.PlayerSleepHandler();
PlayerHandlers.PlayerRespawnHandler respawnHandler = new PlayerHandlers.PlayerRespawnHandler();
MinecraftForge.EVENT_BUS.register(sleepHandler);
MinecraftForge.EVENT_BUS.register(respawnHandler);
MinecraftForge.EVENT_BUS.register(new EntityHandlers.EnderPearlHandler());
MinecraftForge.EVENT_BUS.register(new EntityHandlers.LivingAttackHandler());
MinecraftForge.EVENT_BUS.register(new EntityHandlers.MobHandler());
MinecraftForge.EVENT_BUS.register(new EntityHandlers.LivingHurtHandler());
MinecraftForge.EVENT_BUS.register(new WorldHandlers.ExplosionHandler());
MinecraftForge.EVENT_BUS.register(new WorldHandlers.WorldPotentialSpawnsHandler());
InitMobRegistry.init();
InitLightLevels.tweakLightValues();
if (!Settings.enableSpawnFuzz[1])
{
ForgeModContainer.defaultHasSpawnFuzz = false;
}
}
示例9: applyEntityAttributes
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513D);
getAttributeMap().registerAttribute(spawnReinforcementsAttribute).setBaseValue(rand.nextDouble() * ForgeModContainer.zombieSummonBaseChance);
if(ACConfig.hardcoreMode){
getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(80.0D);
getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D);
} else {
getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(40.0D);
getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D);
}
}
示例10: init
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
public static void init(){
if(initDone) return;
FuelRegistry.getInstance().registerFuel(cyano.basemetals.init.Items.carbon_powder,(short)1600);
ItemStack bucket = new ItemStack(ForgeModContainer.getInstance().universalBucket);
FuelRegistry.getInstance().registerFuel(ForgeModContainer.getInstance().universalBucket,(ItemStack ub)->{
if(ub.getItem() instanceof UniversalBucket){
UniversalBucket ubItem = (UniversalBucket) ub.getItem();
FluidStack fs = ubItem.getFluid(ub);
if (fs != null && fs.amount > 0){
if(fs.getFluid() == Fluids.crude_oil) return (short)(fs.amount * CRUDE_OIL_FUEL_PER_FLUID_UNIT);
if(fs.getFluid() == Fluids.refined_oil) return (short)(fs.amount * REFINED_OIL_FUEL_PER_FLUID_UNIT);
}
}
return (short)0;
});
FuelRegistry.getInstance().registerPostBurnItem(ForgeModContainer.getInstance().universalBucket,(ItemStack sb)->new ItemStack(net.minecraft.init.Items.BUCKET));
initDone = true;
}
示例11: init
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
public static void init() {
liquidMana = registerFluid(liquidMana);
liquidWaterSource = registerFluid(liquidWaterSource);
liquidGrass = registerFluid(liquidGrass);
liquidFire = registerFluid(liquidFire);
FluidRegistry.addBucketForFluid(liquidMana);
FluidRegistry.addBucketForFluid(liquidWaterSource);
FluidRegistry.addBucketForFluid(liquidGrass);
FluidRegistry.addBucketForFluid(liquidFire);
bucketMana = UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, liquidMana);
bucketFire = UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, liquidFire);
bucketGrass = UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, liquidGrass);
bucketWaterSource = UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, liquidWaterSource);
bucketMana.getItem().setCreativeTab(powerofmagic.tabpowerofmagic);
bucketFire.getItem().setCreativeTab(powerofmagic.tabpowerofmagic);
bucketGrass.getItem().setCreativeTab(powerofmagic.tabpowerofmagic);
bucketWaterSource.getItem().setCreativeTab(powerofmagic.tabpowerofmagic);
}
示例12: onEnabled
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
@Override
public void onEnabled() {
previousForgeLightPipelineEnabled = ForgeModContainer.forgeLightPipelineEnabled;
ForgeModContainer.forgeLightPipelineEnabled = false;
ForgeHaxHooks.COLOR_MULTIPLIER_ALPHA = (this.opacity.getAsFloat() / 255.f);
ForgeHaxHooks.SHOULD_UPDATE_ALPHA = true;
reloadChunks();
ForgeHaxHooks.SHOULD_DISABLE_CAVE_CULLING.enable();
}
示例13: onDisabled
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
@Override
public void onDisabled() {
ForgeModContainer.forgeLightPipelineEnabled = previousForgeLightPipelineEnabled;
ForgeHaxHooks.SHOULD_UPDATE_ALPHA = false;
reloadChunks();
ForgeHaxHooks.SHOULD_DISABLE_CAVE_CULLING.disable();
}
示例14: buildChildScreen
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
@Override
protected GuiScreen buildChildScreen()
{
// This GuiConfig object specifies the configID of the object and as such will force-save when it is closed. The parent
// GuiConfig object's entryList will also be refreshed to reflect the changes.
return new GuiConfig(this.owningScreen,
(new ConfigElement(ForgeModContainer.getConfig().getCategory(Configuration.CATEGORY_GENERAL))).getChildElements(),
this.owningScreen.modID, Configuration.CATEGORY_GENERAL, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,
GuiConfig.getAbridgedConfigPath(ForgeModContainer.getConfig().toString()));
}
示例15: registerChannel
import net.minecraftforge.common.ForgeModContainer; //导入依赖的package包/类
public static void registerChannel(ForgeModContainer forgeModContainer, Side side)
{
channelPair = NetworkRegistry.INSTANCE.newChannel(forgeModContainer, "FORGE", new ForgeRuntimeCodec());
if (side == Side.CLIENT)
{
addClientHandlers();
}
FMLEmbeddedChannel serverChannel = channelPair.get(Side.SERVER);
serverChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.NOWHERE);
String handlerName = serverChannel.findChannelHandlerNameForType(ForgeRuntimeCodec.class);
serverChannel.pipeline().addAfter(handlerName, "ServerToClientConnection", new ServerToClientConnectionEstablishedHandler());
}