本文整理汇总了Java中info.jbcs.minecraft.utilities.General类的典型用法代码示例。如果您正苦于以下问题:Java General类的具体用法?Java General怎么用?Java General使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
General类属于info.jbcs.minecraft.utilities包,在下文中一共展示了General类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EntityHolystoneFX
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z) {
super(world, x, y, z, 0, 0, 0);
// particleScale = 1.0f + 1.0f * General.rand.nextFloat();
// particleScale = 1.0f;
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
angleOffset = rand.nextFloat() * 360;
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
setPosition(x, y, z);
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
noClip = true;
setParticleIcon(block.iconStar);
}
示例2: addInformation
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) {
if(! Chisel.blockDescriptions) return;
Item item=General.getItem(stack);
if(item==null) return;
Block block = Block.getBlockFromItem(this);
if(! (block instanceof Carvable)) return;
Carvable carvable=(Carvable) block;
CarvableVariation var=carvable.getVariation(stack.getItemDamage());
if(var==null) return;
lines.add(var.description);
}
示例3: EntityHolystoneFX
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z) {
super(world, x, y, z, 0, 0, 0);
// particleScale = 1.0f + 1.0f * General.rand.nextFloat();
// particleScale = 1.0f;
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
angleOffset = rand.nextFloat() * 360;
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
setPosition(x, y, z);
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
noClip = true;
setParticleIcon(block.iconStar);
}
示例4: updateItems
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
public void updateItems() {
ItemStack chiseledItem = items[normalSlots];
clearItems();
if (chiseledItem == null || chiseledItem.itemID < 0 || chiseledItem.itemID >= Item.itemsList.length) {
container.onChiselSlotChanged();
return;
}
if (chiseledItem.itemID >= Block.blocksList.length)
return;
Item item = General.getItem(chiseledItem);
if (item == null) return;
ArrayList<ItemStack> list = container.carvingRegistry.getItems(chiseledItem);
activeVariations = 0;
while (activeVariations < normalSlots && activeVariations < list.size()) {
items[activeVariations] = list.get(activeVariations);
activeVariations++;
}
container.onChiselSlotChanged();
}
示例5: addInformation
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) {
if (!Chisel.blockDescriptions) return;
Item item = General.getItem(stack);
if (item == null) return;
Block block = General.getBlock(item.itemID);
if (!(block instanceof Carvable)) return;
Carvable carvable = (Carvable) block;
RenderVariation var = carvable.getVariation(stack.getItemDamage());
if (var == null) return;
lines.add(LangUtil.translateG(var.description));
}
示例6: EntitySnakestoneObsidianFX
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
public EntitySnakestoneObsidianFX(World world, BlockSnakestoneObsidian b, int x, int y, int z) {
super(world, x + 0.5, y + 0.5, z + 0.5, 0, 0, 0);
block = b;
particleScale = 0.5f + 0.5f*General.rand.nextFloat();
speed=0.04+0.04*General.rand.nextDouble();
//speed = 0;
// motionX = 0;
// motionY = 0;
// motionZ = 0;
particleMaxAge = (int) (Math.random() * 10.0D) + 40;
tx = x + General.rand.nextDouble();
ty = y + General.rand.nextDouble();
tz = z + General.rand.nextDouble();
switch(General.rand.nextInt(6)){
case 0: tx=x; break;
case 1: tx=x+1; break;
case 2: ty=y; break;
case 3: ty=y+1; break;
case 4: tz=z; break;
case 5: tz=z+1; break;
}
double dx=(tx-posX)*3;
double dy=(ty-posY)*3;
double dz=(tz-posZ)*3;
setPosition(posX + dx, posY + dy, posZ + dz);
prevPosX=posX;
prevPosY=posY;
prevPosZ=posZ;
noClip = true;
setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
}
示例7: EntityBallOMossFX
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
public EntityBallOMossFX(World world, double x, double y, double z) {
super(world, x, y+0.5, z, 0, 0, 0);
particleScale = 0.5f + 0.5f*General.rand.nextFloat();
speed=0.4+0.4*General.rand.nextDouble();
particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5;
if(General.rand.nextInt(10)==0)
particleMaxAge+=General.rand.nextDouble()*40.0;
motionX=(General.rand.nextDouble()-0.5)*0.7;
motionY=(General.rand.nextDouble()*0.5)*0.7;
motionZ=(General.rand.nextDouble()-0.5)*0.7;
particleGravity=2.0f;
// setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
icon=Chisel.itemBallOMoss.getIconFromDamage(0);
float width=4.0f+General.rand.nextFloat()*8.0f;
float uu=General.rand.nextFloat()*(16.0f-width);
float vv=General.rand.nextFloat()*(16.0f-width);
u0=icon.getInterpolatedU(uu);
u1=icon.getInterpolatedU(uu+width);
v0=icon.getInterpolatedV(vv);
v1=icon.getInterpolatedV(vv+width);
setParticleIcon(iconPlus);
}
示例8: EntityBallOMossFX
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
public EntityBallOMossFX(World world, double x, double y, double z) {
super(world, x, y + 0.5, z, 0, 0, 0);
particleScale = 0.5f + 0.5f * General.rand.nextFloat();
speed = 0.4 + 0.4 * General.rand.nextDouble();
particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5;
if (General.rand.nextInt(10) == 0)
particleMaxAge += General.rand.nextDouble() * 40.0;
motionX = (General.rand.nextDouble() - 0.5) * 0.7;
motionY = (General.rand.nextDouble() * 0.5) * 0.7;
motionZ = (General.rand.nextDouble() - 0.5) * 0.7;
particleGravity = 2.0f;
// setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
icon = Chisel.itemBallOMoss.getIconFromDamage(0);
float width = 4.0f + General.rand.nextFloat() * 8.0f;
float uu = General.rand.nextFloat() * (16.0f - width);
float vv = General.rand.nextFloat() * (16.0f - width);
u0 = icon.getInterpolatedU(uu);
u1 = icon.getInterpolatedU(uu + width);
v0 = icon.getInterpolatedV(vv);
v1 = icon.getInterpolatedV(vv + width);
setParticleIcon(iconPlus);
}
示例9: getBlock
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
int getBlock(Block block, int id) {
if (disableOverriding || !overrideVanillaBlocks)
return config.getBlock(General.getUnlocalizedName(block), id)
.getInt(id);
Block.blocksList[block.blockID] = null;
return block.blockID;
}
示例10: getBlockForce
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
int getBlockForce(Block block, int id) {
if (disableOverriding)
return config.getBlock(General.getUnlocalizedName(block), id)
.getInt(id);
Block.blocksList[block.blockID] = null;
return block.blockID;
}
示例11: sendToPlayers
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
public void sendToPlayers(double posX,double posY,double posZ,int dimension,double distance,PacketData data) {
ServerConfigurationManager mgr = MinecraftServer.getServer().getConfigurationManager();
for (int j = 0; j < mgr.playerEntityList.size(); ++j) {
EntityPlayerMP p = (EntityPlayerMP) mgr.playerEntityList.get(j);
if (p.dimension != dimension) continue;
if (! General.isInRange(distance, p.posX, p.posY, p.posZ, posX, posY, posZ)) continue;
sendToPlayer(p,data);
}
}
示例12: onImpact
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
@Override
protected void onImpact(MovingObjectPosition movingobjectposition) {
int x = movingobjectposition.blockX;
int y = movingobjectposition.blockY;
int z = movingobjectposition.blockZ;
switch (movingobjectposition.sideHit) {
case 0:
y--;
break;
case 1:
y++;
break;
case 2:
z--;
break;
case 3:
z++;
break;
case 4:
x--;
break;
case 5:
x++;
break;
}
setDead();
if (worldObj.isRemote){
worldObj.playSound(x, y, z, "chisel:squash", 1.0f, 1.0f, false);
for(int i=0;i<32;i++)
GeneralChiselClient.spawnBallOMossFX(worldObj,posX,posY,posZ);
return;
}
int radius=5;
int falloff=3;
for(int xx=-radius;xx<radius;xx++){
for(int yy=-radius;yy<radius;yy++){
for(int zz=-radius;zz<radius;zz++){
double dist=(xx<0?-xx:xx)+(yy<0?-yy:yy)+(zz<0?-zz:zz);
if(! (dist<falloff || General.rand.nextInt(radius*3-falloff)>=dist*2)) continue;
if (! worldObj.isRemote)
turnToMoss(worldObj, x+xx, y+yy, z+zz);
}
}
}
}
示例13: randomDisplayTick
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
if(General.rand.nextInt(4)==0)
GeneralChiselClient.spawnHolystoneFX(world,this,x,y,z);
}
示例14: registerBlockIcons
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
@Override
public void registerBlockIcons(IIconRegister register) {
blockIcon = iconBase = register.registerIcon(General.getName(this) + "base");
iconSpike = register.registerIcon(General.getName(this) + "spike");
}
示例15: ContainerChisel
import info.jbcs.minecraft.utilities.General; //导入依赖的package包/类
public ContainerChisel(InventoryPlayer inventoryplayer, InventoryChiselSelection inv) {
inventory = inv;
playerInventory=inventoryplayer;
currentIndex=playerInventory.currentItem;
inv.container=this;
int[] leftOffsets = { 8, 26, 134, 152, 44, 116 };
int[] topOffsets = { 8, 26, 44, 62 };
int index = 0;
for (int i = 0; i < 2; i++) {
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 2; x++) {
addSlotToContainer(new SlotChiselSelection(this,inventory, inventory, x + i * 8 + y * 2, leftOffsets[x+i*2], topOffsets[y]));
}
}
}
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 2; x++) {
addSlotToContainer(new SlotChiselSelection(this,inventory, inventory, 16 + x + y * 2, leftOffsets[4 + x], topOffsets[3-y]));
}
}
addSlotToContainer(new SlotChiselInput(this,inventory, InventoryChiselSelection.normalSlots, 80, 35));
for (int k = 0; k < 3; k++) {
for (int j1 = 0; j1 < 9; j1++) {
addSlotToContainer(new Slot(inventoryplayer, j1 + k * 9 + 9, 8 + j1 * 18, 102 + k * 18 - 18));
}
}
for (int l = 0; l < 9; l++) {
addSlotToContainer(l==currentIndex?
new SlotChiselPlayer(this,inventoryplayer, l, 8 + l * 18, 160 - 18):
new Slot(inventoryplayer, l, 8 + l * 18, 160 - 18)
);
}
chisel=inventoryplayer.getCurrentItem();
if(chisel.stackTagCompound!=null){
ItemStack stack=ItemStack.loadItemStackFromNBT(chisel.stackTagCompound.getCompoundTag("chiselTarget"));
inventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, stack);
}
Item item=General.getItem(chisel);
carving=item instanceof ItemChisel?((ItemChisel)item).carving:Carving.chisel;
inventory.updateItems();
}