feat: initial infuser implementation

This commit is contained in:
LordMZTE 2024-05-05 15:07:50 +02:00
parent f6df183193
commit 9842cc1b6c
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
116 changed files with 5843 additions and 716 deletions

View file

@ -21,7 +21,7 @@ apply plugin: 'forge'
apply plugin: 'maven-publish'
version = "1.0"
group= "ley.modding.dartcraft"
group = "ley.modding.dartcraft"
archivesBaseName = "dartcraft"
sourceCompatibility = JavaVersion.VERSION_1_8
@ -33,11 +33,26 @@ minecraft {
}
repositories {
mavenLocal()
maven { url = "https://maven.tilera.xyz" }
maven {
url = "https://s3.tilera.xyz/cdn/minecraft/libs/"
metadataSources { artifact() }
}
maven {
name "central"
url "https://nexus.covers1624.net/repository/maven-hosted/"
}
}
dependencies {
implementation "net.anvilcraft:jalec:0.1.2"
implementation "net.anvilcraft:anvillib-7:0.1.0:deobf"
implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf"
implementation "net.industrial-craft:industrialcraft-2:2.2.827-experimental:dev"
implementation "codechicken:CodeChickenCore:1.7.10-1.0.7.48:dev"
implementation "codechicken:CodeChickenLib:1.7.10-1.1.3.141:dev"
implementation "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
}
processResources {

View file

@ -1,7 +0,0 @@
package cofh.api.energy;
import net.minecraftforge.common.util.ForgeDirection;
public interface IEnergyConnection {
boolean canConnectEnergy(ForgeDirection var1);
}

View file

@ -1,11 +0,0 @@
package cofh.api.energy;
import net.minecraftforge.common.util.ForgeDirection;
public interface IEnergyProvider extends IEnergyConnection {
int extractEnergy(ForgeDirection var1, int var2, boolean var3);
int getEnergyStored(ForgeDirection var1);
int getMaxEnergyStored(ForgeDirection var1);
}

View file

@ -1,11 +0,0 @@
package cofh.api.energy;
import net.minecraftforge.common.util.ForgeDirection;
public interface IEnergyReceiver extends IEnergyConnection {
int receiveEnergy(ForgeDirection var1, int var2, boolean var3);
int getEnergyStored(ForgeDirection var1);
int getMaxEnergyStored(ForgeDirection var1);
}

View file

@ -1,11 +0,0 @@
package cofh.api.energy;
public interface IEnergyStorage {
int receiveEnergy(int var1, boolean var2);
int extractEnergy(int var1, boolean var2);
int getEnergyStored();
int getMaxEnergyStored();
}

View file

@ -5,11 +5,8 @@ import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import ley.modding.dartcraft.block.DartBlocks;
import ley.modding.dartcraft.entity.EntityBottle;
import ley.modding.dartcraft.entity.EntityColdChicken;
@ -23,17 +20,26 @@ import ley.modding.dartcraft.handlers.TimeHandler;
import ley.modding.dartcraft.internal.Registry;
import ley.modding.dartcraft.item.DartItems;
import ley.modding.dartcraft.network.PacketClipButton;
import ley.modding.dartcraft.network.PacketDesocket;
import ley.modding.dartcraft.network.PacketFX;
import ley.modding.dartcraft.network.PacketInfuserStart;
import ley.modding.dartcraft.network.PacketUpdateAccessLevel;
import ley.modding.dartcraft.proxy.CommonProxy;
import ley.modding.dartcraft.tab.DartcraftTab;
import ley.modding.dartcraft.util.ForceEngineLiquids;
import ley.modding.dartcraft.util.FortunesUtil;
import ley.modding.dartcraft.worldgen.OreGen;
import ley.modding.tileralib.api.IRegistry;
import net.anvilcraft.anvillib.network.AnvilChannel;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;
@Mod(modid = Dartcraft.MODID, name = Dartcraft.MODNAME, version = Dartcraft.VERSION)
@Mod(
modid = Dartcraft.MODID,
name = Dartcraft.MODNAME,
version = Dartcraft.VERSION,
dependencies = "after:Thaumcraft;after:IC2"
)
public class Dartcraft {
public static final String MODID = "dartcraft";
public static final String MODNAME = "Dartcraft";
@ -49,7 +55,7 @@ public class Dartcraft {
)
public static CommonProxy proxy;
public static SimpleNetworkWrapper channel;
public static AnvilChannel channel;
public static CreativeTabs tab = new DartcraftTab();
@ -57,14 +63,12 @@ public class Dartcraft {
public void preInit(FMLPreInitializationEvent e) {
MinecraftForge.EVENT_BUS.register(new EventHandler());
MinecraftForge.EVENT_BUS.register(new TimeHandler());
channel = NetworkRegistry.INSTANCE.newSimpleChannel("dartcraft");
int desc = 0;
channel.registerMessage(
PacketClipButton.Handler.class, PacketClipButton.class, desc++, Side.SERVER
);
channel.registerMessage(
PacketFX.Handler.class, PacketFX.class, desc++, Side.CLIENT
);
channel = new AnvilChannel("dartcraft");
channel.register(PacketClipButton.class);
channel.register(PacketFX.class);
channel.register(PacketDesocket.class);
channel.register(PacketUpdateAccessLevel.class);
channel.register(PacketInfuserStart.class);
FortunesUtil.load();
}

View file

@ -0,0 +1,19 @@
package ley.modding.dartcraft.api;
public enum AccessLevel {
OPEN("Open"),
RESTRICTED("Restricted"),
CLOSED("Closed");
private static final AccessLevel[] NEXT_LOOKUP = { RESTRICTED, CLOSED, OPEN };
public final String displayName;
private AccessLevel(String displayName) {
this.displayName = displayName;
}
public AccessLevel next() {
return NEXT_LOOKUP[this.ordinal()];
}
}

View file

@ -1,7 +1,9 @@
package ley.modding.dartcraft.api;
public interface IOwnedTile {
String getOwner();
import java.util.UUID;
int getAccessLevel();
public interface IOwnedTile {
UUID getOwner();
AccessLevel getAccessLevel();
}

View file

@ -0,0 +1,69 @@
package ley.modding.dartcraft.api.recipe;
import ley.modding.dartcraft.api.upgrades.ForceUpgrade;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import net.minecraft.item.ItemStack;
public class ForceWildCard {
private ItemStack input;
private ItemStack output;
private boolean ignoreMeta;
private ForceUpgrade[] validUpgrades;
public ForceWildCard(ItemStack input, ForceUpgrade[] upgrades) {
this.input = this.prepareStack(input);
this.validUpgrades = upgrades;
this.output = null;
}
public ForceWildCard(ItemStack input, ItemStack output, ForceUpgrade upgrade) {
this.input = this.prepareStack(input);
this.output = output;
this.validUpgrades = new ForceUpgrade[] { upgrade };
}
private ItemStack prepareStack(ItemStack stack) {
return stack != null ? new ItemStack(stack.getItem(), 1, stack.getItemDamage())
: null;
}
public ForceWildCard setIgnoresMeta() {
this.ignoreMeta = true;
return this;
}
public ItemStack getInput() {
return this.input;
}
public ItemStack getOutput() {
return this.output;
}
public ForceUpgrade[] getUpgrades() {
return this.validUpgrades;
}
public boolean hasOutput() {
return this.output != null;
}
public boolean ignoreMeta() {
return this.ignoreMeta;
}
public void onProcess(TileEntityInfuser infuser) {}
//if (Loader.isModLoaded("IC2")
// && IC2Integration.DIAMOND_DRILL_ITEM.getItem()
// == wildcard.getInput().getItem()
// && Dartcraft.proxy.isSimulating(this.worldObj)) {
// DartUtils.dropItem(
// new ItemStack(Items.diamond, 3),
// this.worldObj,
// (double) this.xCoord,
// (double) this.yCoord,
// (double) this.zCoord
// );
//}
}

View file

@ -2,15 +2,17 @@ package ley.modding.dartcraft.api.upgrades;
import java.util.ArrayList;
public class IForceUpgrade {
private int id = getUniqueUpgradeID();
public class ForceUpgrade {
private static int nextID = 1;
private int id = nextID++;
private String name;
private String description;
private int tier;
private int maxLevel;
private ArrayList materials = new ArrayList();
private ArrayList<IForceUpgradeMaterial> materials = new ArrayList<>();
public IForceUpgrade(int tier, String name, int maxLevel, String description) {
public ForceUpgrade(int tier, String name, int maxLevel, String description) {
this.tier = tier;
this.name = name;
this.maxLevel = maxLevel;
@ -47,17 +49,6 @@ public class IForceUpgrade {
return this.materials != null ? this.materials.size() : 0;
}
public static int getUniqueUpgradeID() {
try {
return 1; //((Integer)ReflectionHelper.getMethod(DartAPI.manager,
//"getFirstUniqueUpgradeID", new Class[0]).invoke(DartAPI.manager,
//new Object[0])).intValue();
} catch (Exception var1) {
var1.printStackTrace();
return -1;
}
}
public IForceUpgradeMaterial getMaterialAt(int index) {
return this.materials != null && this.materials.size() > index
? (IForceUpgradeMaterial) this.materials.get(index)

View file

@ -5,6 +5,8 @@ import java.awt.Color;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.util.FXUtils;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EffectRenderer;
@ -27,33 +29,15 @@ public class BaseBlock extends Block {
public boolean addDestroyEffects(
World world, int x, int y, int z, int meta, EffectRenderer renderer
) {
FXUtils.makeShiny(
world,
(double) x,
(double) y,
(double) z,
2,
this.getColor(),
32,
true
);
FXUtils.makeShiny(new WorldVec(world, x, y, z), 2, this.getColor(), 32, true);
return true;
}
@Override
@SideOnly(Side.CLIENT)
public boolean
addHitEffects(World world, MovingObjectPosition target, EffectRenderer renderer) {
FXUtils.makeShiny(
world,
(double) target.blockX,
(double) target.blockY,
(double) target.blockZ,
2,
this.getColor(),
4,
true
);
addHitEffects(World world, MovingObjectPosition mop, EffectRenderer renderer) {
FXUtils.makeShiny(new Vec3(mop).withWorld(world), 2, this.getColor(), 4, true);
return true;
}
}

View file

@ -3,15 +3,12 @@ package ley.modding.dartcraft.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.util.DartUtils;
import ley.modding.dartcraft.util.FXUtils;
import ley.modding.dartcraft.util.Util;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

View file

@ -3,10 +3,13 @@ package ley.modding.dartcraft.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.client.gui.GuiType;
import ley.modding.dartcraft.tile.TileEntityForceEngine;
import ley.modding.dartcraft.util.DartUtils;
import ley.modding.dartcraft.util.FXUtils;
import ley.modding.tileralib.api.ITEProvider;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@ -68,7 +71,9 @@ public class BlockForceEngine extends BlockContainer implements ITEProvider {
}
if (!player.isSneaking() && !DartUtils.isHoldingWrench(player)) {
player.openGui(Dartcraft.instance, 7, world, x, y, z);
player.openGui(
Dartcraft.instance, GuiType.ENGINE.ordinal(), world, x, y, z
);
}
}
@ -138,14 +143,7 @@ public class BlockForceEngine extends BlockContainer implements ITEProvider {
World world, int x, int y, int z, int meta, EffectRenderer renderer
) {
FXUtils.makeShiny(
world,
(double) x,
(double) y,
(double) z,
2,
BaseBlock.DEFAULT_COLOR,
32,
true
new WorldVec(world, x, y, z), 2, BaseBlock.DEFAULT_COLOR, 32, true
);
return true;
}
@ -153,16 +151,9 @@ public class BlockForceEngine extends BlockContainer implements ITEProvider {
@Override
@SideOnly(Side.CLIENT)
public boolean
addHitEffects(World world, MovingObjectPosition target, EffectRenderer renderer) {
addHitEffects(World world, MovingObjectPosition mop, EffectRenderer renderer) {
FXUtils.makeShiny(
world,
(double) target.blockX,
(double) target.blockY,
(double) target.blockZ,
2,
BaseBlock.DEFAULT_COLOR,
4,
true
new Vec3(mop).withWorld(world), 2, BaseBlock.DEFAULT_COLOR, 4, true
);
return true;
}

View file

@ -7,6 +7,8 @@ import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.util.FXUtils;
import ley.modding.dartcraft.util.Util;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.block.BlockLeaves;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -89,14 +91,7 @@ public class BlockForceLeaves extends BlockLeaves {
World world, int x, int y, int z, int meta, EffectRenderer renderer
) {
FXUtils.makeShiny(
world,
(double) x,
(double) y,
(double) z,
2,
BaseBlock.DEFAULT_COLOR,
32,
true
new WorldVec(world, x, y, z), 2, BaseBlock.DEFAULT_COLOR, 32, true
);
return true;
}
@ -104,16 +99,9 @@ public class BlockForceLeaves extends BlockLeaves {
@Override
@SideOnly(Side.CLIENT)
public boolean
addHitEffects(World world, MovingObjectPosition target, EffectRenderer renderer) {
addHitEffects(World world, MovingObjectPosition mop, EffectRenderer renderer) {
FXUtils.makeShiny(
world,
(double) target.blockX,
(double) target.blockY,
(double) target.blockZ,
2,
BaseBlock.DEFAULT_COLOR,
4,
true
new Vec3(mop).withWorld(world), 2, BaseBlock.DEFAULT_COLOR, 4, true
);
return true;
}

View file

@ -5,6 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.util.FXUtils;
import ley.modding.dartcraft.util.Util;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.block.BlockLog;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -58,10 +60,7 @@ public class BlockForceLog extends BlockLog {
World world, int x, int y, int z, int meta, EffectRenderer renderer
) {
FXUtils.makeShiny(
world,
(double) x,
(double) y,
(double) z,
new WorldVec(world, x, y, z),
2,
BaseBlock.DEFAULT_COLOR,
32,
@ -73,12 +72,9 @@ public class BlockForceLog extends BlockLog {
@Override
@SideOnly(Side.CLIENT)
public boolean
addHitEffects(World world, MovingObjectPosition target, EffectRenderer renderer) {
addHitEffects(World world, MovingObjectPosition mop, EffectRenderer renderer) {
FXUtils.makeShiny(
world,
(double) target.blockX,
(double) target.blockY,
(double) target.blockZ,
new Vec3(mop).withWorld(world),
2,
BaseBlock.DEFAULT_COLOR,
4,

View file

@ -9,6 +9,8 @@ import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.util.FXUtils;
import ley.modding.dartcraft.util.Util;
import ley.modding.dartcraft.worldgen.GenForceTree;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling;
import net.minecraft.client.particle.EffectRenderer;
@ -40,6 +42,7 @@ public class BlockForceSapling extends BlockSapling {
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked", "alec" })
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
list.add(new ItemStack(item));
}
@ -60,14 +63,7 @@ public class BlockForceSapling extends BlockSapling {
World world, int x, int y, int z, int meta, EffectRenderer renderer
) {
FXUtils.makeShiny(
world,
(double) x,
(double) y,
(double) z,
2,
BaseBlock.DEFAULT_COLOR,
32,
true
new WorldVec(world, x, y, z), 2, BaseBlock.DEFAULT_COLOR, 32, true
);
return true;
}
@ -75,16 +71,9 @@ public class BlockForceSapling extends BlockSapling {
@Override
@SideOnly(Side.CLIENT)
public boolean
addHitEffects(World world, MovingObjectPosition target, EffectRenderer renderer) {
addHitEffects(World world, MovingObjectPosition mop, EffectRenderer renderer) {
FXUtils.makeShiny(
world,
(double) target.blockX,
(double) target.blockY,
(double) target.blockZ,
2,
BaseBlock.DEFAULT_COLOR,
4,
true
new Vec3(mop).withWorld(world), 2, BaseBlock.DEFAULT_COLOR, 4, true
);
return true;
}

View file

@ -5,6 +5,9 @@ import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.util.DartUtils;
import ley.modding.dartcraft.util.FXUtils;
import ley.modding.dartcraft.util.Util;
import net.anvilcraft.alec.jalec.factories.AlecCriticalRuntimeErrorExceptionFactory;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
@ -72,14 +75,7 @@ public class BlockForceSlab extends BlockSlab {
World world, int x, int y, int z, int meta, EffectRenderer renderer
) {
FXUtils.makeShiny(
world,
(double) x,
(double) y,
(double) z,
2,
DartUtils.getMcColor(this.type),
32,
true
new WorldVec(world, x, y, z), 2, DartUtils.getMcColor(this.type), 32, true
);
return true;
}
@ -87,22 +83,17 @@ public class BlockForceSlab extends BlockSlab {
@Override
@SideOnly(Side.CLIENT)
public boolean
addHitEffects(World world, MovingObjectPosition target, EffectRenderer renderer) {
addHitEffects(World world, MovingObjectPosition mop, EffectRenderer renderer) {
FXUtils.makeShiny(
world,
(double) target.blockX,
(double) target.blockY,
(double) target.blockZ,
2,
DartUtils.getMcColor(this.type),
4,
true
new Vec3(mop).withWorld(world), 2, DartUtils.getMcColor(this.type), 4, true
);
return true;
}
@Override
public String func_150002_b(int arg0) {
throw new UnsupportedOperationException("ALEC");
throw AlecCriticalRuntimeErrorExceptionFactory.PLAIN.createAlecException(
"Unknown Function called"
);
}
}

View file

@ -5,6 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.util.DartUtils;
import ley.modding.dartcraft.util.FXUtils;
import ley.modding.dartcraft.util.Util;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs;
import net.minecraft.client.particle.EffectRenderer;
@ -53,10 +55,7 @@ public class BlockForceStairs extends BlockStairs {
World world, int x, int y, int z, int meta, EffectRenderer renderer
) {
FXUtils.makeShiny(
world,
(double) x,
(double) y,
(double) z,
new WorldVec(world, x, y, z),
2,
DartUtils.getMcColor(this.type),
32,
@ -68,12 +67,9 @@ public class BlockForceStairs extends BlockStairs {
@Override
@SideOnly(Side.CLIENT)
public boolean
addHitEffects(World world, MovingObjectPosition target, EffectRenderer renderer) {
addHitEffects(World world, MovingObjectPosition mop, EffectRenderer renderer) {
FXUtils.makeShiny(
world,
(double) target.blockX,
(double) target.blockY,
(double) target.blockZ,
new Vec3(mop).withWorld(world),
2,
DartUtils.getMcColor(this.type),
4,

View file

@ -0,0 +1,260 @@
package ley.modding.dartcraft.block;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.api.AccessLevel;
import ley.modding.dartcraft.client.gui.GuiType;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import ley.modding.dartcraft.tile.TileEntityMachine;
import ley.modding.dartcraft.util.DartUtils;
import ley.modding.dartcraft.util.FXUtils;
import ley.modding.dartcraft.util.Util;
import ley.modding.tileralib.api.ICustomItemBlockProvider;
import ley.modding.tileralib.api.ITEProvider;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class BlockInfuser
extends BlockContainer implements ITEProvider, ICustomItemBlockProvider {
public int shineColor = 0x3c3056;
public BlockInfuser() {
super(Material.iron);
Util.configureBlock(this, "infuser");
this.setHardness(30.0F);
this.setResistance(2000.0F);
this.setBlockBounds(0.1F, 0.0F, 0.1F, 0.9F, 0.7F, 0.9F);
}
@Override
public void onBlockPlacedBy(
World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack
) {
try {
if (stack.hasTagCompound()) {
TileEntityInfuser infuser = (TileEntityInfuser
) TileEntity.createAndLoadEntity(stack.getTagCompound());
world.setTileEntity(x, y, z, infuser);
}
TileEntityMachine e = (TileEntityMachine) world.getTileEntity(x, y, z);
e.owner = ((EntityPlayer) entity).getUniqueID();
e.access = AccessLevel.OPEN;
} catch (Exception var9) {}
world.markBlockForUpdate(x, y, z);
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int getRenderType() {
return -1;
}
@Override
public TileEntity createNewTileEntity(World world, int alec) {
return new TileEntityInfuser();
}
@Override
public boolean onBlockActivated(
World world,
int x,
int y,
int z,
EntityPlayer player,
int par6,
float par7,
float par8,
float par9
) {
try {
if (Dartcraft.proxy.isSimulating(world) && !player.isSneaking()) {
TileEntity e = world.getTileEntity(x, y, z);
if (e != null && e instanceof TileEntityInfuser) {
TileEntityInfuser infuser = (TileEntityInfuser) e;
ItemStack dyeStack = player.getCurrentEquippedItem();
if (dyeStack != null && dyeStack.getItem() == Items.dye) {
if (!player.getUniqueID().equals(infuser.getOwner())) {
DartUtils.punishPlayer(player, 2.0F);
return true;
}
if (dyeStack.getItemDamage() != infuser.color) {
infuser.color = dyeStack.getItemDamage();
world.markBlockForUpdate(x, y, z);
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
--dyeStack.stackSize;
if (dyeStack.stackSize <= 0) {
player.destroyCurrentEquippedItem();
}
}
} else {
player.openGui(
Dartcraft.instance, GuiType.INFUSER.ordinal(), world, x, y, z
);
}
}
}
} catch (Exception var13) {
;
}
return true;
}
@Override
public float getPlayerRelativeBlockHardness(
EntityPlayer player, World world, int x, int y, int z
) {
float hardness = super.getPlayerRelativeBlockHardness(player, world, x, y, z);
try {
TileEntityMachine e = (TileEntityMachine) world.getTileEntity(x, y, z);
if (!player.getUniqueID().equals(e.getOwner())) {
return 1.0E-6F;
}
} catch (Exception var8) {
;
}
return hardness;
}
@Override
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
if (world != null && Dartcraft.proxy.isSimulating(world)) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile != null && tile instanceof TileEntityMachine) {
ItemStack toDrop = new ItemStack(this);
NBTTagCompound nbt = new NBTTagCompound();
tile.writeToNBT(nbt);
toDrop.setTagCompound(nbt);
world.removeTileEntity(x, y, z);
DartUtils.dropInvincibleItem(
toDrop, world, (double) x, (double) y, (double) z, 6000
);
}
}
}
@Override
public ArrayList<ItemStack>
getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return new ArrayList<>();
}
@Override
@SideOnly(Side.CLIENT)
public boolean addDestroyEffects(
World world, int x, int y, int z, int meta, EffectRenderer renderer
) {
FXUtils.makeShiny(new WorldVec(world, x, y, z), 2, this.shineColor, 16, true);
return true;
}
@Override
@SideOnly(Side.CLIENT)
public boolean
addHitEffects(World world, MovingObjectPosition mop, EffectRenderer renderer) {
if (world != null && mop != null) {
FXUtils.makeShiny(
new Vec3(mop).withWorld(world), 2, this.shineColor, 3, true
);
}
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile != null && tile instanceof TileEntityInfuser) {
TileEntityInfuser infuser = (TileEntityInfuser) tile;
if (infuser.isActive) {
FXUtils.makeShiny(
new WorldVec(world, x, y, z), 2, this.shineColor, 10, true
);
world.playSound(
(float) x,
(float) y,
(float) z,
"dartcraft:sparkle",
0.5F,
DartUtils.randomPitch(),
true
);
}
}
}
@Override
public Class<? extends TileEntity> getTEClass() {
return TileEntityInfuser.class;
}
@Override
public Class<? extends ItemBlock> getItemBlockClass() {
return BlockItem.class;
}
public static class BlockItem extends ItemBlock {
public BlockItem(Block block) {
super(block);
}
@SideOnly(value = Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes", "ALEC" })
public void
addInformation(ItemStack stack, EntityPlayer player, List list, boolean thing) {
if (stack == null || !stack.hasTagCompound()) {
return;
}
try {
TileEntityInfuser infuser = (TileEntityInfuser
) TileEntity.createAndLoadEntity((NBTTagCompound) stack.getTagCompound());
list.add("Tier " + infuser.getActiveTier());
list.add("Liquid Force: " + infuser.getFluidAmount());
list.add("RF: " + (int) infuser.storedRF);
TileEntityInfuser inv = infuser;
int free = 0;
for (int i = 0; i < inv.getSizeInventory(); ++i) {
if (inv.getStackInSlot(i) != null)
continue;
++free;
}
list.add(
"" + (inv.getSizeInventory() - free) + "/" + inv.getSizeInventory()
+ " Slots"
);
} catch (Exception e) {}
}
}
}

View file

@ -3,6 +3,7 @@ package ley.modding.dartcraft.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.client.IconDirectory;
import ley.modding.dartcraft.entity.EntityColdChicken;
import ley.modding.dartcraft.entity.EntityColdCow;
import ley.modding.dartcraft.entity.EntityColdPig;
@ -131,5 +132,6 @@ public class BlockLiquidForce extends BlockFluidClassic {
if (fmilk != null && milk != null) {
fmilk.setIcons(milk, milk);
}
IconDirectory.registerBlockTextures(reggie);
}
}

View file

@ -17,6 +17,7 @@ public class DartBlocks {
public static Block[] forceslab;
public static Block[] forcestairs;
public static Block forcetorch;
public static Block infuser;
public static Block liquidforce;
public static Block powerore;
@ -45,6 +46,7 @@ public class DartBlocks {
.map(reg::registerBlock)
.toArray(Block[] ::new);
DartBlocks.forcetorch = reg.registerBlock(new BlockForceTorch());
DartBlocks.infuser = reg.registerBlock(new BlockInfuser());
DartBlocks.liquidforce = reg.registerBlock(new BlockLiquidForce());
DartBlocks.powerore = reg.registerBlock(new BlockPowerOre());
}

View file

@ -0,0 +1,41 @@
package ley.modding.dartcraft.client;
import java.util.stream.IntStream;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
public class IconDirectory {
private static boolean itemTexturesRegistered;
private static boolean blockTexturesRegistered;
// Item Icons
public static IIcon noSlot;
// Block Icons
public static IIcon[] machines;
public static IIcon[] furnaces;
public static void registerItemTextures(IIconRegister reg) {
if (itemTexturesRegistered)
return;
itemTexturesRegistered = true;
noSlot = reg.registerIcon("dartcraft:noSlot");
}
public static void registerBlockTextures(IIconRegister reg) {
if (blockTexturesRegistered)
return;
blockTexturesRegistered = true;
machines = IntStream.range(0, 16)
.mapToObj(i -> "dartcraft:machine" + i)
.map(reg::registerIcon)
.toArray(IIcon[] ::new);
furnaces = IntStream.range(0, 16)
.mapToObj(i -> "dartcraft:furnace" + i)
.map(reg::registerIcon)
.toArray(IIcon[] ::new);
}
}

View file

@ -0,0 +1,151 @@
package ley.modding.dartcraft.client.fx;
import java.awt.Color;
import org.lwjgl.opengl.GL11;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.proxy.CommonProxy;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class FXCharge extends EntityFX {
public static final int TYPE_FALL = 0;
public static final int TYPE_CHANGE = 1;
public static final int TYPE_BREAK = 2;
private int iconIndex = 20;
private int type;
private Color color;
public FXCharge(
World world, double x, double y, double z, double vx, double vy, double vz
) {
super(world, x, y, z, vx, vy, vz);
}
public FXCharge(World world, double x, double y, double z, int color, int type) {
super(world, x, y, z);
this.color = new Color(color);
this.particleRed = (float) this.color.getRed();
this.particleGreen = (float) this.color.getGreen();
this.particleBlue = (float) this.color.getBlue();
this.setSize(0.02F, 0.02F);
this.noClip = true;
this.type = type;
float velModifier;
switch (type) {
case 0:
this.motionX = this.motionZ = 0.0D;
this.motionY = -0.025D;
this.particleMaxAge = (int) (85.0D
* ((double) world.rand.nextFloat() * 0.2D
+ 0.8999999761581421D));
break;
case 1:
velModifier = 0.25F;
this.motionX = (double) ((CommonProxy.rand.nextFloat() * 2.0F - 1.0F)
* velModifier);
this.motionY = (double) ((CommonProxy.rand.nextFloat() * 2.0F - 1.0F)
* velModifier);
this.motionZ = (double) ((CommonProxy.rand.nextFloat() * 2.0F - 1.0F)
* velModifier);
this.particleMaxAge = (int) (10.0D
* ((double) world.rand.nextFloat() * 0.2D
+ 0.8999999761581421D));
break;
case 2:
velModifier = 0.1F;
this.motionX = (double) ((CommonProxy.rand.nextFloat() * 2.0F - 1.0F)
* velModifier);
this.motionY = (double) velModifier;
this.motionZ = (double) ((CommonProxy.rand.nextFloat() * 2.0F - 1.0F)
* velModifier);
this.particleMaxAge = (int) (10.0D
* ((double) world.rand.nextFloat() * 0.2D
+ 0.8999999761581421D));
this.particleGravity = 0.5F;
}
}
public void onUpdate() {
super.onUpdate();
this.rotationPitch += 0.01F;
switch (this.type) {
case 2:
default:
}
}
public void renderParticle(
Tessellator tessy,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7
) {
tessy.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
Dartcraft.proxy.bindTexture("darticles.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float var8 = (float) (this.iconIndex % 8) / 8.0F;
float var9 = var8 + 0.124875F;
float var10 = (float) (this.iconIndex / 8) / 8.0F;
float var11 = var10 + 0.124875F;
float var12 = 0.1F * this.particleScale;
float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2
- interpPosX);
float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2
- interpPosY);
float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2
- interpPosZ);
tessy.startDrawingQuads();
tessy.setBrightness(240);
tessy.setColorRGBA_F(
this.particleRed, this.particleGreen, this.particleBlue, 1.0F
);
tessy.addVertexWithUV(
(double) (var13 - par3 * var12 - par6 * var12),
(double) (var14 - par4 * var12),
(double) (var15 - par5 * var12 - par7 * var12),
(double) var9,
(double) var11
);
tessy.addVertexWithUV(
(double) (var13 - par3 * var12 + par6 * var12),
(double) (var14 + par4 * var12),
(double) (var15 - par5 * var12 + par7 * var12),
(double) var9,
(double) var10
);
tessy.addVertexWithUV(
(double) (var13 + par3 * var12 + par6 * var12),
(double) (var14 + par4 * var12),
(double) (var15 + par5 * var12 + par7 * var12),
(double) var8,
(double) var10
);
tessy.addVertexWithUV(
(double) (var13 + par3 * var12 - par6 * var12),
(double) (var14 - par4 * var12),
(double) (var15 + par5 * var12 - par7 * var12),
(double) var8,
(double) var11
);
tessy.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
Minecraft.getMinecraft().getTextureManager().bindTexture(
new ResourceLocation("textures/particle/particles.png")
);
tessy.startDrawingQuads();
}
}

View file

@ -22,19 +22,19 @@ public class ContainerForceEngine extends Container {
this.user = player;
this.engine = engine;
this.playerInv = (IInventory) player.inventory;
addSlotToContainer(new FuelSlot((IInventory) engine.liquidInventory, 0, 38, 33));
addSlotToContainer(
this.addSlotToContainer(new FuelSlot((IInventory) engine.liquidInventory, 0, 38, 33));
this.addSlotToContainer(
new ThrottleSlot((IInventory) engine.liquidInventory, 1, 122, 33)
);
int i;
for (i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++)
addSlotToContainer(
this.addSlotToContainer(
new Slot(this.playerInv, i * 9 + j + 9, 8 + 18 * j, 79 + 18 * i)
);
}
for (i = 0; i < 9; i++)
addSlotToContainer(new Slot(this.playerInv, i, 8 + 18 * i, 137));
this.addSlotToContainer(new Slot(this.playerInv, i, 8 + 18 * i, 137));
}
public void detectAndSendChanges() {

View file

@ -0,0 +1,132 @@
package ley.modding.dartcraft.client.gui;
import java.util.ArrayList;
import ley.modding.dartcraft.api.upgrades.ForceUpgrade;
import ley.modding.dartcraft.api.upgrades.IForceUpgradeMaterial;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import ley.modding.dartcraft.util.ForceUpgradeManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryBasic;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class ContainerInfoPage extends Container {
public InventoryBasic contents;
public TileEntityInfuser infuser;
public ArrayList<ItemStack> upgrades = new ArrayList<>();
public int page;
public int selected;
public int offsetX;
public int offsetY;
public int selectedX;
public int selectedY;
public static final int MAX_SLOTS = 8;
public NBTTagCompound comp = new NBTTagCompound();
public ContainerInfoPage(TileEntityInfuser infuser, int x, int y) {
int i;
this.infuser = infuser;
this.contents = new InventoryBasic("upgrades", false, 9);
this.page = 0;
this.selected = -1;
if (this.infuser != null && this.infuser.getStackInSlot(0) != null
&& this.infuser.getStackInSlot(0).hasTagCompound()) {
this.comp = this.infuser.getStackInSlot(0).getTagCompound();
}
this.offsetX = x;
this.offsetY = y;
int posX = this.offsetX + 14;
int posY = this.offsetY + 142;
int rows = 1;
this.addSlotToContainer(new DummySlot(
(IInventory) this.contents, this.contents.getSizeInventory() - 1, -1000, -1000
));
for (int i2 = 0; i2 < rows; ++i2) {
for (int j = 0; j < 8 / rows; ++j) {
this.addSlotToContainer(new DummySlot(
(IInventory) this.contents,
i2 * (8 / rows) + j,
posX + j * 23,
posY + i2 * 23
));
}
}
int tier = infuser != null ? infuser.getActiveTier() : 0;
ArrayList<ArrayList<ItemStack>> buffer = new ArrayList<>();
for (int i3 = 0; i3 < 8; ++i3) {
buffer.add(new ArrayList<>());
}
for (IForceUpgradeMaterial mat : ForceUpgradeManager.materials) {
ForceUpgrade upgrade = ForceUpgradeManager.getFromID(mat.getUpgradeID());
buffer.get(upgrade.getTier())
.add(new ItemStack(mat.getItem(), 1, mat.getItemMeta()));
}
for (i = 0; i <= tier; ++i) {
for (ItemStack tempStack : buffer.get(i)) {
this.upgrades.add(tempStack.copy());
}
}
for (i = 0; i < this.contents.getSizeInventory() && i < this.upgrades.size();
++i) {
this.contents.setInventorySlotContents(i, this.upgrades.get(i));
}
}
public void forwardPage() {
int totalPages
= this.upgrades.size() / 8 + (this.upgrades.size() % 8 > 0 ? 1 : 0) - 1;
if (this.page < totalPages) {
++this.page;
this.redoPage();
}
}
public void backPage() {
if (this.page > 0) {
--this.page;
this.redoPage();
}
}
private void redoPage() {
int start = this.page * 8;
for (int i = 0; i < this.contents.getSizeInventory(); ++i) {
if (this.upgrades.size() > start) {
this.contents.setInventorySlotContents(i, this.upgrades.get(start));
} else {
this.contents.setInventorySlotContents(i, (ItemStack) null);
}
++start;
}
this.selected = -1;
}
public void setSelected(int index) {
this.selected = index;
}
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
return null;
}
protected void
retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) {}
public boolean canInteractWith(EntityPlayer entityplayer) {
return false;
}
private class DummySlot extends Slot {
public DummySlot(IInventory inv, int x, int y, int z) {
super(inv, x, y, z);
}
public boolean canTakeStack(EntityPlayer player) {
return false;
}
}
}

View file

@ -0,0 +1,374 @@
package ley.modding.dartcraft.client.gui;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.api.upgrades.IForceUpgradeMaterial;
import ley.modding.dartcraft.client.IconDirectory;
import ley.modding.dartcraft.item.ItemForceTome;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import ley.modding.dartcraft.util.DartUtils;
import ley.modding.dartcraft.util.ForceConsumerUtils;
import ley.modding.dartcraft.util.ForceUpgradeManager;
import ley.modding.dartcraft.util.TomeUtils;
import net.anvilcraft.anvillib.util.AnvilUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
public class ContainerInfuser extends ContainerMachine {
public TileEntityInfuser infuser;
public IInventory infuserInv;
public EntityPlayer usingPlayer;
public int lastEnergyLevel;
public int lastAmount;
public ContainerInfuser(InventoryPlayer inv, TileEntityInfuser tileinfuser) {
super(inv.player, tileinfuser);
int i;
this.infuser = tileinfuser;
this.infuserInv = this.infuser;
this.usingPlayer = inv.player;
this.addSlotToContainer(new TomeSlot(this.infuserInv, 0, 10, 10, this.infuser));
this.addSlotToContainer(new GemSlot(this.infuserInv, 1, 10, 35));
this.addSlotToContainer(new ItemSlot(this.infuserInv, 2, 80, 57, this.infuser));
this.addSlotToContainer(
new UpgradeSlot(this.infuserInv, 3, 80, 20, this.infuser, 0)
);
this.addSlotToContainer(
new UpgradeSlot(this.infuserInv, 4, 104, 32, this.infuser, 1)
);
this.addSlotToContainer(
new UpgradeSlot(this.infuserInv, 5, 116, 57, this.infuser, 2)
);
this.addSlotToContainer(
new UpgradeSlot(this.infuserInv, 6, 104, 81, this.infuser, 3)
);
this.addSlotToContainer(
new UpgradeSlot(this.infuserInv, 7, 80, 93, this.infuser, 4)
);
this.addSlotToContainer(
new UpgradeSlot(this.infuserInv, 8, 56, 81, this.infuser, 5)
);
this.addSlotToContainer(
new UpgradeSlot(this.infuserInv, 9, 44, 57, this.infuser, 6)
);
this.addSlotToContainer(
new UpgradeSlot(this.infuserInv, 10, 56, 32, this.infuser, 7)
);
for (i = 0; i < 3; ++i) {
for (int var4 = 0; var4 < 9; ++var4) {
this.addSlotToContainer(new Slot(
(IInventory) inv, var4 + i * 9 + 9, 8 + var4 * 18, 127 + i * 18
));
}
}
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot((IInventory) inv, i, 8 + i * 18, 185));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack returnStack = null;
Slot slot = (Slot) this.inventorySlots.get(index);
if (slot != null && slot.getHasStack()) {
ItemStack stack = slot.getStack();
returnStack = stack.copy();
if (index >= 0 && index < 11 && !this.mergeItemStack(stack, 11, 47, false)) {
return null;
}
if (index > 10 && index < 47) {
IForceUpgradeMaterial upgrade;
NBTTagCompound tomeComp;
if (stack.getItem() instanceof ItemForceTome && stack.hasTagCompound()
&& ((tomeComp = stack.getTagCompound()).hasKey("type")
? tomeComp.getInteger("type") == 0
&& !this.mergeItemStack(stack, 0, 1, false)
: !this.mergeItemStack(stack, 2, 3, false))) {
return null;
}
if (ForceConsumerUtils.isForceContainer(stack)
&& !this.mergeItemStack(stack, 1, 2, false)) {
return null;
}
if (DartUtils.canUpgrade(stack)) {
if (stack.stackSize > 1) {
ItemStack copyStack
= new ItemStack(stack.getItem(), 1, stack.getItemDamage());
if (stack.hasTagCompound()) {
copyStack.setTagCompound(stack.getTagCompound());
}
if (this.getSlot(2).getStack() != null
|| !this.mergeItemStack(copyStack, 2, 3, false)) {
return null;
}
--stack.stackSize;
} else if (!this.mergeItemStack(stack, 2, 3, false)) {
return null;
}
}
if (this.infuser != null && this.infuser.totalProgress == 0
&& (upgrade = ForceUpgradeManager.getMaterialFromItemStack(stack))
!= null
&& ForceUpgradeManager.getFromID(upgrade.getUpgradeID()).getTier()
> 0) {
int tier = this.infuser != null ? this.infuser.getActiveTier() : 0;
if (tier < ForceUpgradeManager.getFromID(upgrade.getUpgradeID())
.getTier()) {
return null;
}
boolean transferred = false;
for (int i = 3; i < 4 + tier; ++i) {
ItemStack tempStack = stack.copy();
tempStack.stackSize = 1;
if (this.getSlot(i).getStack() != null
|| !this.mergeItemStack(tempStack, i, i + 1, false))
continue;
--stack.stackSize;
transferred = true;
break;
}
if (!transferred) {
return null;
}
}
}
if (stack.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
if (stack.stackSize == returnStack.stackSize) {
return null;
}
slot.onPickupFromSlot(player, stack);
}
return returnStack;
}
@Override
public void addCraftingToCrafters(ICrafting crafting) {
super.addCraftingToCrafters(crafting);
if (this.infuser == null) {
return;
}
try {
crafting.sendProgressBarUpdate(
(Container) this, 10, (int) this.infuser.storedRF
);
crafting.sendProgressBarUpdate(
(Container) this, 11, this.infuser.liquid.amount
);
} catch (NullPointerException e) {
e.printStackTrace();
}
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
if (this.infuser == null) {
return;
}
try {
for (int var1 = 0; var1 < this.crafters.size(); ++var1) {
ICrafting var2 = (ICrafting) this.crafters.get(var1);
if (this.lastEnergyLevel != (int) this.infuser.storedRF) {
var2.sendProgressBarUpdate(
(Container) this, 10, (int) this.infuser.storedRF
);
}
if (this.lastAmount == this.infuser.liquid.amount)
continue;
var2.sendProgressBarUpdate(
(Container) this, 11, this.infuser.liquid.amount
);
}
this.lastEnergyLevel = (int) this.infuser.storedRF;
this.lastAmount = this.infuser.liquid.amount;
} catch (NullPointerException e) {
e.printStackTrace();
}
}
@Override
@SideOnly(value = Side.CLIENT)
public void updateProgressBar(int i, int j) {
super.updateProgressBar(i, j);
if (this.infuser == null) {
return;
}
if (j < 0) {
j = Math.abs(Short.MIN_VALUE - j) + Short.MAX_VALUE + 1;
}
switch (i) {
case 10: {
this.infuser.storedRF = j;
break;
}
case 11: {
this.infuser.liquid.amount = j;
}
}
}
private class TomeSlot extends Slot {
TileEntityInfuser infuser;
public TomeSlot(
IInventory par1iInventory,
int par2,
int par3,
int par4,
TileEntityInfuser infuser
) {
super(par1iInventory, par2, par3, par4);
this.infuser = infuser;
}
public boolean isItemValid(ItemStack stack) {
boolean isTome = TomeUtils.getTomeType(stack) == 0;
try {
isTome = AnvilUtil
.uuidFromNBT(stack.getTagCompound().getTagList("player", 4))
.equals(this.infuser.getOwner());
} catch (Exception exception) {}
return isTome;
}
public boolean canTakeStack(EntityPlayer player) {
try {
return player.getUniqueID().equals(this.infuser.getOwner())
&& this.infuser.totalProgress == 0;
} catch (Exception exception) {
return false;
}
}
public int getSlotStackLimit() {
return 1;
}
}
private class GemSlot extends Slot {
public GemSlot(IInventory par1iInventory, int par2, int par3, int par4) {
super(par1iInventory, par2, par3, par4);
}
public boolean isItemValid(ItemStack stack) {
return ForceConsumerUtils.isForceContainer(stack);
}
}
private class ItemSlot extends Slot {
TileEntityInfuser infuser;
public ItemSlot(
IInventory par1iInventory,
int par2,
int par3,
int par4,
TileEntityInfuser infuser
) {
super(par1iInventory, par2, par3, par4);
this.infuser = infuser;
}
public boolean isItemValid(ItemStack stack) {
return DartUtils.canUpgrade(stack);
}
public boolean canTakeStack(EntityPlayer player) {
return this.infuser != null ? this.infuser.totalProgress == 0 : false;
}
public int getSlotStackLimit() {
return 1;
}
public void onPickupFromSlot(EntityPlayer player, ItemStack product) {
super.onPickupFromSlot(player, product);
// TODO: force sword
//if (product != null && product.itemID == DartItems.forceSword.itemID) {
// NBTTagCompound upgrades = UpgradeHelper.getUpgradeCompound(product);
// int smite = upgrades.getInteger("Light");
// int damage = upgrades.getInteger("Damage");
// int heal = upgrades.getInteger("Healing");
// if (heal >= 2 && damage >= 5 && smite >= 1) {
// DartPluginAchievements.addToPlayer("undeadBane", player);
// }
//}
}
}
private class UpgradeSlot extends Slot {
private TileEntityInfuser infuser;
private int tier;
public UpgradeSlot(
IInventory par1iInventory,
int par2,
int par3,
int par4,
TileEntityInfuser infuser,
int tier
) {
super(par1iInventory, par2, par3, par4);
this.infuser = infuser;
this.tier = tier;
}
public ResourceLocation getBackgroundIconTexture() {
if (this.infuser != null && this.infuser.getActiveTier() < this.tier) {
return new ResourceLocation("items.png");
}
return super.getBackgroundIconTexture();
}
public IIcon getBackgroundIconIndex() {
if (this.infuser != null && this.infuser.getActiveTier() < this.tier) {
return IconDirectory.noSlot;
}
return super.getBackgroundIconIndex();
}
public boolean isItemValid(ItemStack stack) {
if (this.infuser == null) {
return false;
}
if (this.infuser.getActiveTier() < this.tier
|| this.infuser.totalProgress > 0) {
return false;
}
IForceUpgradeMaterial upgrade
= ForceUpgradeManager.getMaterialFromItemStack(stack);
if (upgrade == null
|| ForceUpgradeManager.getFromID(upgrade.getUpgradeID()).getTier() <= 0) {
return false;
}
for (IForceUpgradeMaterial check : ForceUpgradeManager.materials) {
if (check == null || !check.equals(upgrade)
|| (this.infuser != null ? this.infuser.getActiveTier() : 0)
< ForceUpgradeManager.getFromID(check.getUpgradeID()).getTier())
continue;
return true;
}
return false;
}
public boolean canTakeStack(EntityPlayer player) {
return this.infuser != null ? this.infuser.totalProgress == 0 : false;
}
public int getSlotStackLimit() {
return 1;
}
}
}

View file

@ -0,0 +1,197 @@
package ley.modding.dartcraft.client.gui;
import java.lang.reflect.Field;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.api.AccessLevel;
import ley.modding.dartcraft.tile.TileEntityMachine;
import ley.modding.dartcraft.util.DartUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerMachine extends Container {
public TileEntityMachine machine;
public EntityPlayer player;
protected Field[] synced;
protected int[] prev = new int[]{};
public ContainerMachine(EntityPlayer player, TileEntityMachine machine) {
this.machine = machine;
this.player = player;
}
protected void addPlayerInventory(int posX, int posY) {
int i;
for (i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
this.addSlotToContainer(new Slot(
(IInventory) this.player.inventory,
9 + i * 9 + j,
posX + 18 * j,
posY + 18 * i
));
}
}
posY += 58;
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(
new Slot((IInventory) this.player.inventory, i, posX + 18 * i, posY)
);
}
}
public void desocket() {
if (this.machine != null) {
this.machine.desocket();
}
}
public void setAccessLevel(AccessLevel level) {
if (this.machine != null) {
this.machine.access = level;
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return this.machine != null && player != null
? this.machine.canPlayerAccess(player)
: false;
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
try {
ItemStack returnStack = null;
Slot slot = (Slot) this.inventorySlots.get(index);
if (slot != null && slot.getHasStack()) {
ItemStack stack = slot.getStack();
returnStack = stack.copy();
if (index < this.machine.getSizeInventory()) {
if (!this.mergeItemStack(
stack,
this.machine.getSizeInventory(),
this.machine.getSizeInventory() + 36,
true
)) {
return null;
}
} else {
try {
for (int i = 0; i < this.machine.getSizeInventory(); ++i) {
Slot tempSlot = (Slot) this.inventorySlots.get(i);
if (!(tempSlot instanceof SocketSlot)
&& tempSlot.isItemValid(stack)
&& !this.mergeItemStack(stack, i, i + 1, false)) {
return null;
}
if (stack.stackSize == 0) {
slot.putStack((ItemStack) null);
continue;
}
slot.onSlotChanged();
}
} catch (Exception e) {
// empty catch block
}
}
if (stack != null && stack.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
if (stack.stackSize == returnStack.stackSize) {
return null;
}
slot.onPickupFromSlot(player, stack);
}
return returnStack;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@Override
protected void
retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) {}
@Override
public void addCraftingToCrafters(ICrafting crafting) {
super.addCraftingToCrafters(crafting);
int[] syncdata = this.machine.getContainerSyncData();
for (int i = 0; i < syncdata.length; i++)
crafting.sendProgressBarUpdate(this, i, syncdata[i]);
}
@Override
@SuppressWarnings("unchecked")
public void detectAndSendChanges() {
super.detectAndSendChanges();
int[] syncdata = this.machine.getContainerSyncData();
for (ICrafting cr : (List<ICrafting>) this.crafters) {
for (int i = 0; i < syncdata.length; i++) {
if (i >= this.prev.length || syncdata[i] == this.prev[i])
continue;
cr.sendProgressBarUpdate(this, i, syncdata[i]);
}
}
this.prev = syncdata;
}
@Override
@SideOnly(Side.CLIENT)
public void updateProgressBar(int slot, int value) {
this.machine.receiveContainerSyncData(slot, value);
}
protected class SocketSlot extends Slot {
public SocketSlot(IInventory inv, int slot, int x, int y) {
super(inv, slot, x, y);
}
public boolean isItemValid(ItemStack stack) {
return ContainerMachine.this.machine != null
? ContainerMachine.this.machine.isSocketValid(stack)
&& !this.getHasStack() && stack.stackSize == 1
: false;
}
public boolean canTakeStack(EntityPlayer player) {
return false;
}
public void putStack(ItemStack stack) {
super.putStack(stack);
if (ContainerMachine.this.machine != null
&& Dartcraft.proxy.isSimulating(ContainerMachine.this.machine.getWorldObj(
))) {
ContainerMachine.this.machine.getWorldObj().playSoundEffect(
(double) ContainerMachine.this.machine.xCoord,
(double) ContainerMachine.this.machine.yCoord,
(double) ContainerMachine.this.machine.zCoord,
"dartcraft:socket",
1.0f,
DartUtils.randomPitch()
);
}
}
public void onSlotChanged() {
super.onSlotChanged();
if (ContainerMachine.this.machine != null) {
ContainerMachine.this.machine.computeUpgrades();
}
}
}
}

View file

@ -150,7 +150,7 @@ public class GuiEngine extends GuiTab {
output = throttle = 0.0F;
int subColor = 15000804;
Tab.tabFontRenderer.drawStringWithShadow("Output", x + 22, y + 6, 16777215);
Tab.tabFontRenderer.drawStringWithShadow("MJ/t:", x + 8, y + 20, 16777215);
Tab.tabFontRenderer.drawStringWithShadow("RF/t:", x + 8, y + 20, 16777215);
if (output > 0.0F) {
Tab.tabFontRenderer.drawStringWithShadow(
"" + GuiEngine.this.engine.getEnergyPerProcess(),

View file

@ -3,8 +3,10 @@ package ley.modding.dartcraft.client.gui;
import cpw.mods.fml.common.network.IGuiHandler;
import ley.modding.dartcraft.item.ItemClipboard;
import ley.modding.dartcraft.tile.TileEntityForceEngine;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import ley.modding.dartcraft.util.EntityUtils;
import ley.modding.dartcraft.util.ItemCraftingInventory;
import net.anvilcraft.anvillib.util.AnvilUtil;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -15,46 +17,61 @@ import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler {
@Override
public Object
getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
ItemStack clipStack;
switch (ID) {
case 0:
clipStack = getClipboard(player);
getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
switch (AnvilUtil.enumFromInt(GuiType.class, id)) {
case CLIPBOARD: {
ItemStack clipStack = getClipboard(player);
if (clipStack != null)
return new ContainerClipboard(
player, new ItemCraftingInventory(9, clipStack)
);
break;
case 7:
TileEntity te2 = world.getTileEntity(x, y, z);
if (te2 != null && te2 instanceof TileEntityForceEngine) {
TileEntityForceEngine engine = (TileEntityForceEngine) te2;
return new ContainerForceEngine(player, engine);
} break;
case ENGINE: {
TileEntity te = world.getTileEntity(x, y, z);
if (te instanceof TileEntityForceEngine) {
return new ContainerForceEngine(player, (TileEntityForceEngine) te);
}
break;
} break;
case INFUSER: {
TileEntity te = world.getTileEntity(x, y, z);
if (te instanceof TileEntityInfuser) {
return new ContainerInfuser(player.inventory, (TileEntityInfuser) te);
}
} break;
}
return null;
}
@Override
public Object
getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
ItemStack clipStack;
switch (ID) {
case 0:
clipStack = getClipboard(player);
getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
switch (AnvilUtil.enumFromInt(GuiType.class, id)) {
case CLIPBOARD: {
ItemStack clipStack = getClipboard(player);
if (clipStack != null)
return new GuiClipboard(new ContainerClipboard(
player, new ItemCraftingInventory(9, clipStack)
));
break;
case 7:
TileEntity te2 = world.getTileEntity(x, y, z);
if (te2 instanceof TileEntityForceEngine) {
TileEntityForceEngine engine = (TileEntityForceEngine) te2;
} break;
case ENGINE: {
TileEntity te = world.getTileEntity(x, y, z);
if (te instanceof TileEntityForceEngine) {
TileEntityForceEngine engine = (TileEntityForceEngine) te;
return new GuiEngine(new ContainerForceEngine(player, engine));
}
break;
} break;
case INFUSER: {
TileEntity te = world.getTileEntity(x, y, z);
if (te instanceof TileEntityInfuser) {
return new GuiInfuser(
new ContainerInfuser(player.inventory, (TileEntityInfuser) te)
);
}
} break;
}
return null;
}

View file

@ -0,0 +1,681 @@
package ley.modding.dartcraft.client.gui;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.List;
import org.lwjgl.opengl.GL11;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.guihook.GuiContainerManager;
import codechicken.nei.guihook.IContainerTooltipHandler;
import codechicken.nei.guihook.IGuiSlotDraw;
import cpw.mods.fml.common.Loader;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.api.upgrades.ForceUpgrade;
import ley.modding.dartcraft.api.upgrades.IForceUpgradeMaterial;
import ley.modding.dartcraft.block.BlockLiquidForce;
import ley.modding.dartcraft.block.DartBlocks;
import ley.modding.dartcraft.client.gui.tabs.Tab;
import ley.modding.dartcraft.network.PacketInfuserStart;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import ley.modding.dartcraft.tile.TileEntityInfuser.ErrorType;
import ley.modding.dartcraft.util.ForceUpgradeManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
public class GuiInfuser
extends GuiMachine implements IContainerTooltipHandler, IGuiSlotDraw {
private TileEntityInfuser infuser;
private ContainerInfuser container;
private ContainerInfoPage infoPage;
private EntityPlayer player;
private ItemStack lastItem;
private Rectangle goBounds;
private Rectangle infoBounds;
private Rectangle escapeBounds;
private Rectangle forwardBounds;
private Rectangle backBounds;
private Rectangle tankBounds;
private Rectangle energyBounds;
private boolean infoOpen;
private boolean canUpgrade;
private int infoWidth;
private int infoHeight;
private int forwardTime;
private int backTime;
private int lastPacket;
private int upgradeCheck;
private float expAlpha;
private boolean alphaMode;
private ErrorTab errorTab;
public GuiInfuser(ContainerInfuser container) {
super(container);
this.infuser = container.infuser;
this.container = container;
this.xSize = 176;
this.ySize = 209;
this.infoWidth = 208;
this.infoHeight = 175;
this.infoTab.maxWidth = 130;
this.infoTab.maxHeight = 120;
this.loadInfoStrings();
this.addTab(this.infoTab);
this.addTab(this.accessTab);
this.errorTab = new ErrorTab((Gui) this);
this.player = container.usingPlayer;
this.upgradeCheck = 0;
this.lastPacket = 0;
this.canUpgrade = false;
this.lastItem = null;
}
@Override
public void initGui() {
super.initGui();
this.goBounds = new Rectangle(this.guiLeft + 39, this.guiTop + 100, 13, 13);
this.infoBounds = new Rectangle(this.guiLeft + 123, this.guiTop + 16, 13, 13);
this.tankBounds = new Rectangle(this.guiLeft + 10, this.guiTop + 60, 16, 58);
this.energyBounds = new Rectangle(this.guiLeft + 152, this.guiTop + 11, 12, 107);
int posX = (this.width - this.infoWidth) / 2;
int posY = (this.height - this.infoHeight) / 2;
this.escapeBounds = new Rectangle(posX + 190, posY + 5, 13, 13);
this.backBounds = new Rectangle(posX + 160, posY + 5, 13, 13);
this.forwardBounds = new Rectangle(posX + 175, posY + 5, 13, 13);
}
private void loadInfoStrings() {
this.infoTab.addInfoString(
"The Force Infuser can be used to imbue your Force Tools with special upgrades that range from vanilla Fortune to auto grinding or even wacky side-effects."
);
this.infoTab.addInfoString(
"The Force Infuser requires both Liquid Force and a significant amount of Minecraft Joules to run."
);
// TODO
if (/*Config.requireExp*/ true) {
this.infoTab.addInfoString(
"The Force Infuser will take one level of experience from you for each upgrade material you want to use."
);
}
this.infoTab.addInfoString(
"Healing seems to have the opposite effect on undead creatures."
);
this.infoTab.addInfoString(
"Force Bows now have toggleable modes, just grab one and shift right click to change modes."
);
this.infoTab.addInfoString(
"Most Force Tools now have an \"Area\" mode that can be toggled by right-clicking with the tool in your hands. It may be slower, but it sure breaks a lot of blocks! Be sure to mind your durability."
);
this.infoTab.addInfoString(
"Upgrade materials show their upgrade in this Gui as a secondary tooltip in yellow. If a third tooltip is active that is the Tier at which the upgrade is unlocked."
);
this.infoTab.addInfoString(
"Yellow question marks in a tooltip means the Upgrade Tome has not yet seen this upgrade."
);
this.infoTab.addInfoString(
"Upgrade Tomes are created by right clicking a Book with a Force Rod."
);
this.infoTab.addInfoString(
"Experience Tomes can hold any amount of experience for the player, and are tradable to boot."
);
if (Loader.isModLoaded((String) "IC2")) {
this.infoTab.addInfoString(
"Try using your Force Rod on an Experience Tome, but don't expect to get it back..."
);
}
this.infoTab.addInfoString(
"Be careful with that button! Once you press it the only way to stop it is with a quick Force-Wrenching."
);
this.infoTab.addInfoString("Force Armor must be crafted out of Force Ingots.");
this.infoTab.addInfoString(
"Additional upgrade slots are unlocked by advancing your Upgrade Tome in tier."
);
this.infoTab.addInfoString("Ender Bows only work on players if PVP is enabled.");
this.infoTab.addInfoString(
"You're going to need Force Sticks, why not try your Force Rod on a sapling?"
);
this.infoTab.addInfoString("Use your Force Shears on other animals.");
if (Loader.isModLoaded((String) "Forestry")) {
this.infoTab.addInfoString(
"You can place Force Gems directly into the Force Infuser to get some Liquid Force, but you're better off squeezing them."
);
} else {
this.infoTab.addInfoString(
"You can place Force Gems directly into the Force Infuser and Force Engine to get some Liquid Force, although engines are terribly ineffective at extracting Liquid Force."
);
}
this.infoTab.addInfoString(
"Force Shard? What's all this junk? Force Shards provide 1 bucket of Liquid Force inside all DartCraft devices, but in the infuser they also give the Upgrade Tome a bonus 10 points."
);
this.infoTab.addInfoString(
"Using differing upgrades will help level your Upgrade Tome faster."
);
this.infoTab.addInfoString(
"Force Rods are upgraded directly in the Force Infuser."
);
if (Loader.isModLoaded((String) "BuildCraft|Transport")) {
this.infoTab.addInfoString(
"Did you know? You can pump Liquid Force back out of the Force Infuser!"
);
}
}
@Override
public void updateScreen() {
super.updateScreen();
if (this.lastPacket > 0) {
--this.lastPacket;
}
if (this.infuser != null
&& !ItemStack.areItemStacksEqual(
(ItemStack) this.infuser.getStackInSlot(2), (ItemStack) this.lastItem
)) {
this.lastItem = this.infuser.getStackInSlot(2) != null
? this.infuser.getStackInSlot(2).copy()
: null;
this.upgradeCheck = 0;
}
if (this.upgradeCheck > 0) {
--this.upgradeCheck;
} else {
if (this.infuser != null) {
this.canUpgrade
= this.infuser.canUpgrade((EntityPlayer) this.mc.thePlayer);
}
this.upgradeCheck = 20;
}
if (this.player != null && this.infuser == null) {
this.player.closeScreen();
}
if (this.infuser == null) {
return;
}
if (this.infuser.errorType != ErrorType.NONE
&& !this.tabListRight.contains(this.errorTab)) {
this.tabListRight.add(0, this.errorTab);
}
if (this.infuser.errorType == ErrorType.NONE
&& this.tabListRight.contains(this.errorTab)) {
this.tabListRight.remove(this.errorTab);
if (this.errorTab.isOpen()) {
this.errorTab.toggleOpen();
this.errorTab.close();
}
}
if (this.forwardTime > 0) {
--this.forwardTime;
}
if (this.backTime > 0) {
--this.backTime;
}
}
@Override
public void drawSlotItem(Slot slot, ItemStack stack, int i, int j, String s) {
GuiContainerManager.drawItems.renderItemAndEffectIntoGUI(
GuiDraw.fontRenderer, this.mc.getTextureManager(), stack, i, j
);
GuiContainerManager.drawItems.renderItemOverlayIntoGUI(
GuiDraw.fontRenderer, this.mc.getTextureManager(), stack, i, j, s
);
if (this.infoOpen && this.infoPage != null && this.infoPage.comp != null) {
try {
IForceUpgradeMaterial mat
= ForceUpgradeManager.getMaterialFromItemStack(stack);
ForceUpgrade upgrade = ForceUpgradeManager.getFromID(mat.getUpgradeID());
int index = upgrade.getMaterialIndex(mat);
if (index >= 0
&& this.infoPage.comp.getInteger(upgrade.getName() + index) <= 0
&& mat.isRequired()) {
float value = 0.0f;
GL11.glColor4f(
(float) value, (float) value, (float) value, (float) 1.0f
);
GuiScreen.itemRender.renderWithColor = false;
}
} catch (Exception e) {}
}
GuiScreen.itemRender.renderWithColor = true;
}
@Override
protected void mouseClicked(int x, int y, int button) {
Point pointerLoc = new Point(x, y);
if (this.infoOpen) {
if (this.escapeBounds.contains(pointerLoc) && this.infuser != null) {
this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(
new ResourceLocation("random.click")
));
this.setInfoVisible(false);
}
if (this.forwardBounds.contains(pointerLoc)) {
this.forwardTime = 5;
this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(
new ResourceLocation("random.click")
));
if (this.infoPage != null) {
this.infoPage.forwardPage();
}
}
if (this.backBounds.contains(pointerLoc)) {
this.backTime = 5;
this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(
new ResourceLocation("random.click")
));
if (this.infoPage != null) {
this.infoPage.backPage();
}
}
if (this.infoPage != null && this.infoPage.inventorySlots != null
&& this.infoPage.inventorySlots.size() > 0) {
for (Object obj : this.infoPage.inventorySlots.toArray()) {
if (!(obj instanceof Slot) || !this.isMouseOverSlot((Slot) obj, x, y))
continue;
Slot slot = (Slot) obj;
this.infoPage.setSelected(slot.slotNumber);
}
}
} else {
super.mouseClicked(x, y, button);
if (button == 0) {
if (this.goBounds.contains(pointerLoc) && this.infuser.totalProgress == 0
&& this.lastPacket <= 0 && this.canUpgrade) {
this.mc.getSoundHandler().playSound(
PositionedSoundRecord.func_147673_a(
new ResourceLocation("random.click")
)
);
this.lastPacket = 20;
Dartcraft.channel.sendToServer(new PacketInfuserStart());
}
if (this.infoBounds.contains(pointerLoc) && this.infuser != null) {
this.mc.getSoundHandler().playSound(
PositionedSoundRecord.func_147673_a(
new ResourceLocation("random.click")
)
);
this.setInfoVisible(true);
}
}
}
}
private void setInfoVisible(boolean visible) {
if (visible) {
this.showTabs = false;
this.infoOpen = true;
int offsetX = this.xSize / 2 - this.infoWidth / 2 + 1;
int offsetY = this.ySize / 2 - this.infoHeight / 2 + 1;
this.infoPage = new ContainerInfoPage(this.infuser, offsetX, offsetY);
this.inventorySlots = this.infoPage;
} else {
this.inventorySlots = this.container;
this.mc.thePlayer.openContainer = this.container;
this.infoOpen = false;
this.showTabs = true;
}
}
@Override
public List<String> handleItemTooltip(
GuiContainer gui, ItemStack stack, int x, int y, List<String> tooltip
) {
IForceUpgradeMaterial mat;
Point pointerLoc = new Point(x, y);
if (this.infoOpen) {
if (this.escapeBounds.contains(pointerLoc)) {
tooltip.add("Return");
}
if (this.forwardBounds.contains(pointerLoc)) {
tooltip.add("Next Page");
}
if (this.backBounds.contains(pointerLoc)) {
tooltip.add("Previous Page");
}
} else {
if (this.goBounds.contains(pointerLoc)) {
tooltip.add("Go");
}
if (this.infoBounds.contains(pointerLoc)) {
tooltip.add("Info");
}
if (this.tankBounds.contains(pointerLoc) && this.infuser != null
&& this.infuser.getFluid() != null) {
tooltip.add("§eLiquid Force§f (" + this.infuser.getFluid().amount + ")");
}
if (this.energyBounds.contains(pointerLoc)) {
tooltip.add(this.infuser.storedRF + " RF");
}
}
if (stack != null
&& (mat = ForceUpgradeManager.getMaterialFromItemStack(stack)) != null) {
if (tooltip.size() > 1) {
for (int i = tooltip.size() - 1; i > 0; --i) {
tooltip.remove(i);
}
}
NBTTagCompound comp = new NBTTagCompound();
if (this.infuser != null && this.infuser.getStackInSlot(0) != null
&& this.infuser.getStackInSlot(0).hasTagCompound()) {
comp = this.infuser.getStackInSlot(0).getTagCompound();
}
ForceUpgrade upgrade = ForceUpgradeManager.getFromID(mat.getUpgradeID());
int upgradeIndex = upgrade.getMaterialIndex(mat);
if (upgrade.getTier() > 0) {
String name = "";
if (comp.getInteger(upgrade.getName() + upgradeIndex) <= 0
&& mat.isRequired()) {
if (this.infoOpen) {
tooltip.clear();
}
name = "????";
} else {
name = upgrade.getName();
}
tooltip.add("\u00a7e" + name);
int tier = ForceUpgradeManager.getFromID(mat.getUpgradeID()).getTier();
if (tier > this.infuser.getActiveTier()) {
tooltip.add("\u00a7bTier " + tier);
}
}
}
return tooltip;
}
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
int height;
GL11.glColor4f((float) 1.0f, (float) 1.0f, (float) 1.0f, (float) 1.0f);
Dartcraft.proxy.bindTexture("infuserGui.png");
int posX = (this.width - this.xSize) / 2;
int posY = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(posX, posY, 0, 0, this.xSize, this.ySize);
if (this.infuser != null && this.infuser.getFluid() != null
&& this.infuser.getFluid().amount > 0) {
this.displayGauge(
this.tankBounds.x, this.tankBounds.y, this.infuser.getFluid()
);
}
if (this.infuser != null) {
height = (int) (107.0f * this.infuser.storedRF
/ (float) this.infuser.getMaxEnergyStored(null));
this.drawTexturedModalRect(
this.guiLeft + 152,
this.guiTop + 11 + (107 - height),
176,
20 + (107 - height),
12,
height
);
}
if (this.infuser != null) {
this.drawTexturedModalRect(
this.infoBounds.x,
this.infoBounds.y,
201,
0,
this.infoBounds.width,
this.infoBounds.height
);
if (this.infuser.errorType == ErrorType.EXP) {
float step = (this.alphaMode ? 1.0f : -1.0f) * 0.01f;
this.expAlpha += step;
if (this.expAlpha <= 0.33f || this.expAlpha >= 1.0f) {
this.alphaMode = !this.alphaMode;
}
GL11.glColor4f(
(float) 1.0f, (float) 1.0f, (float) 1.0f, (float) this.expAlpha
);
this.fontRendererObj.drawString(
"EXP: " + this.infuser.getRequiredExp(),
posX + 39,
posY + 15,
0x606060,
true
);
GL11.glColor4f((float) 1.0f, (float) 1.0f, (float) 1.0f, (float) 1.0f);
Dartcraft.proxy.bindTexture("infusuerGui.png");
}
}
if (this.infuser != null && this.canUpgrade || this.infuser.progress > 0) {
if (this.infuser.progress > 0) {
this.drawTexturedModalRect(
this.guiLeft + 39, this.guiTop + 101, 188, 13, 13, 13
);
height = this.infuser.totalProgress != 0
? 20 * this.infuser.progress / this.infuser.totalProgress
: 20;
this.drawTexturedModalRect(
this.guiLeft + 134,
this.guiTop + 93 + (20 - ++height),
176,
0 + (20 - height),
2,
height
);
} else {
this.drawTexturedModalRect(
this.guiLeft + 39, this.guiTop + 101, 188, 0, 13, 13
);
}
}
if (this.infoOpen && this.infuser != null) {
GL11.glColor4f((float) 0.25f, (float) 0.25f, (float) 0.25f, (float) 1.0f);
this.drawTexturedModalRect(posX, posY, 0, 0, this.xSize, this.ySize);
GL11.glColor4f((float) 1.0f, (float) 1.0f, (float) 1.0f, (float) 1.0f);
Dartcraft.proxy.bindTexture("infuserInfo.png");
NBTTagCompound comp = new NBTTagCompound();
if (this.infuser.getStackInSlot(0) != null
&& this.infuser.getStackInSlot(0).hasTagCompound()) {
comp = this.infuser.getStackInSlot(0).getTagCompound();
}
posX = (this.width - this.infoWidth) / 2;
posY = (this.height - this.infoHeight) / 2;
this.drawTexturedModalRect(posX, posY, 0, 0, this.infoWidth, this.infoHeight);
if (this.forwardTime > 0) {
this.drawTexturedModalRect(
this.forwardBounds.x,
this.forwardBounds.y,
0,
229,
this.forwardBounds.width,
this.forwardBounds.height
);
}
if (this.backTime > 0) {
this.drawTexturedModalRect(
this.backBounds.x,
this.backBounds.y,
0,
216,
this.backBounds.width,
this.backBounds.height
);
}
if (this.infoPage != null) {
Slot slot;
IForceUpgradeMaterial mat = null;
if (this.infoPage.selected >= 0
&& this.infoPage.selected < this.inventorySlots.inventorySlots.size()
&& (slot = this.inventorySlots.getSlot(this.infoPage.selected))
!= null
&& slot.getHasStack()) {
this.drawTexturedModalRect(
posX - this.infoPage.offsetX + slot.xDisplayPosition - 3,
posY - this.infoPage.offsetY + slot.yDisplayPosition - 3,
208,
0,
24,
24
);
mat = ForceUpgradeManager.getMaterialFromItemStack(slot.getStack());
}
boolean usedMaterial = false;
ForceUpgrade upgrade = null;
if (mat != null) {
upgrade = ForceUpgradeManager.getFromID(mat.getUpgradeID());
int color = 0xFFFFFF;
int index = upgrade.getMaterialIndex(mat);
usedMaterial = comp.getInteger(upgrade.getName() + index) > 0
|| !mat.isRequired();
String descr = "";
descr = usedMaterial && upgrade.getTier() > 0
? upgrade.getDescription()
: mat.getDescription();
int maxWidth = 163;
int rows = this.fontRendererObj.getStringWidth(descr) / maxWidth;
int remainder = this.fontRendererObj.getStringWidth(descr) % maxWidth;
GL11.glColor4f(
(float) 1.0f, (float) 1.0f, (float) 1.0f, (float) 1.0f
);
if (rows == 0) {
this.fontRendererObj.drawString(
descr, posX + 23, posY + 30, color
);
} else {
this.fontRendererObj.drawSplitString(
descr, posX + 23, posY + 30, maxWidth, color
);
}
}
String name = "Unknown Upgrade";
if (usedMaterial && upgrade != null && upgrade.getTier() > 0) {
name = "[" + upgrade.getName() + "] Tier: " + upgrade.getTier()
+ " Mlvl: " + upgrade.getMaxLevel();
}
if (upgrade != null && upgrade.getTier() == 0) {
name = "Information";
}
this.fontRendererObj.drawString(
name, posX + 15, posY + 7, 0x636363, false
);
}
}
}
private void displayGauge(int x, int y, FluidStack liquid) {
int tempx;
if (liquid == null) {
return;
}
int start = 0;
int squaled = (int) (58.0f * (float) liquid.amount / 50000.0f);
Minecraft.getMinecraft().getTextureManager().bindTexture(
TextureMap.locationBlocksTexture
);
do {
tempx = 0;
if (squaled > 16) {
tempx = 16;
squaled -= 16;
} else {
tempx = squaled;
squaled = 0;
}
IIcon icon = liquid != null && liquid.getFluid() != null
? liquid.getFluid().getIcon()
: null;
if (icon == null) {
icon = ((BlockLiquidForce) DartBlocks.liquidforce).still;
}
this.drawTexturedModelRectFromIcon(
x, y + 58 - tempx - start, icon, 16, 16 - (16 - tempx)
);
start += 16;
} while (tempx != 0 && squaled != 0);
Dartcraft.proxy.bindTexture("infuserGui.png");
this.drawTexturedModalRect(this.guiLeft + 10, this.guiTop + 60, 188, 26, 16, 58);
}
private class ErrorTab extends Tab {
public static final int ERROR_TOME = 1;
private int type;
public ErrorTab(Gui gui) {
super(gui);
this.leftSide = false;
this.overlayColor = 0xFF0000;
this.maxHeight = 90;
this.maxWidth = 100;
}
public void close() {
this.currentHeight = this.minHeight;
this.currentWidth = this.minWidth;
}
@Override
public void draw(int x, int y) {
if (GuiInfuser.this.infoOpen) {
return;
}
this.drawBackground(x, y);
this.drawIcon("items.png", 18, x + 2, y + 2);
if (!this.isFullyOpened()) {
return;
}
tabFontRenderer.drawStringWithShadow("Error", x + 22, y + 6, 0xFFFFFF);
tabFontRenderer.drawSplitString(
this.getInfo(), x + 8, y + 20, this.maxWidth - 14, 0
);
}
private String getInfo() {
try {
switch (((GuiInfuser) GuiInfuser.this).infuser.errorType) {
case ENERGY: {
return "Insufficient Energy.";
}
case EXP: {
return "Insufficient Experience.";
}
case FORBIDDEN: {
return "This action is not permitted.";
}
case FORCE: {
return "Insufficient Liquid Force.";
}
case INVALID: {
return "Cannot apply these upgrades.";
}
case USER: {
return "You cannot use someone else's infuser!";
}
}
} catch (Exception exception) {
// empty catch block
}
return "You'll need an Upgrade Tome in the top-leftmost slot to get anything useful done.";
}
@Override
public String getTooltip() {
return null;
}
}
@Override
public List<String>
handleTooltip(GuiContainer gui, int mousex, int mousey, List<String> currenttip) {
return currenttip;
}
@Override
public List<String> handleItemDisplayName(
GuiContainer gui, ItemStack itemstack, List<String> currenttip
) {
return currenttip;
}
}

View file

@ -0,0 +1,260 @@
package ley.modding.dartcraft.client.gui;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import com.google.common.collect.ImmutableList;
import codechicken.nei.VisiblityData;
import codechicken.nei.api.INEIGuiHandler;
import codechicken.nei.api.TaggedInventoryArea;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.api.AccessLevel;
import ley.modding.dartcraft.client.gui.tabs.GuiTab;
import ley.modding.dartcraft.client.gui.tabs.Tab;
import ley.modding.dartcraft.network.PacketDesocket;
import ley.modding.dartcraft.network.PacketUpdateAccessLevel;
import ley.modding.dartcraft.plugin.DartPluginFortunes;
import net.anvilcraft.anvillib.usercache.UserCache;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class GuiMachine extends GuiTab implements INEIGuiHandler {
public ContainerMachine machine;
protected InfoTab infoTab;
protected AccessTab accessTab;
protected boolean showTabs;
public GuiMachine(ContainerMachine machine) {
super(machine);
this.machine = machine;
this.infoTab = new InfoTab((Gui) this);
this.accessTab = new AccessTab((Gui) this);
this.showTabs = true;
}
@Override
public void updateScreen() {
super.updateScreen();
if (this.machine == null
|| !this.machine.canInteractWith((EntityPlayer) this.mc.thePlayer)
|| this.machine.machine == null || this.machine.machine.isInvalid()) {
this.mc.thePlayer.closeScreen();
}
}
@Override
public void handleMouseClick(Slot slot, int index, int button, int par4) {
super.handleMouseClick(slot, index, button, par4);
if (this.machine == null || this.machine.machine == null) {
return;
}
if (slot != null && slot.getHasStack()
&& button == 1
//&& slot.getStack().getItem() instanceof ItemUpgradeCore
&& index == this.machine.machine.socketSlot) {
if (Keyboard.isKeyDown((int) 42) || Keyboard.isKeyDown((int) 54)) {
Dartcraft.channel.sendToServer(new PacketDesocket(index));
this.machine.desocket();
}
}
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {}
@Override
public VisiblityData
modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility) {
currentVisibility.showNEI = false;
return currentVisibility;
}
@Override
public Iterable<Integer> getItemSpawnSlots(GuiContainer gui, ItemStack item) {
return ImmutableList.of();
}
@Override
public List<TaggedInventoryArea> getInventoryAreas(GuiContainer gui) {
return null;
}
@Override
public boolean
handleDragNDrop(GuiContainer gui, int x, int y, ItemStack stack, int button) {
return false;
}
@Override
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) {
return false;
}
@Override
protected void drawTooltips() {}
protected class AccessTab extends Tab {
private Rectangle accessBounds;
public AccessTab(Gui gui) {
super(gui);
this.maxHeight = 90;
this.maxWidth = 110;
this.overlayColor = 0xffe49f;
this.accessBounds = new Rectangle(10, 20, 85, 59);
}
@Override
public void draw(int x, int y) {
if (!GuiMachine.this.showTabs) {
return;
}
this.drawBackground(x, y);
if (this.leftSide) {
this.drawIcon("items.png", 17, x - 18, y + 2);
x -= this.maxWidth;
} else {
this.drawIcon("items.png", 17, x + 2, y + 2);
}
if (!this.isFullyOpened()) {
return;
}
GL11.glColor4f((float) 1.0f, (float) 1.0f, (float) 1.0f, (float) 1.0f);
Dartcraft.proxy.bindTexture("furnaceGui.png");
GuiMachine.this.drawTexturedModalRect(x + 10, y + 20, 0, 166, 85, 59);
int posX = this.leftSide ? x
+ ((this.maxWidth - 16) / 2
- GuiMachine.this.fontRendererObj.getStringWidth("Access") / 2)
: x + 23;
tabFontRenderer.drawStringWithShadow("Access", posX, y + 7, 0xFFFFFF);
tabFontRenderer.drawString("Owner:", x + 18, y + 26, 0xFFFFFF);
String ownerName
= UserCache.INSTANCE.getCached(GuiMachine.this.machine.machine.getOwner()
);
tabFontRenderer.drawStringWithShadow(
ownerName == null ? "<unknown>" : ownerName, x + 18, y + 36, 0x606060
);
AccessLevel access = GuiMachine.this.machine.machine.getAccessLevel();
tabFontRenderer.drawStringWithShadow(
access.displayName, x + 22, y + 50, 0x808080
);
}
@Override
public boolean handleMouseClicked(int x, int y, int mouseButton) {
Point point;
if (!GuiMachine.this.showTabs) {
return false;
}
int posX = !this.leftSide
? this.currentShiftX + this.accessBounds.x
: this.currentShiftX + this.accessBounds.x - this.maxWidth;
Rectangle checkBounds = new Rectangle(
posX,
this.currentShiftY + this.accessBounds.y,
this.accessBounds.width,
this.accessBounds.height
);
if (checkBounds.contains(point = new Point(x, y))) {
try {
if (GuiMachine.this.machine.machine.getOwner().equals(
GuiMachine.this.mc.thePlayer.getUniqueID()
)) {
AccessLevel level = GuiMachine.this.machine.machine.access.next();
GuiMachine.this.machine.machine.access = level;
Dartcraft.channel.sendToServer(new PacketUpdateAccessLevel(level)
);
}
} catch (Exception e) {}
return true;
}
return false;
}
@Override
public String getTooltip() {
return null;
}
}
protected class InfoTab extends Tab {
public ArrayList<String> infoStrings;
private String currentInfo;
private int index;
public InfoTab(Gui gui) {
super(gui);
this.infoStrings = new ArrayList<>();
this.leftSide = false;
this.overlayColor = 1217260;
this.maxHeight = 110;
this.maxWidth = 110;
this.currentInfo = this.getRandomItem();
this.index = -1;
}
public void addInfoString(String info) {
this.infoStrings.add(info);
}
@Override
public void toggleOpen() {
super.toggleOpen();
if (this.isOpen()) {
++this.index;
if (this.index > this.infoStrings.size()) {
this.index = 0;
}
try {
this.currentInfo = this.infoStrings.get(this.index);
} catch (Exception e) {
this.currentInfo = this.getRandomItem();
}
}
}
@Override
public void draw(int x, int y) {
if (!GuiMachine.this.showTabs) {
return;
}
this.drawBackground(x, y);
if (this.leftSide) {
this.drawIcon("items.png", 0, x - 18, y + 2);
x -= this.maxWidth;
} else {
this.drawIcon("items.png", 0, x + 2, y + 2);
}
if (!this.isFullyOpened()) {
return;
}
int posX = this.leftSide ? x
+ ((this.maxWidth - 16) / 2
- GuiMachine.this.fontRendererObj.getStringWidth("Information") / 2
)
: x + 22;
tabFontRenderer.drawStringWithShadow("Information", posX, y + 6, 0xFFFFFF);
tabFontRenderer.drawSplitString(
this.currentInfo, x + 8, y + 20, this.maxWidth - 14, 0
);
}
private String getRandomItem() {
return DartPluginFortunes.getFortune();
}
@Override
public String getTooltip() {
return null;
}
}
}

View file

@ -0,0 +1,7 @@
package ley.modding.dartcraft.client.gui;
public enum GuiType {
CLIPBOARD,
ENGINE,
INFUSER;
}

View file

@ -1,13 +1,14 @@
package ley.modding.dartcraft.client.gui.tabs;
import java.util.ArrayList;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
public abstract class GuiTab extends GuiContainer {
protected enum SlotColor {
@ -23,7 +24,7 @@ public abstract class GuiTab extends GuiContainer {
//SINGLE, OUTPUT, DOUBLEOUTPUT;
TOP,
BOTTOM,
FULL
FULL;
}
protected enum SlotRender {
@ -58,7 +59,8 @@ public abstract class GuiTab extends GuiContainer {
super(container);
}
protected void func_74189_g(int i, int j) {
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
GL11.glDisable(2896);
GL11.glDisable(2929);
drawTabs(this.mouseX, this.mouseY);
@ -115,7 +117,7 @@ public abstract class GuiTab extends GuiContainer {
offsetY += sizeY;
break;
}
drawTexturedModalRect(x, y, offsetX, offsetY, sizeX, sizeY);
this.drawTexturedModalRect(x, y, offsetX, offsetY, sizeX, sizeY);
}
protected void drawColoredSlotWithBorder(
@ -217,6 +219,7 @@ public abstract class GuiTab extends GuiContainer {
return (xWidth - fontRendererObj.getStringWidth(string)) / 2;
}
@Override
protected void mouseClicked(int x, int y, int mouseButton) {
super.mouseClicked(x, y, mouseButton);
Tab tab = getTabAtPosition(this.mouseX, this.mouseY);
@ -237,6 +240,7 @@ public abstract class GuiTab extends GuiContainer {
}
}
@Override
public void handleMouseInput() {
int x = Mouse.getEventX() * this.width / this.mc.displayWidth;
int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;

View file

@ -0,0 +1,60 @@
package ley.modding.dartcraft.client.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
public class ModelInfuser extends ModelBase {
public ModelRenderer leg1;
public ModelRenderer leg2;
public ModelRenderer leg3;
public ModelRenderer leg4;
public ModelRenderer table_top;
public ModelRenderer tank;
public ModelInfuser() {
this.textureWidth = 64;
this.textureHeight = 128;
this.leg1 = new ModelRenderer((ModelBase) this, 56, 39);
this.leg1.addBox(0.0f, -7.0f, 4.0f, 2, 5, 2);
this.leg1.setRotationPoint(-7.0f, 15.0f, -11.0f);
this.leg1.setTextureSize(64, 128);
this.leg1.mirror = true;
this.setRotation(this.leg1, 0.0f, 0.0f, 0.0f);
this.leg2 = new ModelRenderer((ModelBase) this, 56, 12);
this.leg2.addBox(0.0f, -7.0f, 4.0f, 2, 5, 2);
this.leg2.setRotationPoint(5.0f, 15.0f, 1.0f);
this.leg2.setTextureSize(64, 128);
this.leg2.mirror = true;
this.setRotation(this.leg2, 0.0f, 0.0f, 0.0f);
this.leg3 = new ModelRenderer((ModelBase) this, 56, 0);
this.leg3.addBox(0.0f, -7.0f, 4.0f, 2, 5, 2);
this.leg3.setRotationPoint(-7.0f, 15.0f, 1.0f);
this.leg3.setTextureSize(64, 128);
this.leg3.mirror = true;
this.setRotation(this.leg3, 0.0f, 0.0f, 0.0f);
this.leg4 = new ModelRenderer((ModelBase) this, 56, 27);
this.leg4.addBox(0.0f, 0.0f, 0.0f, 2, 5, 2);
this.leg4.setRotationPoint(5.0f, 8.0f, -7.0f);
this.leg4.setTextureSize(64, 128);
this.leg4.mirror = true;
this.setRotation(this.leg4, 0.0f, 0.0f, 0.0f);
this.table_top = new ModelRenderer((ModelBase) this, 0, 0);
this.table_top.addBox(0.0f, 0.0f, 0.0f, 14, 5, 14);
this.table_top.setRotationPoint(-7.0f, 13.0f, -7.0f);
this.table_top.setTextureSize(64, 128);
this.table_top.mirror = true;
this.setRotation(this.table_top, 0.0f, 0.0f, 0.0f);
this.tank = new ModelRenderer((ModelBase) this, 0, 23);
this.tank.addBox(0.0f, -1.0f, 0.0f, 12, 2, 12);
this.tank.setRotationPoint(-6.0f, 19.0f, -6.0f);
this.tank.setTextureSize(64, 128);
this.tank.mirror = true;
this.setRotation(this.tank, 0.0f, 0.0f, 0.0f);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -0,0 +1,68 @@
package ley.modding.dartcraft.client.renderer.item;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
public class CustomItemRenderer extends RenderItem {
@Override
public void renderItemOverlayIntoGUI(
FontRenderer fonty,
TextureManager manager,
ItemStack stack,
int par4,
int par5,
String name
) {
if (stack != null) {
if (stack.stackSize > 1 || name != null) {
String s1 = name == null ? String.valueOf(stack.stackSize) : name;
GL11.glDisable((int) 2896);
GL11.glDisable((int) 2929);
fonty.drawStringWithShadow(
s1, par4 + 19 - 2 - fonty.getStringWidth(s1), par5 + 6 + 3, 0xFFFFFF
);
GL11.glEnable((int) 2896);
}
if (stack.isItemDamaged()) {
int k = (int) Math.round(
13.0
- (double) stack.getItemDamageForDisplay() * 13.0
/ (double) stack.getMaxDamage()
);
int l = (int) Math.round(
255.0
- (double) stack.getItemDamageForDisplay() * 255.0
/ (double) stack.getMaxDamage()
);
GL11.glDisable((int) 2896);
GL11.glDisable((int) 2929);
GL11.glDisable((int) 3553);
Tessellator tessellator = Tessellator.instance;
int i1 = 255 - l << 16 | l << 8;
int j1 = (255 - l) / 4 << 16 | 0x3F00;
this.renderQuad(tessellator, par4 + 2, par5 + 13, 13, 2, 0);
this.renderQuad(tessellator, par4 + 2, par5 + 13, 12, 1, j1);
this.renderQuad(tessellator, par4 + 2, par5 + 13, k, 1, i1);
GL11.glEnable((int) 3553);
GL11.glEnable((int) 2896);
GL11.glEnable((int) 2929);
GL11.glColor4f((float) 1.0f, (float) 1.0f, (float) 1.0f, (float) 1.0f);
}
}
}
private void
renderQuad(Tessellator tessy, int par2, int par3, int par4, int par5, int par6) {
tessy.startDrawingQuads();
tessy.setColorOpaque_I(par6);
tessy.addVertex((double) (par2 + 0), (double) (par3 + 0), 0.0);
tessy.addVertex((double) (par2 + 0), (double) (par3 + par5), 0.0);
tessy.addVertex((double) (par2 + par4), (double) (par3 + par5), 0.0);
tessy.addVertex((double) (par2 + par4), (double) (par3 + 0), 0.0);
tessy.draw();
}
}

View file

@ -0,0 +1,39 @@
package ley.modding.dartcraft.client.renderer.item;
import ley.modding.dartcraft.proxy.ClientProxy;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
public class RenderItemInfuser implements IItemRenderer {
public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) {
return true;
}
public boolean shouldUseRenderHelper(
IItemRenderer.ItemRenderType type,
ItemStack item,
IItemRenderer.ItemRendererHelper helper
) {
return true;
}
public void
renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
TileEntityInfuser infuser = null;
if (item != null && item.hasTagCompound()) {
infuser = (TileEntityInfuser
) TileEntity.createAndLoadEntity((NBTTagCompound) item.getTagCompound());
infuser.bookSpread = 0.5f;
infuser.pageFlip = 0.5f;
}
if (type == IItemRenderer.ItemRenderType.EQUIPPED
|| type == IItemRenderer.ItemRenderType.INVENTORY) {
ClientProxy.infuserRender.render(infuser, 0.0, 0.0, 0.0, 0.0f);
} else {
ClientProxy.infuserRender.render(infuser, -0.5, -0.5, -0.5, 0.0f);
}
}
}

View file

@ -0,0 +1,46 @@
package ley.modding.dartcraft.client.renderer.item;
import ley.modding.dartcraft.client.IconDirectory;
import ley.modding.dartcraft.tile.TileEntityMachine;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.IItemRenderer;
public class RenderItemMachine implements IItemRenderer {
private static RenderItem renderer = new RenderItem();
public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) {
return type == IItemRenderer.ItemRenderType.INVENTORY;
}
public boolean shouldUseRenderHelper(
IItemRenderer.ItemRenderType type,
ItemStack item,
IItemRenderer.ItemRendererHelper helper
) {
return false;
}
public void
renderItem(IItemRenderer.ItemRenderType type, ItemStack stack, Object... data) {
IIcon icon = stack.getIconIndex();
//if (stack.getItemDamage() >= 128) {
// DartCraftClient.renderCamo.renderItem(type, stack, data);
// return;
//}
if (stack.getItemDamage() >= 0 && stack.getItemDamage() < 16) {
icon = IconDirectory.furnaces[stack.getItemDamage()];
} else {
TileEntityMachine machine = (TileEntityMachine
) TileEntity.createAndLoadEntity((NBTTagCompound) stack.getTagCompound());
icon = IconDirectory.machines[machine.color];
}
if (icon != null) {
renderer.renderIcon(3, 3, icon, 10, 10);
}
}
}

View file

@ -1,4 +1,4 @@
package ley.modding.dartcraft.client.renderer.block;
package ley.modding.dartcraft.client.renderer.tile;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.client.model.ModelEngine;
@ -9,7 +9,7 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
public class RenderTileForceEngine extends TileEntitySpecialRenderer {
public class RenderTileEntityForceEngine extends TileEntitySpecialRenderer {
private static ModelRenderer base;
static ModelBase model = new ModelBase() {

View file

@ -0,0 +1,103 @@
package ley.modding.dartcraft.client.renderer.tile;
import java.awt.Color;
import org.lwjgl.opengl.GL11;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.client.model.ModelInfuser;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import ley.modding.dartcraft.util.DartUtils;
import net.minecraft.client.model.ModelBook;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
public class RenderTileEntityInfuser extends TileEntitySpecialRenderer {
private ModelInfuser model = new ModelInfuser();
private ModelBook book = new ModelBook();
public RenderTileEntityInfuser() {}
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
if (!(te instanceof TileEntityInfuser)) {
return;
}
TileEntityInfuser infuser = (TileEntityInfuser) te;
this.render(infuser, x, y, z, f);
}
public void render(TileEntityInfuser infuser, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glDisable((int) 2896);
GL11.glTranslated((double) (x + 0.5), (double) (y - 0.46), (double) (z + 0.5));
Dartcraft.proxy.bindTexture("infuserModel.png");
float scale = 0.058f;
int color = infuser != null ? infuser.color : 0;
Color col = new Color(DartUtils.getMcColor(color));
GL11.glColor4f(
(float) ((float) col.getRed() / 255.0f),
(float) ((float) col.getGreen() / 255.0f),
(float) ((float) col.getBlue() / 255.0f),
(float) 1.0f
);
this.model.leg1.render(scale);
this.model.leg2.render(scale);
this.model.leg3.render(scale);
this.model.leg4.render(scale);
this.model.table_top.render(scale);
this.model.tank.render(scale);
GL11.glColor4f((float) 1.0f, (float) 1.0f, (float) 1.0f, (float) 1.0f);
if (infuser != null && infuser.hasTome) {
this.renderBook(infuser, x, y, z, f);
}
GL11.glEnable((int) 2896);
GL11.glPopMatrix();
}
private void
renderBook(TileEntityInfuser infuser, double x, double y, double z, float f) {
float var10;
float var9 = infuser != null && infuser.getWorldObj() != null
? (float) infuser.getWorldObj().getWorldTime() + f
: 0.0f;
GL11.glTranslated((double) 0.0, (double) 1.25, (double) 0.0);
for (var10 = infuser.bookRotation2 - infuser.bookRotationPrev; var10 >= 3.141593f;
var10 -= 6.283186f) {}
while (var10 < -3.141593f) {
var10 += 6.283186f;
}
float var11 = infuser.bookRotationPrev + var10 * f;
GL11.glRotatef(
(float) (-var11 * 180.0f / 3.141593f),
(float) 0.0f,
(float) 1.0f,
(float) 0.0f
);
GL11.glRotatef((float) 80.0f, (float) 0.0f, (float) 0.0f, (float) 1.0f);
Dartcraft.proxy.bindTexture("dartBook.png");
float var12 = infuser.pageFlipPrev + (infuser.pageFlip - infuser.pageFlipPrev) * f
+ 0.25f;
float var13 = infuser.pageFlipPrev + (infuser.pageFlip - infuser.pageFlipPrev) * f
+ 0.75f;
var12 = (var12 - (float) MathHelper.truncateDoubleToInt((double) var12)) * 1.6f;
var13 = (var13 - (float) MathHelper.truncateDoubleToInt((double) var13)) * 1.6f
- 0.3f;
if (var12 < 0.0f) {
var12 = 0.0f;
}
if (var13 < 0.0f) {
var13 = 0.0f;
}
if (var12 > 1.0f) {
var12 = 1.0f;
}
if (var13 > 1.0f) {
var13 = 1.0f;
}
float var14
= infuser.bookSpreadPrev + (infuser.bookSpread - infuser.bookSpreadPrev) * f;
this.book.render((Entity) null, var9, var12, var13, var14, 0.0f, 0.0625f);
}
}

View file

@ -0,0 +1,240 @@
package ley.modding.dartcraft.entity;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class EntityInvincibleItem extends EntityItem {
private boolean canDespawn;
private boolean canBurn;
private int life;
public EntityInvincibleItem(World world) {
super(world);
}
public EntityInvincibleItem(
World world, double x, double y, double z, ItemStack contents, int timeout
) {
super(world, x, y, z);
this.delayBeforeCanPickup = 40;
this.setEntityItemStack(contents);
this.life = timeout;
this.canDespawn = timeout > 0;
}
public void setCanBurn() {
this.canBurn = true;
}
@Override
public void writeEntityToNBT(NBTTagCompound comp) {
super.writeEntityToNBT(comp);
comp.setBoolean("canDespawn", this.canDespawn);
comp.setInteger("life", this.life);
comp.setBoolean("canBurn", this.canBurn);
}
@Override
public void readEntityFromNBT(NBTTagCompound comp) {
super.readEntityFromNBT(comp);
this.canDespawn = comp.getBoolean("canDespawn");
this.life = comp.getInteger("life");
this.canBurn = comp.getBoolean("canBurn");
}
@Override
public void onUpdate() {
if (this.delayBeforeCanPickup > 0) {
--this.delayBeforeCanPickup;
}
if (this.canDespawn) {
--this.life;
if (this.life <= 0) {
this.setDead();
}
}
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.motionY -= 0.03999999910593033D;
this.noClip = this.func_145771_j( // pushOutOfBlocks
this.posX,
(this.boundingBox.minY + this.boundingBox.maxY) / 2.0D,
this.posZ
);
this.moveEntity(this.motionX, this.motionY, this.motionZ);
boolean var1 = (int) this.prevPosX != (int) this.posX
|| (int) this.prevPosY != (int) this.posY
|| (int) this.prevPosZ != (int) this.posZ;
if (var1 || this.ticksExisted % 25 == 0) {
if (this.worldObj
.getBlock(
MathHelper.floor_double(this.posX),
MathHelper.floor_double(this.posY),
MathHelper.floor_double(this.posZ)
)
.getMaterial()
== Material.lava) {
this.playSound(
"dartcraft:sparkle", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F
);
}
if (!this.worldObj.isRemote) {
this.aggregate();
}
}
float motionMul = 0.98F;
if (this.onGround) {
motionMul = 0.58800006F;
Block belowBlock = this.worldObj.getBlock(
MathHelper.floor_double(this.posX),
MathHelper.floor_double(this.boundingBox.minY) - 1,
MathHelper.floor_double(this.posZ)
);
motionMul = belowBlock.slipperiness * 0.98F;
}
this.motionX *= (double) motionMul;
this.motionY *= 0.9800000190734863D;
this.motionZ *= (double) motionMul;
if (this.onGround) {
this.motionY *= -0.5D;
}
ItemStack var4 = this.getDataWatcher().getWatchableObjectItemStack(10);
if (var4 != null && var4.stackSize <= 0) {
this.setDead();
}
}
@Override
protected void dealFireDamage(int damage) {}
@Override
public boolean attackEntityFrom(DamageSource source, float amount) {
return false;
}
// TODO: WTF
//@Override
//protected void simulateLivingUpdate() {
// this.worldObj.theProfiler.startSection("entityBaseTick");
// if (this.ridingEntity != null && this.ridingEntity.isDead) {
// this.ridingEntity = null;
// }
// this.prevDistanceWalkedModified = this.distanceWalkedModified;
// this.prevPosX = this.posX;
// this.prevPosY = this.posY;
// this.prevPosZ = this.posZ;
// this.prevRotationPitch = this.rotationPitch;
// this.prevRotationYaw = this.rotationYaw;
// int var2;
// if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) {
// this.worldObj.theProfiler.startSection("portal");
// MinecraftServer var5 = ((WorldServer) this.worldObj).getMinecraftServer();
// var2 = this.getMaxInPortalTime();
// if (this.inPortal) {
// if (var5.getAllowNether()) {
// if (this.ridingEntity == null && this.timeInPortal++ >= var2) {
// this.timeInPortal = var2;
// this.timeUntilPortal = this.getPortalCooldown();
// byte var6;
// if (this.worldObj.provider.dimensionId == -1) {
// var6 = 0;
// } else {
// var6 = -1;
// }
// this.travelToDimension(var6);
// }
// this.inPortal = false;
// }
// } else {
// if (this.timeInPortal > 0) {
// this.timeInPortal -= 4;
// }
// if (this.timeInPortal < 0) {
// this.timeInPortal = 0;
// }
// }
// if (this.timeUntilPortal > 0) {
// --this.timeUntilPortal;
// }
// this.worldObj.theProfiler.endSection();
// }
// if (this.isSprinting() && !this.isInWater()) {
// int var51 = MathHelper.floor_double(this.posX);
// var2 = MathHelper.floor_double(
// this.posY - 0.20000000298023224D - (double) this.yOffset
// );
// int var61 = MathHelper.floor_double(this.posZ);
// int var4 = this.worldObj.getBlockId(var51, var2, var61);
// if (var4 > 0) {
// this.worldObj.spawnParticle(
// "tilecrack_" + var4 + "_"
// + this.worldObj.getBlockMetadata(var51, var2, var61),
// this.posX
// + ((double) this.rand.nextFloat() - 0.5D) * (double) this.width,
// this.boundingBox.minY + 0.1D,
// this.posZ
// + ((double) this.rand.nextFloat() - 0.5D) * (double) this.width,
// -this.motionX * 4.0D,
// 1.5D,
// -this.motionZ * 4.0D
// );
// }
// }
// this.handleWaterMovement();
// if (this.handleLavaMovement()) {
// this.setOnFireFromLava();
// this.fallDistance *= 0.5F;
// }
// if (this.posY < -64.0D) {
// this.kill();
// }
// this.worldObj.theProfiler.endSection();
//}
@Override
public void setFire(int time) {}
@Override
public boolean isEntityInvulnerable() {
return true;
}
@Override
public boolean canRenderOnFire() {
return this.canBurn;
}
@SuppressWarnings("unchecked")
private void aggregate() {
for (EntityItem var2 : (List<EntityItem>) this.worldObj.getEntitiesWithinAABB(
EntityItem.class, this.boundingBox.expand(0.5D, 0.0D, 0.5D)
)) {
this.combineItems(var2);
}
}
}

View file

@ -8,6 +8,7 @@ import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.network.PacketFX;
import ley.modding.dartcraft.tile.TileEntityForceTorch;
import ley.modding.dartcraft.util.UpgradeHelper;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
@ -236,17 +237,9 @@ public class EntityTime extends Entity {
type = 1;
}
WorldVec pos = new WorldVec(this);
Dartcraft.channel.sendToAllAround(
new PacketFX(
this.posX, this.posY, this.posZ, PacketFX.Type.TIME, type, 0, 1
),
new TargetPoint(
this.worldObj.provider.dimensionId,
this.posX,
this.posY,
this.posZ,
80f
)
new PacketFX(pos, PacketFX.Type.TIME, type, 0, 1), pos.targetPoint(80d)
);
}
}

View file

@ -0,0 +1,56 @@
package ley.modding.dartcraft.infusion;
import java.util.ArrayList;
import ley.modding.dartcraft.api.recipe.ForceWildCard;
import ley.modding.dartcraft.api.upgrades.ForceUpgrade;
import net.minecraft.item.ItemStack;
public class ForceWildCards {
private static ArrayList<ForceWildCard> wildCards = new ArrayList<>();
public static void addWildCard(ForceWildCard wildCard) {
if (wildCard != null) {
wildCards.add(wildCard);
}
}
public static ForceWildCard getWildCard(ItemStack stack) {
ForceWildCard card = null;
for (ForceWildCard check : wildCards) {
if (stack != null && !check.ignoreMeta()
&& ItemStack.areItemStacksEqual(
check.getInput(),
new ItemStack(stack.getItem(), 1, stack.getItemDamage())
)
|| check.ignoreMeta() && stack.getItem() == check.getInput().getItem()) {
card = check;
break;
}
}
return card;
}
public static boolean
isUpgradeValidForWildCard(ForceUpgrade upgrade, ItemStack stack) {
ForceWildCard card = getWildCard(stack);
if (card != null && card.getUpgrades() != null && card.getUpgrades().length > 0) {
ForceUpgrade[] arr$ = card.getUpgrades();
int len$ = arr$.length;
for (int i$ = 0; i$ < len$; ++i$) {
ForceUpgrade upCheck = arr$[i$];
if (upCheck.equals(upgrade)) {
return true;
}
}
}
return false;
}
public static boolean isWildCard(ItemStack stack) {
return getWildCard(stack) != null;
}
}

View file

@ -0,0 +1,8 @@
package ley.modding.dartcraft.integration;
import ic2.core.Ic2Items;
import net.minecraft.item.ItemStack;
public class IC2Integration {
public static final ItemStack DIAMOND_DRILL_ITEM = Ic2Items.diamondDrill;
}

View file

@ -1,11 +1,16 @@
package ley.modding.dartcraft.integration;
import ley.modding.dartcraft.proxy.CommonProxy;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.tileentity.TileEntity;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.tiles.TileDeconstructionTable;
public class ThaumCraftIntegration {
public static final Enchantment ENCH_REPAIR
= Enchantment.enchantmentsList[ThaumcraftApi.enchantRepair];
public static final Aspect[] PRIMAL_ASPECTS
= { Aspect.AIR, Aspect.EARTH, Aspect.FIRE,
Aspect.WATER, Aspect.ORDER, Aspect.ENTROPY };

View file

@ -1,10 +1,18 @@
package ley.modding.dartcraft.item;
import ley.modding.dartcraft.client.IconDirectory;
import ley.modding.dartcraft.util.Util;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
public class BaseItem extends Item {
public BaseItem(String id) {
Util.configureItem(this, id);
}
@Override
public void registerIcons(IIconRegister reg) {
super.registerIcons(reg);
IconDirectory.registerItemTextures(reg);
}
}

View file

@ -1,6 +1,5 @@
package ley.modding.dartcraft.item;
import ley.modding.dartcraft.block.DartBlocks;
import ley.modding.dartcraft.item.tool.ItemForceAxe;
import ley.modding.dartcraft.item.tool.ItemForceMitts;
import ley.modding.dartcraft.item.tool.ItemForcePickaxe;
@ -23,6 +22,7 @@ public class DartItems {
public static Item forceshears;
public static Item forceshovel;
public static Item forcestick;
public static Item forcetome;
// Useless Items
public static Item claw;
@ -32,24 +32,25 @@ public class DartItems {
public static Item soulwafer;
public static void regsiter(IRegistry reg) {
DartItems.entitybottle = reg.registerItem(new ItemEntityBottle());
DartItems.forceaxe = reg.registerItem(new ItemForceAxe());
DartItems.forceflask = reg.registerItem(new ItemForceFlask());
DartItems.forcegem = reg.registerItem(new BaseItem("forcegem"));
DartItems.forceingot = reg.registerItem(new BaseItem("forceingot"));
DartItems.forcemitts = reg.registerItem(new ItemForceMitts());
DartItems.forcenugget = reg.registerItem(new BaseItem("forcenugget"));
DartItems.forcepickaxe = reg.registerItem(new ItemForcePickaxe());
DartItems.forceshard = reg.registerItem(new BaseItem("forceshard"));
DartItems.forceshears = reg.registerItem(new ItemForceShears());
DartItems.forceshovel = reg.registerItem(new ItemForceShovel());
DartItems.forcestick = reg.registerItem(new BaseItem("forcestick"));
entitybottle = reg.registerItem(new ItemEntityBottle());
forceaxe = reg.registerItem(new ItemForceAxe());
forceflask = reg.registerItem(new ItemForceFlask());
forcegem = reg.registerItem(new BaseItem("forcegem"));
forceingot = reg.registerItem(new BaseItem("forceingot"));
forcemitts = reg.registerItem(new ItemForceMitts());
forcenugget = reg.registerItem(new BaseItem("forcenugget"));
forcepickaxe = reg.registerItem(new ItemForcePickaxe());
forceshard = reg.registerItem(new BaseItem("forceshard"));
forceshears = reg.registerItem(new ItemForceShears());
forceshovel = reg.registerItem(new ItemForceShovel());
forcestick = reg.registerItem(new BaseItem("forcestick"));
forcetome = reg.registerItem(new ItemForceTome());
DartItems.claw = reg.registerItem(new BaseItem("claw"));
DartItems.clipboard = reg.registerItem(new ItemClipboard());
DartItems.fortune = reg.registerItem(new BaseItem("fortune"));
DartItems.goldenpower = reg.registerItem(new BaseItem("goldenpower"));
DartItems.resource = reg.registerItem(new BaseItem("resource"));
DartItems.soulwafer = reg.registerItem(new BaseItem("soulwafer"));
claw = reg.registerItem(new BaseItem("claw"));
clipboard = reg.registerItem(new ItemClipboard());
fortune = reg.registerItem(new BaseItem("fortune"));
goldenpower = reg.registerItem(new BaseItem("goldenpower"));
resource = reg.registerItem(new BaseItem("resource"));
soulwafer = reg.registerItem(new BaseItem("soulwafer"));
}
}

View file

@ -1,6 +1,7 @@
package ley.modding.dartcraft.item;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.client.gui.GuiType;
import ley.modding.dartcraft.proxy.CommonProxy;
import ley.modding.dartcraft.util.EntityUtils;
import ley.modding.dartcraft.util.Util;
@ -49,7 +50,7 @@ public class ItemClipboard extends Item {
if (Dartcraft.proxy.isSimulating(world))
player.openGui(
Dartcraft.instance,
0,
GuiType.CLIPBOARD.ordinal(),
world,
(int) ((Entity) player).posX,
(int) ((Entity) player).posY,

View file

@ -0,0 +1,229 @@
package ley.modding.dartcraft.item;
import java.util.List;
import java.util.stream.IntStream;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.util.DartUtils;
import ley.modding.dartcraft.util.TomeUtils;
import net.anvilcraft.anvillib.usercache.UserCache;
import net.anvilcraft.anvillib.util.AnvilUtil;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class ItemForceTome extends BaseItem {
public IIcon[] icons;
public ItemForceTome() {
super("forcetome");
this.setMaxStackSize(1);
}
@Override
@SideOnly(value = Side.CLIENT)
@SuppressWarnings({ "rawtypes", "unchecked" })
public void
addInformation(ItemStack stack, EntityPlayer player, List list, boolean flag) {
if (!stack.hasTagCompound() || !stack.getTagCompound().hasKey("type")) {
return;
}
while (list.size() > 1) {
list.remove(1);
}
if (stack.getTagCompound().getInteger("type") == 0) {
int points = TomeUtils.getPoints(stack);
int tier = TomeUtils.getStoredTier(stack);
int next = TomeUtils.getPointsToNext(stack);
list.add("§bTier " + tier);
if (tier < 7) {
list.add("§f" + points + "§b Force Points");
if (next > 0) {
list.add("§bNext Tier: §f" + next);
} else {
list.add("§bReady to Advance");
}
} else {
list.add("§bMastered!");
}
if (stack.getTagCompound().hasKey("player")) {
String name = UserCache.INSTANCE.getCached(
AnvilUtil.uuidFromNBT(stack.getTagCompound().getTagList("player", 4))
);
if (name != null)
list.add("Owner: " + name);
}
} else if (stack.getTagCompound().getInteger("type") == 2) {
list.add("EXP: " + stack.getTagCompound().getInteger("stored"));
}
}
@Override
public boolean getShareTag() {
return true;
}
@Override
public void
onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
block11: {
EntityPlayer player;
if (stack == null) {
return;
}
if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
if (stack.hasTagCompound() && !stack.getTagCompound().hasKey("type")) {
stack.getTagCompound().setInteger("type", 0);
}
if (stack.hasTagCompound() && !stack.getTagCompound().hasKey("player")
&& entity instanceof EntityPlayer) {
player = (EntityPlayer) entity;
stack.getTagCompound().setTag(
"player", AnvilUtil.uuidToNBT(player.getUniqueID())
);
}
if (TomeUtils.getTomeType(stack) != 0) {
return;
}
try {
if (!stack.hasTagCompound() || !stack.getTagCompound().hasKey("player")
|| !(entity instanceof EntityPlayer)
|| !Dartcraft.proxy.isSimulating(world))
break block11;
player = (EntityPlayer) entity;
boolean isOwner
= AnvilUtil.uuidFromNBT(stack.getTagCompound().getTagList("player", 4))
.equals(((EntityPlayer) entity).getUniqueID());
if (isOwner) {
if (stack.getTagCompound().getInteger("lastMasteryCheck") <= 0) {
stack.getTagCompound().setInteger("lastMasteryCheck", 20);
// TODO
//DartPluginAchievements.addToPlayer("mastery", player);
} else {
stack.getTagCompound().setInteger(
"lastMasteryCheck",
stack.getTagCompound().getInteger("lastMasteryCheck") - 1
);
}
break block11;
}
stack.getTagCompound().setBoolean("dropOnce", true);
for (int i = 0; i < player.inventory.mainInventory.length; ++i) {
ItemStack invStack = player.inventory.mainInventory[i];
if (invStack == null || invStack.getItem() != this
|| !invStack.hasTagCompound()
|| !invStack.getTagCompound().hasKey("dropOnce"))
continue;
invStack.getTagCompound().removeTag("dropOnce");
DartUtils.dropInvincibleItem(
invStack, world, player.posX, player.posY, player.posZ, 0
);
player.inventory.mainInventory[i] = null;
DartUtils.punishPlayer(player, 2.0f);
break;
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
@SideOnly(value = Side.CLIENT)
public EnumRarity getRarity(ItemStack stack) {
return EnumRarity.uncommon;
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (!stack.hasTagCompound() || stack.getTagCompound().getInteger("type") != 2) {
return stack;
}
NBTTagCompound comp = stack.getTagCompound();
if (player.isSneaking()) {
for (int i = 0; i < 10 && player.experienceTotal > 0; ++i) {
player.addExperience(-1);
if (player.experience < 0.0f) {
player.addExperienceLevel(-1);
player.experience = 0.95f;
}
comp.setInteger("stored", comp.getInteger("stored") + 1);
if (comp.getInteger("stored") < 100000 || comp.getBoolean("triggered"))
continue;
// TODO
//DartPluginAchievements.addToPlayer("fillTome", player);
comp.setBoolean("triggered", true);
}
} else {
for (int i = 0; i < 10 && comp.getInteger("stored") > 0; ++i) {
player.addExperience(1);
comp.setInteger("stored", comp.getInteger("stored") - 1);
}
}
return stack;
}
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void getSubItems(Item id, CreativeTabs tabs, List itemList) {
ItemStack stack = new ItemStack((Item) this, 1);
stack.setTagCompound(TomeUtils.initExpComp());
ItemStack stack2 = new ItemStack((Item) this, 1);
stack2.setTagCompound(TomeUtils.initUpgradeComp(false));
itemList.add(stack);
itemList.add(stack2);
}
@Override
@SideOnly(value = Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
return true;
}
@Override
public IIcon getIcon(ItemStack stack, int pass) {
NBTTagCompound comp = stack.getTagCompound();
if (comp == null)
return this.itemIcon;
return this.icons[comp.getInteger("type") == 0 ? 1 : 0];
}
@Override
public String getUnlocalizedName(ItemStack stack) {
if (stack.hasTagCompound()) {
switch (stack.getTagCompound().getInteger("type")) {
case 0: {
return "item.forcetome_upgrade";
}
case 2: {
return "item.forcetome_experience";
}
}
}
return super.getUnlocalizedName(stack);
}
@Override
@SideOnly(value = Side.CLIENT)
public void registerIcons(IIconRegister reggie) {
this.icons = IntStream.range(0, 2)
.mapToObj(i -> "dartcraft:forceTome" + i)
.map(reggie::registerIcon)
.toArray(IIcon[] ::new);
this.itemIcon = this.icons[0];
}
}

View file

@ -1,13 +1,15 @@
package ley.modding.dartcraft.network;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.relauncher.Side;
import io.netty.buffer.ByteBuf;
import ley.modding.dartcraft.client.gui.ContainerClipboard;
import net.anvilcraft.anvillib.network.AnvilPacket;
import net.anvilcraft.anvillib.network.IAnvilPacket;
import net.minecraft.entity.player.EntityPlayer;
public class PacketClipButton implements IMessage {
@AnvilPacket(Side.SERVER)
public class PacketClipButton implements IAnvilPacket {
protected int button;
public PacketClipButton() {}
@ -26,30 +28,27 @@ public class PacketClipButton implements IMessage {
buf.writeByte(this.button);
}
public static class Handler implements IMessageHandler<PacketClipButton, IMessage> {
@Override
public IMessage onMessage(PacketClipButton packet, MessageContext ctx) {
EntityPlayer player = ctx.getServerHandler().playerEntity;
if (player != null) {
ContainerClipboard clipboard
= (player.openContainer != null
&& player.openContainer instanceof ContainerClipboard)
? (ContainerClipboard) player.openContainer
: null;
if (clipboard != null)
switch (packet.button) {
case 0:
clipboard.balanceItems();
break;
case 1:
clipboard.doDistribute();
break;
case 2:
clipboard.clearMatrix();
break;
}
}
return null;
@Override
public void handle(MessageContext ctx) {
EntityPlayer player = ctx.getServerHandler().playerEntity;
if (player != null) {
ContainerClipboard clipboard
= (player.openContainer != null
&& player.openContainer instanceof ContainerClipboard)
? (ContainerClipboard) player.openContainer
: null;
if (clipboard != null)
switch (this.button) {
case 0:
clipboard.balanceItems();
break;
case 1:
clipboard.doDistribute();
break;
case 2:
clipboard.clearMatrix();
break;
}
}
}
}

View file

@ -0,0 +1,39 @@
package ley.modding.dartcraft.network;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.relauncher.Side;
import io.netty.buffer.ByteBuf;
import ley.modding.dartcraft.client.gui.ContainerMachine;
import net.anvilcraft.anvillib.network.AnvilPacket;
import net.anvilcraft.anvillib.network.IAnvilPacket;
import net.minecraft.entity.player.EntityPlayer;
@AnvilPacket(Side.SERVER)
public class PacketDesocket implements IAnvilPacket {
int index;
public PacketDesocket() {}
public PacketDesocket(int index) {
this.index = index;
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(this.index);
}
@Override
public void fromBytes(ByteBuf buf) {
this.index = buf.readInt();
}
@Override
public void handle(MessageContext ctx) {
EntityPlayer pl = ctx.getServerHandler().playerEntity;
if (pl.openContainer instanceof ContainerMachine) {
((ContainerMachine) pl.openContainer).desocket();
}
}
}

View file

@ -1,19 +1,20 @@
package ley.modding.dartcraft.network;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import ley.modding.dartcraft.util.FXUtils;
import net.anvilcraft.anvillib.network.AnvilPacket;
import net.anvilcraft.anvillib.network.IAnvilPacket;
import net.anvilcraft.anvillib.util.AnvilUtil;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.world.World;
public class PacketFX implements IMessage {
public double x;
public double y;
public double z;
@AnvilPacket(Side.CLIENT)
public class PacketFX implements IAnvilPacket {
public Vec3 pos;
public Type type;
public int subType;
@ -22,12 +23,8 @@ public class PacketFX implements IMessage {
public PacketFX() {}
public PacketFX(
double x, double y, double z, Type type, int subType, int area, int amount
) {
this.x = x;
this.y = y;
this.z = z;
public PacketFX(Vec3 pos, Type type, int subType, int area, int amount) {
this.pos = pos;
this.type = type;
this.subType = subType;
this.area = area;
@ -36,11 +33,9 @@ public class PacketFX implements IMessage {
@Override
public void fromBytes(ByteBuf buf) {
this.x = buf.readDouble();
this.y = buf.readDouble();
this.z = buf.readDouble();
this.pos = Vec3.readFromByteBuf(buf);
this.type = Type.fromInt(buf.readInt());
this.type = AnvilUtil.enumFromInt(Type.class, buf.readInt());
this.subType = buf.readInt();
this.area = buf.readInt();
this.amount = buf.readInt();
@ -48,9 +43,7 @@ public class PacketFX implements IMessage {
@Override
public void toBytes(ByteBuf buf) {
buf.writeDouble(this.x);
buf.writeDouble(this.y);
buf.writeDouble(this.z);
this.pos.writeToByteBuf(buf);
buf.writeInt(this.type.ordinal());
buf.writeInt(this.subType);
@ -58,58 +51,43 @@ public class PacketFX implements IMessage {
buf.writeInt(this.amount);
}
@Override
public void handle(MessageContext ctx) {
World world = FMLClientHandler.instance().getClientPlayerEntity().worldObj;
WorldVec pos = this.pos.withWorld(world);
switch (this.type) {
case TIME:
FXUtils.makeTimeEffects(pos, this.subType, this.amount, this.area);
break;
case CHANGE:
FXUtils.makeWWEffects(
pos, 0xffffff, this.subType, this.amount, this.area
);
break;
case CURE:
FXUtils.makeCureEffects(pos, this.subType, 0x4bb218, this.amount);
break;
case HEAT:
FXUtils.makeHeatEffects(pos, this.amount, this.area);
break;
case SPARKLES:
FXUtils.makeShiny(pos, this.subType, 0xffff00, this.amount, true);
case CHARGE:
FXUtils.makeChargeEffects(pos, this.subType, 0xffffff, this.amount, true);
}
}
public static enum Type {
TIME,
CHANGE,
CURE,
HEAT;
public static Type fromInt(int i) {
if (i >= 0 && i < Type.values().length)
return Type.values()[i];
return null;
}
}
public static class Handler implements IMessageHandler<PacketFX, IMessage> {
@Override
@SideOnly(Side.CLIENT)
public IMessage onMessage(PacketFX pkt, MessageContext ctx) {
World world = FMLClientHandler.instance().getClientPlayerEntity().worldObj;
switch (pkt.type) {
case TIME:
FXUtils.makeTimeEffects(
world, pkt.x, pkt.y, pkt.z, pkt.subType, pkt.amount, pkt.area
);
break;
case CHANGE:
FXUtils.makeWWEffects(
world,
pkt.x,
pkt.y,
pkt.z,
0xffffff,
pkt.subType,
pkt.amount,
pkt.area
);
break;
case CURE:
FXUtils.makeCureEffects(
world, pkt.x, pkt.y, pkt.z, pkt.subType, 0x4bb218, pkt.amount
);
break;
case HEAT:
FXUtils.makeHeatEffects(
world, pkt.x, pkt.y, pkt.z, pkt.amount, pkt.area
);
break;
}
return null;
}
HEAT,
SPARKLES,
CHARGE;
}
}

View file

@ -0,0 +1,32 @@
package ley.modding.dartcraft.network;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.relauncher.Side;
import io.netty.buffer.ByteBuf;
import ley.modding.dartcraft.client.gui.ContainerMachine;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import net.anvilcraft.anvillib.network.AnvilPacket;
import net.anvilcraft.anvillib.network.IAnvilPacket;
import net.minecraft.entity.player.EntityPlayer;
@AnvilPacket(Side.SERVER)
public class PacketInfuserStart implements IAnvilPacket {
public PacketInfuserStart() {}
@Override
public void toBytes(ByteBuf buf) {}
@Override
public void fromBytes(ByteBuf buf) {}
@Override
public void handle(MessageContext ctx) {
EntityPlayer pl = ctx.getServerHandler().playerEntity;
if (pl.openContainer instanceof ContainerMachine
&& ((ContainerMachine) pl.openContainer).machine
instanceof TileEntityInfuser) {
((TileEntityInfuser) ((ContainerMachine) pl.openContainer).machine).go(pl);
}
}
}

View file

@ -0,0 +1,42 @@
package ley.modding.dartcraft.network;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.relauncher.Side;
import io.netty.buffer.ByteBuf;
import ley.modding.dartcraft.api.AccessLevel;
import ley.modding.dartcraft.client.gui.ContainerMachine;
import net.anvilcraft.anvillib.network.AnvilPacket;
import net.anvilcraft.anvillib.network.IAnvilPacket;
import net.anvilcraft.anvillib.util.AnvilUtil;
import net.minecraft.entity.player.EntityPlayer;
@AnvilPacket(Side.SERVER)
public class PacketUpdateAccessLevel implements IAnvilPacket {
AccessLevel access;
public PacketUpdateAccessLevel() {}
public PacketUpdateAccessLevel(AccessLevel access) {
this.access = access;
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeByte((byte) this.access.ordinal());
}
@Override
public void fromBytes(ByteBuf buf) {
this.access = AnvilUtil.enumFromInt(AccessLevel.class, buf.readByte());
}
@Override
public void handle(MessageContext ctx) {
EntityPlayer pl = ctx.getServerHandler().playerEntity;
if (pl.openContainer instanceof ContainerMachine) {
((ContainerMachine) pl.openContainer).machine.access = this.access;
((ContainerMachine) pl.openContainer).machine.markDirty();
}
}
}

View file

@ -0,0 +1,223 @@
package ley.modding.dartcraft.plugin;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class DartPluginFortunes {
private static Random rand;
private static List<String> fortunes = new ArrayList<>();
public static void addFortune(String fortune) {
if (fortunes != null && fortune != null) {
fortunes.add(fortune);
}
}
public static void load() {
rand = new Random(System.nanoTime());
DartPluginFortunes.loadFortunes();
}
public static String getFortune() {
if (fortunes == null || fortunes.size() < 1) {
return "";
}
int index = rand.nextInt(fortunes.size());
if (index >= fortunes.size()) {
return "";
}
return (String)fortunes.get(index);
}
private static void loadFortunes() {
addFortune("You aren't supposed to eat me.");
addFortune("Beauty is in the eye of the tiger.");
addFortune("Creeper!");
addFortune("Which came first, the chicken or the chunk?");
addFortune("Whatever happened to Doritos 3D?");
addFortune("Diabetes, anyone?");
addFortune("That wasn't a cookie!");
addFortune("If a tree falls down in the woods, you have a special mod installed.");
addFortune("The cake is a lie of omission.");
addFortune("A wise man once said, \"Yes honey, it does make you look fat.\" He never said that again.");
addFortune("Don't stare directly at the pixels.");
addFortune("I know where you live.");
addFortune("Your lucky numbers are 0, -7, and 437922904678137496.708162");
addFortune("There is never enough redstone.");
addFortune("What you seek is surrounded by blocks.");
addFortune("Today is Tuesday, or is it Friday - I can never tell.");
addFortune("In the event of a creeper explosion, your keyboard can double as a broken keyboard.");
addFortune("I didn't do it.");
addFortune("You are 5.6 grams heavier than you were 10 seconds ago.");
addFortune("I dropped my cookie.");
addFortune("...Saltpeter? Really?");
addFortune("We're no strangers to love. You know the rules and so do I.");
addFortune("Eat another cookie.");
addFortune("fontRenderer.drawString(\"Totally Real Accidental Glitch\", posX, posY, 0xFFFFFF);");
addFortune("I CAN believe it's not butter.");
addFortune("Beware enderman with a short fuse...");
addFortune("Remember to repair your tools.");
addFortune("Every rose has its bounding box.");
addFortune("Get out of my chest!");
addFortune("Please recycle.");
addFortune("Great, now you've spoiled your dinner!");
addFortune("Welcome to Hoarders: Minecraft edition!");
addFortune("Not all Blocks are created equal.");
addFortune("Don't touch that!");
addFortune("Always name your machinations.");
addFortune("Look in your inventory, now back to me - this fortune is now diamonds!");
addFortune("Who put that there?");
addFortune("Winners never cheat and cheaters never win, unless the winners cheated, in which case the cheaters won.");
addFortune("Hi Bob! What, they can't all be zingers.");
addFortune("Have you ever thought to yourself, \"My, that's an awfully large open grave!\"");
addFortune("Could you pick up my dry-cleaning?");
addFortune("Never shower in a thunderstorm. It's less efficient than bathing indoors and you'll freak out your neighbors.");
addFortune("It is said that everyone experiences hardships, but God must REALLY hate YOU.");
addFortune("If you play a country song backwards, you waste about 4 minutes of your life listening to garbled nonsense.");
addFortune("No, you can't make that jump.");
addFortune("I know they're furry and cuddly, but trust me, they're evil incarnate.");
addFortune("Do you Dew?");
addFortune("I see the land, but where exactly are the tracts?");
addFortune("Creepers were originally from Dr. Who.");
addFortune("Don't bogart my nasal spray!");
addFortune("You'll live.");
addFortune("Don't make me come back there!");
addFortune("I've burned everything that reminds me of you in a ritualistic bonfire.");
addFortune("We will be an unstoppable force; to our enemies we bring only death, to our allies we always bring cake.");
addFortune("Heavy is the head that eats the crayons.");
addFortune("Beware skinwalkers.");
addFortune("Don't fear the creeper.");
addFortune("Goodness and love will always win!");
addFortune("I told you not to eat that!");
addFortune("Winner!");
addFortune("Beware anyone without an eye-patch!");
addFortune("Don't kill all the animals!");
addFortune("It's a wonder you get anything done!");
addFortune("You will find happiness with a new love: Minecraft's latest patch.");
addFortune("Seriously, who is in charge of the song/cowbell ratio?");
addFortune("It's not a bug, it's a \"feature.\"");
addFortune("Do you really need this many cookies?");
addFortune("NCC1701");
addFortune("I wanted to be a newspaper.");
addFortune("Thank you! It was really dark in there!");
addFortune("Thank you for not eating me.");
addFortune("Burn the door!");
addFortune("That's the biggest flapjack I've ever seen!");
addFortune("Please be kind, de-rind");
addFortune("It's a secret to everybody.");
addFortune("I AM ERROR.");
addFortune("If all else fails use fire.");
addFortune("Dig it! Dig it! Dig to the center of the earth!");
addFortune("No! Not into the pit! It BURNS!");
addFortune("Dawn of the First Day, 72 hours remain.");
addFortune("Don't stare directly at the potato.");
addFortune("The chicken is a double-agent.");
addFortune("Good lord!");
addFortune("What's all this junk?");
addFortune("Creepers blow chunks.");
addFortune("Equivalence is a lie.");
addFortune("Body by Sycamore.");
addFortune("I hear 'Innards of the Machine' is on tour.");
addFortune("Do something else.");
addFortune("The capital of The Ukraine is Kiev.");
addFortune("DebugCookie4A73N82");
addFortune("Point that somewhere else!");
addFortune("Forking is strictly prohibited.");
addFortune("Void where prohibited.");
addFortune("This parrot is no more!");
addFortune("He's dead, Jim.");
addFortune("Leave me alone for a bit, okay?");
addFortune("Don't you dare shift-click me!");
addFortune("Me again.");
addFortune("My summer home is a no-bake.");
addFortune("We can still be friends.");
addFortune("The night is young, but you are not.");
addFortune("Keyboard cat has carpal tunnel.");
addFortune("Pull lever, get key.");
addFortune("Boats n' Hoes");
addFortune("Never eat an entire chocolate bunny in one sitting.");
addFortune("Push that button and die.");
addFortune("That cookie was mostly spackle.");
addFortune("Slime Chunkery.");
addFortune("I hate Thaumic Slimes.");
addFortune("Inertia is a property of mallard.");
addFortune("I prefer cake.");
addFortune("If you can read this, you're literate.");
addFortune("Don't touch the sides!");
addFortune("Crunchitize me Cap'n!");
addFortune("Please head in an orderly fashion to the disintegration chamber.");
addFortune("It's the deer's ears.");
addFortune("Happy anniversary, Carol!");
addFortune("Never startle a ninja.");
addFortune("If the shoe fits, you probably own it.");
addFortune("Cattle reproduce by budding.");
addFortune("Has anyone seen my Fedora?");
addFortune("I beg to defer.");
addFortune("Everybody loops.");
addFortune("Why is Count Chocula seasonal? Pedophilic vampires are always in style!");
addFortune("Eekum Bokum.");
addFortune("Churba wurt!");
addFortune("Darwa jit!");
addFortune("Success is often preceded by failure, then followed again by failure.");
addFortune("Man with Steve skin receive no cake.");
addFortune("It's all Melnics to me!");
addFortune("\"Steve\" means \"lazy\" in Swedish.");
addFortune("This is the word of Notch.");
addFortune("Don't attack the cute little endermen - you'll be sorry.");
addFortune("I miss my sanity, but then again I never used it.");
addFortune("So this is where germs are born!");
addFortune("I hate mondays.");
addFortune("My old nemesis: gravity.");
addFortune("I'm upgrade fodder!");
addFortune("You can do anything at Zombo.com.");
addFortune("Remember to feed the cattle.");
addFortune("TROGDOR was a man. I mean, he was a dragon-man... Maybe he was just a dragon.");
addFortune("Charles in charge of our clicks left and right. Charles in charge of every block in sight.");
addFortune("Charles was never really in charge.");
addFortune("Remember to use every part of the chicken.");
addFortune("I'm not responsible for this.");
addFortune("Every 10 minutes another crappy fortune is written.");
addFortune("How many licks does it take to get to the center of a Chuck Norris?");
addFortune("Roundhouse-kick for the win!");
addFortune("DO NOT feed the beast! (After midnight)");
addFortune("Please stop doing that.");
addFortune("I'm not a vending machine!");
addFortune("Try Ubuntu.");
addFortune("If you program for more than 20 hours straight, do not blink.");
addFortune("Ceiling cat is watching you procrastinate.");
addFortune("Get your hand off my thigh! You can have the leg.");
addFortune("Protective eyewear is a must!");
addFortune("It's all in the wristwatch.");
addFortune("Endermen in the UCB!");
addFortune("Endermen can move TNT. I'm serious.");
addFortune("Aww, you got blood all over my new sword!");
addFortune("The human pancreas can take only so many twinkies.");
addFortune("Humus is something you eat when you want your innards to cry.");
addFortune("By Mennen");
addFortune("Put me back in!");
addFortune("...I got nothin'.");
addFortune("We're out of milk.");
addFortune("Always edit-out the derps.");
addFortune("I want a lawyer.");
addFortune("Bring me a shrubbery!");
addFortune("It's bigger on the inside.");
addFortune("That's what she said.");
addFortune("Have you heard the one about the Rabbi and the Priest? Oh I forgot, you're deaf.");
addFortune("There are worse appendages to get caught sticking inside the cookie jar.");
addFortune("Ever have the feeling you're being watched? That's me!");
addFortune("He who handles his NullPointerExceptions is a wise man indeed.");
addFortune("Taking candy from a baby often prevents choking.");
addFortune("Texting while driving is a potent form of natural-selection.");
addFortune("The secret to a good marriage is matching tattoos.");
addFortune("A sucker is born every minute, however an idiot is born every two seconds.");
addFortune("Error in Thread Main: ExceptionNotCaughtException: DartCraft.java:32");
addFortune("I'll tear YOUR stub!");
addFortune("Daydreaming is free, cookies are not.");
addFortune("PINGAS!");
addFortune("The run is dead.");
addFortune("Alec Höfler");
}
}

View file

@ -6,13 +6,16 @@ import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.block.DartBlocks;
import ley.modding.dartcraft.client.renderer.block.RenderBlockPowerOre;
import ley.modding.dartcraft.client.renderer.block.RenderBlockTorch;
import ley.modding.dartcraft.client.renderer.block.RenderTileForceEngine;
import ley.modding.dartcraft.client.renderer.entity.RenderColdAnimal;
import ley.modding.dartcraft.client.renderer.entity.RenderEntityBottle;
import ley.modding.dartcraft.client.renderer.entity.RenderEntityFrozenItem;
import ley.modding.dartcraft.client.renderer.entity.RenderEntityTime;
import ley.modding.dartcraft.client.renderer.item.RenderItemEngine;
import ley.modding.dartcraft.client.renderer.item.RenderItemForceFlask;
import ley.modding.dartcraft.client.renderer.item.RenderItemInfuser;
import ley.modding.dartcraft.client.renderer.item.RenderItemMachine;
import ley.modding.dartcraft.client.renderer.tile.RenderTileEntityForceEngine;
import ley.modding.dartcraft.client.renderer.tile.RenderTileEntityInfuser;
import ley.modding.dartcraft.entity.EntityBottle;
import ley.modding.dartcraft.entity.EntityColdChicken;
import ley.modding.dartcraft.entity.EntityColdCow;
@ -22,6 +25,7 @@ import ley.modding.dartcraft.entity.EntityFrozenItem;
import ley.modding.dartcraft.entity.EntityTime;
import ley.modding.dartcraft.item.DartItems;
import ley.modding.dartcraft.tile.TileEntityForceEngine;
import ley.modding.dartcraft.tile.TileEntityInfuser;
import net.minecraft.client.model.ModelChicken;
import net.minecraft.client.model.ModelCow;
import net.minecraft.client.model.ModelPig;
@ -31,7 +35,8 @@ import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
public class ClientProxy extends CommonProxy {
public static RenderTileForceEngine engineRender;
public static RenderTileEntityForceEngine engineRender;
public static RenderTileEntityInfuser infuserRender;
@Override
public boolean isSimulating(World world) {
@ -55,6 +60,9 @@ public class ClientProxy extends CommonProxy {
MinecraftForgeClient.registerItemRenderer(
DartItems.entitybottle, RenderItemForceFlask.instance
);
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(DartBlocks.infuser), new RenderItemInfuser()
);
RenderEntityBottle bottleRenderer = new RenderEntityBottle();
RenderingRegistry.registerEntityRenderingHandler(
EntityBottle.class, bottleRenderer
@ -86,10 +94,14 @@ public class ClientProxy extends CommonProxy {
RenderingRegistry.registerBlockHandler(new RenderBlockPowerOre());
RenderBlockTorch.RI = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new RenderBlockTorch());
engineRender = new RenderTileForceEngine();
engineRender = new RenderTileEntityForceEngine();
ClientRegistry.bindTileEntitySpecialRenderer(
TileEntityForceEngine.class, engineRender
);
infuserRender = new RenderTileEntityInfuser();
ClientRegistry.bindTileEntitySpecialRenderer(
TileEntityInfuser.class, infuserRender
);
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(DartBlocks.engine), new RenderItemEngine()
);

View file

@ -20,7 +20,13 @@ import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.*;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
public class TileEntityForceEngine extends TileEntity
implements IFluidHandler, IInventory, IEnergyProvider { //TODO Fix GUI

View file

@ -10,6 +10,7 @@ import ley.modding.dartcraft.entity.EntityTime;
import ley.modding.dartcraft.integration.ThaumCraftIntegration;
import ley.modding.dartcraft.network.PacketFX;
import ley.modding.dartcraft.util.DartUtils;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.monster.EntityGhast;
@ -82,23 +83,13 @@ public class TileEntityForceTorch extends TileEntity {
entity.heal((float) (tile * 2));
k = true;
WorldVec pktPos = new WorldVec(entity);
pktPos.y += entity.height / 2d;
Dartcraft.channel.sendToAllAround(
new PacketFX(
entity.posX,
entity.posY + (entity.height / 2d),
entity.posZ,
PacketFX.Type.CURE,
2,
0,
8 * tile
pktPos, PacketFX.Type.CURE, 2, 0, 8 * tile
),
new TargetPoint(
this.worldObj.provider.dimensionId,
entity.posX,
entity.posY,
entity.posZ,
80f
)
pktPos.targetPoint(80d)
);
}
} else {
@ -146,23 +137,11 @@ public class TileEntityForceTorch extends TileEntity {
this.worldObj.removeEntity(remEnt);
k = true;
WorldVec pktPos = new WorldVec(remEnt);
pktPos.y += remEnt.height / 2d;
Dartcraft.channel.sendToAllAround(
new PacketFX(
remEnt.posX,
remEnt.posY + (remEnt.height / 2d),
remEnt.posZ,
PacketFX.Type.CHANGE,
1,
0,
16
),
new TargetPoint(
this.worldObj.provider.dimensionId,
remEnt.posX,
remEnt.posY + (remEnt.height / 2d),
remEnt.posZ,
80f
)
new PacketFX(pktPos, PacketFX.Type.CHANGE, 1, 0, 16),
pktPos.targetPoint(80d)
);
}
}
@ -215,23 +194,13 @@ public class TileEntityForceTorch extends TileEntity {
);
k = true;
WorldVec pktPos = new WorldVec(entity);
pktPos.y += entity.height / 2d;
Dartcraft.channel.sendToAllAround(
new PacketFX(
entity.posX,
entity.posY + (entity.height / 2d),
entity.posZ,
PacketFX.Type.HEAT,
0,
0,
8 * tile
pktPos, PacketFX.Type.HEAT, 0, 0, 8 * tile
),
new TargetPoint(
this.worldObj.provider.dimensionId,
entity.posX,
entity.posY,
entity.posZ,
80f
)
pktPos.targetPoint(80d)
);
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,259 @@
package ley.modding.dartcraft.tile;
import java.util.UUID;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.api.AccessLevel;
import ley.modding.dartcraft.api.IOwnedTile;
import ley.modding.dartcraft.util.DartUtils;
import ley.modding.dartcraft.util.Util;
import net.anvilcraft.anvillib.util.AnvilUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryBasic;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityHopper;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachine
extends TileEntity implements IInventory, IOwnedTile /*, IPipeConnection*/ {
public int socketSlot;
public InventoryBasic contents;
public UUID owner;
public AccessLevel access;
public ForgeDirection facing;
public String[] validCores;
public int color;
public TileEntityMachine() {
this.facing = ForgeDirection.UP;
this.access = AccessLevel.OPEN;
this.owner = null;
}
@Override
public void writeToNBT(NBTTagCompound comp) {
super.writeToNBT(comp);
comp.setByte("facing", (byte) this.facing.ordinal());
if (this.owner != null) {
comp.setLong("owner_most", this.owner.getMostSignificantBits());
comp.setLong("owner_least", this.owner.getLeastSignificantBits());
}
comp.setByte("access", (byte) this.access.ordinal());
comp.setInteger("color", this.color);
}
@Override
public void readFromNBT(NBTTagCompound comp) {
super.readFromNBT(comp);
this.facing = ForgeDirection.getOrientation(comp.getByte("facing"));
owner = comp.hasKey("owner_most") && comp.hasKey("owner_least")
? new UUID(comp.getLong("owner_most"), comp.getLong("owner_least"))
: null;
this.access = AnvilUtil.enumFromInt(AccessLevel.class, comp.getByte("access"));
this.color = comp.getInteger("color");
}
@Override
public Packet getDescriptionPacket() {
NBTTagCompound nbt = new NBTTagCompound();
this.writeToNBT(nbt);
return new S35PacketUpdateTileEntity(
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
this.readFromNBT(pkt.func_148857_g());
}
public void desocket() {
try {
if (Dartcraft.proxy.isSimulating(this.worldObj)
&& this.getStackInSlot(this.socketSlot) != null) {
this.worldObj.playSoundEffect(
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
"dartcraft:socket",
1.0F,
DartUtils.randomPitch()
);
}
this.setInventorySlotContents(this.socketSlot, (ItemStack) null);
} catch (Exception var2) {}
this.computeUpgrades();
}
public void computeUpgrades() {}
public boolean isSocketValid(ItemStack stack) {
// TODO: upgrades
//if (stack != null && stack.itemID == DartItem.upgradeCore.itemID) {
// NBTTagCompound upgrades = UpgradeHelper.getUpgradeCompound(stack);
// if (this.validCores != null && this.validCores.length > 0) {
// String[] arr$ = this.validCores;
// int len$ = arr$.length;
// for (int i$ = 0; i$ < len$; ++i$) {
// String name = arr$[i$];
// if (upgrades.hasKey(name)) {
// return true;
// }
// }
// }
//}
return false;
}
public IInventory getNearbyIInventory() {
if (this.worldObj != null && this.getAccessLevel() == AccessLevel.OPEN) {
int size = 0;
int prefZ = 0;
int prefY = 0;
int prefX = 0;
ForgeDirection[] e = ForgeDirection.VALID_DIRECTIONS;
int inv = e.length;
for (int i$ = 0; i$ < inv; ++i$) {
ForgeDirection dir = e[i$];
TileEntity tile = this.worldObj.getTileEntity(
this.xCoord + dir.offsetX,
this.yCoord + dir.offsetY,
this.zCoord + dir.offsetZ
);
if (tile != null && tile instanceof IInventory
/*&& !DartPluginForceWrench.isTileBlacklisted(tile.getClass())*/) {
IInventory inv1 = (IInventory) tile;
if (inv1.getSizeInventory() > size
&& !(tile instanceof TileEntityHopper)) {
size = inv1.getSizeInventory();
prefX = tile.xCoord;
prefY = tile.yCoord;
prefZ = tile.zCoord;
}
}
}
try {
if (size > 0) {
TileEntity var12 = this.worldObj.getTileEntity(prefX, prefY, prefZ);
if (var12 != null && var12 instanceof IInventory) {
IInventory var13 = (IInventory) var12;
return var13;
}
}
} catch (Exception var11) {
;
}
return null;
} else {
return null;
}
}
@Override
public int getSizeInventory() {
return this.contents != null ? this.contents.getSizeInventory() : 0;
}
@Override
public ItemStack getStackInSlot(int i) {
return this.contents != null && i >= 0 && i < this.contents.getSizeInventory()
? this.contents.getStackInSlot(i)
: null;
}
@Override
public ItemStack decrStackSize(int i, int j) {
return this.contents != null && i >= 0 && i < this.contents.getSizeInventory()
? this.contents.decrStackSize(i, j)
: null;
}
@Override
public ItemStack getStackInSlotOnClosing(int i) {
return this.contents != null && i >= 0 && i < this.contents.getSizeInventory()
? this.contents.getStackInSlotOnClosing(i)
: null;
}
@Override
public void setInventorySlotContents(int i, ItemStack stack) {
if (this.contents != null && i >= 0 && i < this.contents.getSizeInventory()) {
this.contents.setInventorySlotContents(i, stack);
}
}
@Override
public String getInventoryName() {
return "dartMachine.inventory";
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
return this.canPlayerAccess(player);
}
@Override
public boolean isItemValidForSlot(int i, ItemStack stack) {
return this.access == AccessLevel.OPEN;
}
public boolean canPlayerAccess(EntityPlayer player) {
switch (this.access) {
case CLOSED:
if (player != null && this.owner != null)
return player.getUniqueID().equals(this.owner);
default:
return true;
}
}
@Override
public UUID getOwner() {
return this.owner;
}
@Override
public AccessLevel getAccessLevel() {
return this.access;
}
@Override
public void openInventory() {}
@Override
public void closeInventory() {}
public int[] getContainerSyncData() {
return new int[] {};
}
public void receiveContainerSyncData(int idx, int val) {}
}

View file

@ -1,14 +1,25 @@
package ley.modding.dartcraft.util;
import java.awt.Color;
import buildcraft.api.tools.IToolWrench;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.api.IForceConsumer;
import ley.modding.dartcraft.api.upgrades.IForceUpgradable;
import ley.modding.dartcraft.entity.EntityInvincibleItem;
import ley.modding.dartcraft.item.DartItems;
import ley.modding.dartcraft.item.ItemClipboard;
import ley.modding.dartcraft.network.PacketFX;
import ley.modding.dartcraft.network.PacketFX.Type;
import ley.modding.dartcraft.proxy.CommonProxy;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidContainerRegistry;
@ -125,4 +136,91 @@ public class DartUtils {
return color >= 0 && color < lookup.length ? lookup[color] : 0;
}
public static boolean canUpgrade(ItemStack stack) {
if (stack == null)
return false;
if (stack.getItem() == Items.bucket
|| stack.getItem() == DartItems.forceflask && stack.getItemDamage() == 0)
return true;
if ((!hasDartUpgrade(stack) /*|| stack.getItem() instanceof ItemForcePack*/
|| stack.getItem() instanceof IForceConsumer
|| stack.getItem() instanceof ItemClipboard)
&& (stack.getItem() instanceof IForceUpgradable
|| stack.getItem() instanceof IForceConsumer
/*|| ForceWildCards.isWildCard(stack)*/))
return true;
return false;
}
public static boolean hasDartUpgrade(ItemStack stack) {
if (stack != null && stack.hasTagCompound()) {
NBTTagCompound comp = stack.getTagCompound();
if (comp.hasKey("upgrades") || comp.hasKey("ench")) {
return true;
}
}
return false;
}
public static void punishPlayer(EntityPlayer player, float amount) {
try {
player.attackEntityFrom(DamageSource.outOfWorld, amount);
player.worldObj.playSoundAtEntity(
player, "dartcraft:nope", 1.0F, randomPitch()
);
WorldVec pktPos = new WorldVec(player);
pktPos.y += player.height / 2f;
Dartcraft.channel.sendToAllAround(
new PacketFX(pktPos, Type.CHARGE, 1, 0, 32), pktPos.targetPoint(32d)
);
} catch (Exception var3) {}
}
public static void dropInvincibleItem(
ItemStack stack, World world, double x, double y, double z, int life
) {
if (stack != null && Dartcraft.proxy.isSimulating(world)) {
float xRand = CommonProxy.rand.nextFloat() * 0.2F + 0.1F;
float yRand = CommonProxy.rand.nextFloat() * 0.8F + 0.1F;
float zRand = CommonProxy.rand.nextFloat() * 0.2F + 0.1F;
EntityInvincibleItem droppedItem = new EntityInvincibleItem(
world,
(double) ((float) x + xRand),
(double) ((float) y + yRand),
(double) ((float) z + zRand),
stack,
life
);
// TODO: WTF
//if (stack.itemID == DartItem.forceTome.itemID) {
// droppedItem.delayBeforeCanPickup = 100;
//} else {
// droppedItem.delayBeforeCanPickup = 10;
//}
droppedItem.delayBeforeCanPickup = 10;
if (stack.hasTagCompound()) {
droppedItem.getEntityItem().setTagCompound(
(NBTTagCompound) stack.getTagCompound().copy()
);
}
float modifier = 0.025F;
droppedItem.motionX
= (double) ((float) CommonProxy.rand.nextGaussian() * modifier);
droppedItem.motionY
= (double) ((float) CommonProxy.rand.nextGaussian() * modifier + 0.2F);
droppedItem.motionZ
= (double) ((float) CommonProxy.rand.nextGaussian() * modifier);
world.spawnEntityInWorld(droppedItem);
}
}
}

View file

@ -0,0 +1,109 @@
package ley.modding.dartcraft.util;
import java.util.ArrayList;
import cpw.mods.fml.common.Loader;
import ley.modding.dartcraft.integration.ThaumCraftIntegration;
import ley.modding.dartcraft.item.tool.ItemForceAxe;
import ley.modding.dartcraft.item.tool.ItemForcePickaxe;
import ley.modding.dartcraft.item.tool.ItemForceShears;
import ley.modding.dartcraft.item.tool.ItemForceShovel;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
public class EnchantUtils {
public static NBTTagList getRealEnchants(ItemStack stack, NBTTagCompound upgrades) {
NBTTagList realEnchants = new NBTTagList();
ArrayList<String> buffer = new ArrayList<>();
String[] names = new String[] { "Luck", "Heat", "Touch", "Sturdy", "Force",
"Damage", "Light", "Repair", "Soul" };
int nnames = names.length;
int level;
for (level = 0; level < nnames; ++level) {
String name1 = names[level];
if (upgrades.hasKey(name1)) {
buffer.add(name1);
}
}
try {
if (upgrades != null && buffer != null && buffer.size() > 0) {
for (int var10 = 0; var10 < buffer.size(); ++var10) {
String enchName = buffer.get(var10);
level = upgrades.getInteger(enchName);
if (enchName.equals("Luck")) {
if (stack.getItem() instanceof ItemForcePickaxe
|| stack.getItem() instanceof ItemForceShovel
|| stack.getItem() instanceof ItemForceAxe) {
realEnchants.appendTag(simulateEnchant(35, level));
}
// TODO: sword
//if (stack.getItem() instanceof ItemForceSword) {
// realEnchants.appendTag(simulateEnchant(21, level));
//}
}
//if (var11.equals("Heat")) { }
if (enchName.equals("Touch")
&& (stack.getItem() instanceof ItemForcePickaxe
|| stack.getItem() instanceof ItemForceShovel
|| stack.getItem() instanceof ItemForceAxe)) {
realEnchants.appendTag(simulateEnchant(33, 1));
}
if (enchName.equals("Sturdy")
&& (stack.getItem() instanceof ItemForcePickaxe
|| stack.getItem() instanceof ItemForceShovel
|| stack.getItem() instanceof ItemForceAxe)) {
realEnchants.appendTag(simulateEnchant(34, level));
}
// TODO: sword
//if (enchName.equals("Force")
// && stack.getItem() instanceof ItemForceSword) {
// realEnchants.appendTag(simulateEnchant(19, level));
//}
// TODO: bow
//if (enchName.equals("Damage")
// && stack.getItem() instanceof ItemForceBow) {
// realEnchants.appendTag(simulateEnchant(48, level));
//}
// TODO: sword
//if (enchName.equals("Light")
// && stack.getItem() instanceof ItemForceSword) {
// realEnchants.appendTag(simulateEnchant(17, level));
//}
if (enchName.equals("Repair") && Loader.isModLoaded("Thaumcraft")
&& (stack.getItem() instanceof ItemForcePickaxe
|| stack.getItem() instanceof ItemForceShovel
|| stack.getItem() instanceof ItemForceAxe
// TODO: sword
//|| stack.getItem() instanceof ItemForceSword
|| stack.getItem() instanceof ItemForceShears)) {
realEnchants.appendTag(simulateEnchant(
ThaumCraftIntegration.ENCH_REPAIR.effectId, level
));
}
}
}
} catch (Exception var9) {
var9.printStackTrace();
}
return realEnchants;
}
public static NBTTagCompound simulateEnchant(int type, int level) {
NBTTagCompound realEnch = new NBTTagCompound();
realEnch.setShort("id", (short) type);
realEnch.setShort("lvl", (short) level);
return realEnch;
}
}

View file

@ -8,11 +8,14 @@ import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ley.modding.dartcraft.Dartcraft;
import ley.modding.dartcraft.client.fx.FXCharge;
import ley.modding.dartcraft.client.fx.FXCure;
import ley.modding.dartcraft.client.fx.FXDisney;
import ley.modding.dartcraft.client.fx.FXTime;
import ley.modding.dartcraft.client.fx.FXWindWaker;
import ley.modding.dartcraft.proxy.CommonProxy;
import net.anvilcraft.anvillib.vector.Vec3;
import net.anvilcraft.anvillib.vector.WorldVec;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.particle.EntityFireworkStarterFX;
import net.minecraft.client.renderer.Tessellator;
@ -27,25 +30,27 @@ public class FXUtils {
@SideOnly(Side.CLIENT)
public static void bindGLColor(int color) {
byte e = (byte) (color << 24);
byte red = (byte) (color << 24);
byte green = (byte) (color << 16);
byte blue = (byte) (color << 8);
GL11.glColor4f((float) e, (float) green, (float) blue, -1.0F);
GL11.glColor4f((float) red, (float) green, (float) blue, -1.0F);
}
public static void
makeEnderEffects(World world, double x, double y, double z, int number) {
if (!Dartcraft.proxy.isSimulating(world)) {
public static void makeEnderEffects(WorldVec pos, int number) {
if (!Dartcraft.proxy.isSimulating(pos.world)) {
float modifier = 0.1F;
for (int i = 0; i < number; ++i) {
double var10002 = x + world.rand.nextDouble() - world.rand.nextDouble();
double var10003 = y + world.rand.nextDouble() - world.rand.nextDouble();
double var10004 = z + world.rand.nextDouble() - world.rand.nextDouble();
double var10002
= pos.x + pos.world.rand.nextDouble() - pos.world.rand.nextDouble();
double var10003
= pos.y + pos.world.rand.nextDouble() - pos.world.rand.nextDouble();
double var10004
= pos.z + pos.world.rand.nextDouble() - pos.world.rand.nextDouble();
double var10
= (double) ((CommonProxy.rand.nextFloat() * 2.0F - 1.0F) * modifier);
double var10006 = (double) modifier;
world.spawnParticle(
pos.world.spawnParticle(
"portal",
var10002,
var10003,
@ -58,28 +63,12 @@ public class FXUtils {
}
}
public static void
makeHeatEffects(World world, int x, int y, int z, int number, int area) {
makeHeatEffects(
world,
(double) x + 0.5D,
(double) y + 1.0D,
(double) z + 0.5D,
number,
area,
1
);
public static void makeHeatEffects(WorldVec pos, int number, int area) {
makeHeatEffects((WorldVec) pos.offset(0.5d, 1.0d, 0.5d), number, area, 1);
}
public static void
makeHeatEffects(World world, double x, double y, double z, int number, int area) {
makeHeatEffects(world, x, y, z, number, area, 0);
}
public static void makeHeatEffects(
World world, double x, double y, double z, int number, int area, int type
) {
if (!Dartcraft.proxy.isSimulating(world)) {
public static void makeHeatEffects(WorldVec pos, int number, int area, int type) {
if (!Dartcraft.proxy.isSimulating(pos.world)) {
float modifier = 0.1F;
int i;
if (area > 0) {
@ -103,14 +92,14 @@ public class FXUtils {
dist1 *= 0.5D;
}
world.spawnParticle(
pos.world.spawnParticle(
"flame",
x + world.rand.nextDouble() * dist1
- world.rand.nextDouble() * dist1,
y + world.rand.nextDouble() * dist1
- world.rand.nextDouble() * dist1,
z + world.rand.nextDouble() * dist1
- world.rand.nextDouble() * dist1,
pos.x + pos.world.rand.nextDouble() * dist1
- pos.world.rand.nextDouble() * dist1,
pos.y + pos.world.rand.nextDouble() * dist1
- pos.world.rand.nextDouble() * dist1,
pos.z + pos.world.rand.nextDouble() * dist1
- pos.world.rand.nextDouble() * dist1,
velX1,
(double) modifier,
velZ1
@ -133,14 +122,14 @@ public class FXUtils {
dist *= 0.5D;
}
world.spawnParticle(
pos.world.spawnParticle(
"flame",
x + world.rand.nextDouble() * dist
- world.rand.nextDouble() * dist,
y + world.rand.nextDouble() * dist
- world.rand.nextDouble() * dist,
z + world.rand.nextDouble() * dist
- world.rand.nextDouble() * dist,
pos.x + pos.world.rand.nextDouble() * dist
- pos.world.rand.nextDouble() * dist,
pos.y + pos.world.rand.nextDouble() * dist
- pos.world.rand.nextDouble() * dist,
pos.z + pos.world.rand.nextDouble() * dist
- pos.world.rand.nextDouble() * dist,
var21,
(double) modifier,
var22
@ -150,9 +139,8 @@ public class FXUtils {
}
}
public static void makeEnderEffects(
Entity entity, double prevX, double prevY, double prevZ, int number, boolean sound
) {
public static void
makeEnderEffects(Entity entity, Vec3 prev, int number, boolean sound) {
World world = entity.worldObj;
if (!Dartcraft.proxy.isSimulating(world)) {
for (int i = 0; i < number; ++i) {
@ -160,14 +148,14 @@ public class FXUtils {
float var21 = (CommonProxy.rand.nextFloat() - 0.5F) * 0.2F;
float var22 = (CommonProxy.rand.nextFloat() - 0.5F) * 0.2F;
float var23 = (CommonProxy.rand.nextFloat() - 0.5F) * 0.2F;
double var221 = prevX + (entity.posX - prevX) * var19;
double var221 = prev.x + (entity.posX - prev.x) * var19;
double var24 = var221
+ (CommonProxy.rand.nextDouble() - 0.5D) * (double) entity.width
* 2.0D;
var221 = prevY + (entity.posY - prevY) * var19;
var221 = prev.y + (entity.posY - prev.y) * var19;
double var26
= var221 + CommonProxy.rand.nextDouble() * (double) entity.height;
var221 = prevZ + (entity.posZ - prevZ) * var19;
var221 = prev.z + (entity.posZ - prev.z) * var19;
double var28 = var221
+ (CommonProxy.rand.nextDouble() - 0.5D) * (double) entity.width
* 2.0D;
@ -183,7 +171,12 @@ public class FXUtils {
}
} else if (sound) {
world.playSoundEffect(
prevX, prevY, prevZ, "mob.endermen.portal", 2.0F, DartUtils.randomPitch()
prev.x,
prev.y,
prev.z,
"mob.endermen.portal",
2.0F,
DartUtils.randomPitch()
);
world.playSoundAtEntity(
entity, "mob.endermen.portal", 2.0F, DartUtils.randomPitch()
@ -191,31 +184,22 @@ public class FXUtils {
}
}
public static void makeEnderEffects(
Entity entity,
double posX,
double posY,
double posZ,
double prevX,
double prevY,
double prevZ,
int number,
boolean sound
) {
public static void
makeEnderEffects(Entity entity, Vec3 pos, Vec3 prev, int number, boolean sound) {
if (!Dartcraft.proxy.isSimulating(entity.worldObj)) {
for (int i = 0; i < number; ++i) {
double var19 = (double) i / ((double) number - 1.0D);
float var21 = (CommonProxy.rand.nextFloat() - 0.5F) * 0.2F;
float var22 = (CommonProxy.rand.nextFloat() - 0.5F) * 0.2F;
float var23 = (CommonProxy.rand.nextFloat() - 0.5F) * 0.2F;
double var27 = prevX + (posX - prevX) * var19;
double var27 = prev.x + (pos.x - prev.x) * var19;
double var24 = var27
+ (CommonProxy.rand.nextDouble() - 0.5D) * (double) entity.width
* 2.0D;
var27 = prevY + (posY - prevY) * var19;
var27 = prev.y + (pos.y - prev.y) * var19;
double var26
= var27 + CommonProxy.rand.nextDouble() * (double) entity.height;
var27 = prevZ + (posZ - prevZ) * var19;
var27 = prev.z + (pos.z - prev.z) * var19;
double var28 = var27
+ (CommonProxy.rand.nextDouble() - 0.5D) * (double) entity.width
* 2.0D;
@ -231,81 +215,83 @@ public class FXUtils {
}
} else if (sound) {
entity.worldObj.playSoundEffect(
prevX, prevY, prevZ, "mob.endermen.portal", 2.0F, 1.0F
prev.x, prev.y, prev.z, "mob.endermen.portal", 2.0F, 1.0F
);
entity.worldObj.playSoundAtEntity(entity, "mob.endermen.portal", 2.0F, 1.0F);
}
}
@SideOnly(Side.CLIENT)
public static void makeChangeEffects(
World world, double x2, double y2, double z2, int type, int particles
) {
public static void makeChangeEffects(WorldVec pos, int type, int particles) {
float modifier = 0.5F;
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
for (int i = 0; i < particles; ++i) {
float x = (float) (x2 + (double) (CommonProxy.rand.nextFloat() * modifier)
float x = (float) (pos.x + (double) (CommonProxy.rand.nextFloat() * modifier)
- (double) (modifier / 2.0F));
float y = (float) (y2 + (double) (CommonProxy.rand.nextFloat() * modifier)
float y = (float) (pos.y + (double) (CommonProxy.rand.nextFloat() * modifier)
- (double) (modifier / 2.0F));
float z = (float) (z2 + (double) (CommonProxy.rand.nextFloat() * modifier)
float z = (float) (pos.z + (double) (CommonProxy.rand.nextFloat() * modifier)
- (double) (modifier / 2.0F));
renderer.addEffect(
new FXWindWaker(world, (double) x, (double) y, (double) z, 0xffffff, type)
);
renderer.addEffect(new FXWindWaker(
pos.world, (double) x, (double) y, (double) z, 0xffffff, type
));
}
}
@SideOnly(Side.CLIENT)
public static void
makeWingEffects(World world, double x, double y, double z, int particles) {
public static void makeWingEffects(WorldVec pos, int particles) {
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
float modifier = 1.0F;
for (int i = 0; i < particles; ++i) {
float x2 = (float) (x + (double) (CommonProxy.rand.nextFloat() * modifier));
float y2 = (float) (y + (double) (CommonProxy.rand.nextFloat() * modifier));
float z2 = (float) (z + (double) (CommonProxy.rand.nextFloat() * modifier));
renderer.addEffect(
new FXWindWaker(world, (double) x2, (double) y2, (double) z2, '\ue4ff', 0)
);
float x2
= (float) (pos.x + (double) (CommonProxy.rand.nextFloat() * modifier));
float y2
= (float) (pos.y + (double) (CommonProxy.rand.nextFloat() * modifier));
float z2
= (float) (pos.z + (double) (CommonProxy.rand.nextFloat() * modifier));
renderer.addEffect(new FXWindWaker(
pos.world, (double) x2, (double) y2, (double) z2, 0xe4ff00, 0
));
}
}
@SideOnly(Side.CLIENT)
public static void
makeSkateEffects(World world, double x, double y, double z, int particles) {
public static void makeSkateEffects(WorldVec pos, int particles) {
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
float modifier = 1.0F;
for (int i = 0; i < particles; ++i) {
float x2 = (float) (x + (double) (CommonProxy.rand.nextFloat() * modifier));
float y2 = (float) (y + (double) (CommonProxy.rand.nextFloat() * modifier));
float z2 = (float) (z + (double) (CommonProxy.rand.nextFloat() * modifier));
renderer.addEffect(
new FXWindWaker(world, (double) x2, (double) y2, (double) z2, '\ue4ff', 3)
);
float x2
= (float) (pos.x + (double) (CommonProxy.rand.nextFloat() * modifier));
float y2
= (float) (pos.y + (double) (CommonProxy.rand.nextFloat() * modifier));
float z2
= (float) (pos.z + (double) (CommonProxy.rand.nextFloat() * modifier));
renderer.addEffect(new FXWindWaker(
pos.world, (double) x2, (double) y2, (double) z2, 0xe4ff00, 3
));
}
}
public static void spawnFlameFX(World world, int x, int y, int z) {
public static void spawnFlameFX(WorldVec pos) {
for (int i = 0; i < 10; ++i) {
float posX = (float) x + world.rand.nextFloat() * 1.0F;
float posY = (float) y + world.rand.nextFloat() * 1.0F;
float posZ = (float) z + world.rand.nextFloat() * 1.0F;
world.spawnParticle(
float posX = (float) pos.x + pos.world.rand.nextFloat() * 1.0F;
float posY = (float) pos.y + pos.world.rand.nextFloat() * 1.0F;
float posZ = (float) pos.z + pos.world.rand.nextFloat() * 1.0F;
pos.world.spawnParticle(
"flame", (double) posX, (double) posY, (double) posZ, 0.0D, 0.0D, 0.0D
);
}
}
public static void makeBreakFX(World world, int x, int y, int z) {
public static void makeBreakFX(WorldVec pos) {
for (int i = 0; i < 10; ++i) {
float posX = (float) x + world.rand.nextFloat() * 1.0F;
float posY = (float) y + world.rand.nextFloat() * 1.0F;
float posZ = (float) z + world.rand.nextFloat() * 1.0F;
world.spawnParticle(
float posX = (float) pos.x + pos.world.rand.nextFloat() * 1.0F;
float posY = (float) pos.y + pos.world.rand.nextFloat() * 1.0F;
float posZ = (float) pos.z + pos.world.rand.nextFloat() * 1.0F;
pos.world.spawnParticle(
"portal", (double) posX, (double) posY, (double) posZ, 0.0D, 0.0D, 0.0D
);
}
@ -351,16 +337,8 @@ public class FXUtils {
}
@SideOnly(Side.CLIENT)
public static void makeShiny(
World world,
double x,
double y,
double z,
int type,
int color,
int num,
boolean add
) {
public static void
makeShiny(WorldVec pos, int type, int color, int num, boolean add) {
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
double offset = 0.0D;
if (add) {
@ -369,10 +347,12 @@ public class FXUtils {
for (int i = 0; i < num; ++i) {
FXDisney fx = new FXDisney(
world,
x + offset + world.rand.nextDouble() - world.rand.nextDouble(),
y + world.rand.nextDouble() - world.rand.nextDouble(),
z + offset + world.rand.nextDouble() - world.rand.nextDouble(),
pos.world,
pos.x + offset + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
pos.y + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
pos.z + offset + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
color,
type
);
@ -381,17 +361,16 @@ public class FXUtils {
}
@SideOnly(Side.CLIENT)
public static void makeCureEffects(
World world, double x, double y, double z, int type, int color, int num
) {
public static void
makeCureEffects(WorldVec pos, int type, int color, int num) {
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
for (int i = 0; i < num; ++i) {
FXCure fx = new FXCure(
world,
x + world.rand.nextDouble() - world.rand.nextDouble(),
y + world.rand.nextDouble() - world.rand.nextDouble(),
z + world.rand.nextDouble() - world.rand.nextDouble(),
pos.world,
pos.x + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
pos.y + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
pos.z + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
color,
type
);
@ -400,16 +379,8 @@ public class FXUtils {
}
@SideOnly(Side.CLIENT)
public static void makeChargeEffects(
World world,
double x,
double y,
double z,
int type,
int color,
int num,
boolean add
) {
public static void
makeChargeEffects(WorldVec pos, int type, int color, int num, boolean add) {
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
double offset = 0.0D;
if (add) {
@ -417,23 +388,22 @@ public class FXUtils {
}
for (int i = 0; i < num; ++i) {
// TODO
//FXCharge fx = new FXCharge(
// world,
// x + offset + world.rand.nextDouble() - world.rand.nextDouble(),
// y + world.rand.nextDouble() - world.rand.nextDouble(),
// z + offset + world.rand.nextDouble() - world.rand.nextDouble(),
// color,
// type
//);
//renderer.addEffect(fx);
FXCharge fx = new FXCharge(
pos.world,
pos.x + offset + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
pos.y + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
pos.z + offset + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
color,
type
);
renderer.addEffect(fx);
}
}
@SideOnly(Side.CLIENT)
public static void makeIceEffects(
World world, double x, double y, double z, int type, int num, int area
) {
public static void makeIceEffects(WorldVec pos, int type, int num, int area) {
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
int i;
if (area > 0) {
@ -473,9 +443,7 @@ public class FXUtils {
}
@SideOnly(Side.CLIENT)
public static void makeTimeEffects(
World world, double x, double y, double z, int type, int num, int area
) {
public static void makeTimeEffects(WorldVec pos, int type, int num, int area) {
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
int i;
if (area > 0) {
@ -484,13 +452,13 @@ public class FXUtils {
for (int k = -area; k < area + 1; ++k) {
for (int l = 0; l < num; ++l) {
FXTime fx1 = new FXTime(
world,
x + (double) i + world.rand.nextDouble()
- world.rand.nextDouble(),
y + (double) fx + world.rand.nextDouble()
- world.rand.nextDouble(),
z + (double) k + world.rand.nextDouble()
- world.rand.nextDouble(),
pos.world,
pos.x + (double) i + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
pos.y + (double) fx + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
pos.z + (double) k + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
type
);
renderer.addEffect(fx1);
@ -501,10 +469,10 @@ public class FXUtils {
} else {
for (i = 0; i < num; ++i) {
FXTime var16 = new FXTime(
world,
x + world.rand.nextDouble() - world.rand.nextDouble(),
y + world.rand.nextDouble() - world.rand.nextDouble(),
z + world.rand.nextDouble() - world.rand.nextDouble(),
pos.world,
pos.x + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
pos.y + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
pos.z + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
type
);
renderer.addEffect(var16);
@ -513,9 +481,8 @@ public class FXUtils {
}
@SideOnly(Side.CLIENT)
public static void makeWWEffects(
World world, double x, double y, double z, int color, int type, int num, int area
) {
public static void
makeWWEffects(WorldVec pos, int color, int type, int num, int area) {
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
int i;
if (area > 0) {
@ -524,13 +491,13 @@ public class FXUtils {
for (int k = -area; k < area + 1; ++k) {
for (int l = 0; l < num; ++l) {
FXWindWaker fx1 = new FXWindWaker(
world,
x + (double) i + world.rand.nextDouble()
- world.rand.nextDouble(),
y + (double) fx + world.rand.nextDouble()
- world.rand.nextDouble(),
z + (double) k + world.rand.nextDouble()
- world.rand.nextDouble(),
pos.world,
pos.x + (double) i + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
pos.y + (double) fx + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
pos.z + (double) k + pos.world.rand.nextDouble()
- pos.world.rand.nextDouble(),
color,
type
);
@ -542,10 +509,10 @@ public class FXUtils {
} else {
for (i = 0; i < num; ++i) {
FXWindWaker var17 = new FXWindWaker(
world,
x + world.rand.nextDouble() - world.rand.nextDouble(),
y + world.rand.nextDouble() - world.rand.nextDouble(),
z + world.rand.nextDouble() - world.rand.nextDouble(),
pos.world,
pos.x + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
pos.y + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
pos.z + pos.world.rand.nextDouble() - pos.world.rand.nextDouble(),
color,
type
);
@ -555,15 +522,15 @@ public class FXUtils {
}
@SideOnly(Side.CLIENT)
public static void randomFireworkAt(World world, double x, double y, double z) {
public static void randomFireworkAt(WorldVec pos) {
EffectRenderer renderer = Dartcraft.proxy.getClientInstance().effectRenderer;
NBTTagCompound comp = new NBTTagCompound();
NBTTagList fireworks = new NBTTagList();
for (int fx = 0; fx < world.rand.nextInt(5) + 1; ++fx) {
for (int fx = 0; fx < pos.world.rand.nextInt(5) + 1; ++fx) {
NBTTagCompound tempComp = new NBTTagCompound();
tempComp.setBoolean("Flicker", world.rand.nextBoolean());
tempComp.setBoolean("Trails", world.rand.nextBoolean());
tempComp.setBoolean("Flicker", pos.world.rand.nextBoolean());
tempComp.setBoolean("Trails", pos.world.rand.nextBoolean());
tempComp.setIntArray("Colors", randomColorArray());
tempComp.setIntArray("FadeColors", randomColorArray());
fireworks.appendTag(tempComp);
@ -571,16 +538,16 @@ public class FXUtils {
comp.setTag("Explosions", fireworks);
EntityFireworkStarterFX var12 = new EntityFireworkStarterFX(
world, x, y, z, 0.0D, 0.0D, 0.0D, renderer, comp
pos.world, pos.x, pos.y, pos.z, 0.0D, 0.0D, 0.0D, renderer, comp
);
renderer.addEffect(var12);
}
@SideOnly(Side.CLIENT)
public static void wrathAt(World world, int x, int y, int z) {
public static void wrathAt(WorldVec pos) {
EntityLightningBolt bolt
= new EntityLightningBolt(world, (double) x, (double) y, (double) z);
world.spawnEntityInWorld(bolt);
= new EntityLightningBolt(pos.world, pos.x, pos.y, pos.z);
pos.world.spawnEntityInWorld(bolt);
}
public static int[] randomColorArray() {

View file

@ -154,14 +154,15 @@ public class ForceConsumerUtils {
return false;
}
player.openGui(
Dartcraft.instance,
16,
player.worldObj,
(int) player.posX,
(int) player.posY,
(int) player.posZ
);
// TODO
//player.openGui(
// Dartcraft.instance,
// 16,
// player.worldObj,
// (int) player.posX,
// (int) player.posY,
// (int) player.posZ
//);
return true;
}
}

View file

@ -1,19 +1,21 @@
package ley.modding.dartcraft.util;
import java.util.ArrayList;
import ley.modding.dartcraft.Config;
import ley.modding.dartcraft.api.recipe.ForceWildCard;
import ley.modding.dartcraft.api.upgrades.IForceUpgradable;
import ley.modding.dartcraft.api.upgrades.IForceUpgrade;
import ley.modding.dartcraft.api.upgrades.ForceUpgrade;
import ley.modding.dartcraft.api.upgrades.IForceUpgradeMaterial;
import ley.modding.dartcraft.api.upgrades.UpgradeMaterialHelper;
import ley.modding.dartcraft.block.DartBlocks;
import ley.modding.dartcraft.infusion.ForceWildCards;
import ley.modding.dartcraft.item.DartItems;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
public class ForceUpgradeManager {
public static int firstUniqueID = 0;
@ -87,248 +89,248 @@ public class ForceUpgradeManager {
public static final String timeDesc
= "Time is relative. At least it will be when you place this upgrade on a Force Sword or Force Rod. Shift right clicking the rod will change modes while right clicking will use it. Try it out!";
public static IForceUpgrade INFO;
public static IForceUpgrade FORCE;
public static IForceUpgrade SPEED;
public static IForceUpgrade LUMBERJACK;
public static IForceUpgrade DAMAGE;
public static IForceUpgrade LUCK;
public static IForceUpgrade GRINDING;
public static IForceUpgrade RAINBOW;
public static IForceUpgrade STORAGE;
public static IForceUpgrade EXP;
public static IForceUpgrade TOUCH;
public static IForceUpgrade FALSE;
public static IForceUpgrade BLEED;
public static IForceUpgrade CRAFT;
public static IForceUpgrade BANE;
public static IForceUpgrade CHARGE;
public static IForceUpgrade FORGE;
public static IForceUpgrade HEAT;
public static IForceUpgrade FREEZING;
public static IForceUpgrade STORAGE2;
public static IForceUpgrade WING;
public static IForceUpgrade CHARGE2;
public static IForceUpgrade HEALING;
public static IForceUpgrade CAMO;
public static IForceUpgrade SIGHT;
public static IForceUpgrade ENDER;
public static IForceUpgrade STURDY;
public static IForceUpgrade TIME;
public static IForceUpgrade EXPLOSION;
public static IForceUpgrade GRAFTING;
public static IForceUpgrade REPAIR;
public static IForceUpgrade SOUL;
public static IForceUpgrade LIGHT;
public static IForceUpgrade TREASURE;
public static IForceUpgrade IMPERVIOUS;
public static ForceUpgrade INFO;
public static ForceUpgrade FORCE;
public static ForceUpgrade SPEED;
public static ForceUpgrade LUMBERJACK;
public static ForceUpgrade DAMAGE;
public static ForceUpgrade LUCK;
public static ForceUpgrade GRINDING;
public static ForceUpgrade RAINBOW;
public static ForceUpgrade STORAGE;
public static ForceUpgrade EXP;
public static ForceUpgrade TOUCH;
public static ForceUpgrade FALSE;
public static ForceUpgrade BLEED;
public static ForceUpgrade CRAFT;
public static ForceUpgrade BANE;
public static ForceUpgrade CHARGE;
public static ForceUpgrade FORGE;
public static ForceUpgrade HEAT;
public static ForceUpgrade FREEZING;
public static ForceUpgrade STORAGE2;
public static ForceUpgrade WING;
public static ForceUpgrade CHARGE2;
public static ForceUpgrade HEALING;
public static ForceUpgrade CAMO;
public static ForceUpgrade SIGHT;
public static ForceUpgrade ENDER;
public static ForceUpgrade STURDY;
public static ForceUpgrade TIME;
public static ForceUpgrade EXPLOSION;
public static ForceUpgrade GRAFTING;
public static ForceUpgrade REPAIR;
public static ForceUpgrade SOUL;
public static ForceUpgrade LIGHT;
public static ForceUpgrade TREASURE;
public static ForceUpgrade IMPERVIOUS;
public static ArrayList<IForceUpgrade> upgrades = new ArrayList();
public static ArrayList<IForceUpgradeMaterial> materials = new ArrayList();
public static ArrayList<ForceUpgrade> upgrades = new ArrayList<>();
public static ArrayList<IForceUpgradeMaterial> materials = new ArrayList<>();
public static void load() {
loadUpgrades();
addUpgrades();
loadUpgradeMaterials();
//loadWildCards();
loadWildCards();
}
private static void loadUpgrades() {
INFO = new IForceUpgrade(0, "Info", 1, "");
FORCE = new IForceUpgrade(
INFO = new ForceUpgrade(0, "Info", 1, "");
FORCE = new ForceUpgrade(
1,
"Force",
2,
"This upgrade can be used to turn certain items into more Forceful versions of themselves. It also seems to imbue Force Swords with Knockback."
);
SPEED = new IForceUpgrade(
SPEED = new ForceUpgrade(
1,
"Speed",
Config.speedLevel,
"This upgrade imbues Force Tools with the ability to break blocks faster, and gives an overall speed boost to players when used on a Force Rod. If used to upgrade armor the player will move faster."
);
LUMBERJACK = new IForceUpgrade(
LUMBERJACK = new ForceUpgrade(
1,
"Lumberjack",
1,
"This upgrade transforms a Force Axe into a treebliterating tool of mass destruction, although the durability cost for such a monstrous tool is also, well, monstrous."
);
DAMAGE = new IForceUpgrade(
DAMAGE = new ForceUpgrade(
1,
"Damage",
Config.damageLevel,
"This upgrade serves to boost the damage of the weapon to which it is attached. On Force Swords it gives Sharpness, while Punch is given to Force Bows."
);
LUCK = new IForceUpgrade(
LUCK = new ForceUpgrade(
2,
"Luck",
4,
"The Luck upgrade enhances the amount of loot one receives for performing almost any task. On the Force Sword it gives Looting, causing enemies slain to drop more loot. On any standard block breaking tool it will give Fortune, which increases the drop rate of certain items."
);
GRINDING = new IForceUpgrade(
GRINDING = new ForceUpgrade(
2,
"Grinding",
1,
"This upgrade allows for certain items and drops to be ground into powdery substances or other useful materials. Try mining some ore with it and you'll get more return than usual."
);
RAINBOW = new IForceUpgrade(
RAINBOW = new ForceUpgrade(
2,
"Rainbow",
1,
"This upgrade is only valid on the Force Shears and randomly changes the color of wool dropped from sheep. Try it out!"
);
STORAGE = new IForceUpgrade(
STORAGE = new ForceUpgrade(
2,
"Holding",
1,
"This unique upgrade serves to increase the storage capacity of Force Packs by 8 slots per upgrade, up to a total size of 40 slots. Force Packs can only be upgraded once per tier, so you'll have to get to tier 5 before you can max out any Force Pack."
);
EXP = new IForceUpgrade(
EXP = new ForceUpgrade(
2,
"Experience",
1,
"This upgrade has only one function: to upgrade a normal book into an Experience Tome, which is able to store an infinite amount of experience for the player. Shift right-click it to store experience, and right-click to recall it. There is a small percent loss, but it's free."
);
TOUCH = new IForceUpgrade(
TOUCH = new ForceUpgrade(
3,
"Touch",
1,
"This upgrade imbues basic Force Tools with Silk Touch, which generally applies before upgrades like Grinding or Heat."
);
FALSE = new IForceUpgrade(
FALSE = new ForceUpgrade(
3,
"False",
1,
"The False upgrade, when present on a Force Sword will never deal a finishing blow to an enemy when struck. This could be useful for weakening monsters so they can be easily captured in Force Flasks."
);
BLEED = new IForceUpgrade(
BLEED = new ForceUpgrade(
3,
"Bleed",
3,
"Bleeding will cause entities that are struck to quickly take small amounts of bleed damage over time. This works on both the Force Sword and Bow and does stack with burning damage."
);
CRAFT = new IForceUpgrade(
CRAFT = new ForceUpgrade(
3,
"Craft",
1,
"This upgrade is only valid for the Item Card, and will allow the card to automatically craft the configured recipe from inside a Force Pack or Force Transport Pipe."
);
BANE = new IForceUpgrade(
BANE = new ForceUpgrade(
3,
"Bane",
1,
"When an entity is struck with a Bane imbued weapon they are likely to lose some of their inherent abilities. Creepers and Endermen are perfect examples of this principle."
);
TIME = new IForceUpgrade(
TIME = new ForceUpgrade(
3,
"Time",
1,
"Time is relative. At least it will be when you place this upgrade on a Force Sword or Force Rod. Shift right clicking the rod will change modes while right clicking will use it. Try it out!"
);
CHARGE = new IForceUpgrade(
CHARGE = new ForceUpgrade(
4,
"Charge",
5,
"This upgrade can only be added to Force Armor. Each IC2 battery added gives 10k EU storage, and of course allows the Force Armor to be recharged with IC2 power."
);
FORGE = new IForceUpgrade(
FORGE = new ForceUpgrade(
4,
"Forge",
1,
"This upgrade is only valid for Item Cards, and allows them to transmute freely between items marked as 'equivalent' on the Ore Dictionary."
);
HEAT = new IForceUpgrade(
HEAT = new ForceUpgrade(
4,
"Heat",
1,
"Heat is valid on every iteration of Force Tool, and has a tendency to ignite things it comes into contact with. If you put Heat on shears...you're a terrible person."
);
FREEZING = new IForceUpgrade(
FREEZING = new ForceUpgrade(
4,
"Freezing",
1,
"Don't eat that cookie! It doesn't do anything anyway. Upgrading your Force Bow with Freezing will allow it to shoot Ice Arrows which will freeze your enemies in place for a short time, and even change some blocks in the world."
);
STORAGE2 = new IForceUpgrade(
STORAGE2 = new ForceUpgrade(
4,
"Storage",
1,
"This unique upgrade serves to increase the storage capacity of Storage Units by approximately one Storage Unit per upgrade. You can only use one upgrade per tier and max size is dependent upon config settings."
);
WING = new IForceUpgrade(
WING = new ForceUpgrade(
5,
"Wing",
1,
"Wing Swords will fling their user when they right-click while holding the jump key, or allow small amounts of flight with a sneak jump right-click combination. On armor it will also allow flight and increase the maximum duration of flight."
);
CHARGE2 = new IForceUpgrade(
CHARGE2 = new ForceUpgrade(
5,
"Charge2",
5,
"A more potent version of Charge, holding 100,000 EU per upgrade. Multiple Charge2 upgrades are recommended for chest pieces as they will function like Lappacks."
);
HEALING = new IForceUpgrade(
HEALING = new ForceUpgrade(
5,
"Healing",
2,
"Healing will heal any entity it hits for 1 heart per level, unless of course that entity happens to be undead. Healing can be placed on a sword, bow and rod, and will heal the user when the rod is used."
);
CAMO = new IForceUpgrade(
CAMO = new ForceUpgrade(
5,
"Camo",
1,
"Camo will make Force Armor invisible, if you'd rather not appear to be wearing armor, or it can be placed on a Force Rod to give short spurts of invisibility to its user."
);
SIGHT = new IForceUpgrade(
SIGHT = new ForceUpgrade(
5,
"Sight",
1,
"Upgrading a Force Rod with Sight will give Night Vision to the user for about a minute per use. It's worth noting that only an unmodified Potion of Night Vision may be used."
);
ENDER = new IForceUpgrade(
ENDER = new ForceUpgrade(
6,
"Ender",
1,
"Teleportation - not just for endermen anymore! Harness this space-bending upgrade on a Force Sword or Rod for easy transportation, or have loads of fun griefing your buddies with the Ender Bow. Teleport responsibly."
);
STURDY = new IForceUpgrade(
STURDY = new ForceUpgrade(
6,
"Sturdy",
Config.sturdyLevel,
"This upgrade can be used to imbue Unbreaking on all Force Tools but the Shears and Sword, or it can be attached to Force Armor once to reduce incoming damage by a fairly signifcant amount. Sturdy can also be used to upgrade packs and belts to make them immune to damage and despawning."
);
SOUL = new IForceUpgrade(
SOUL = new ForceUpgrade(
6,
"Soul",
1,
"The Soul upgrade on Force Swords and socketed Power Saws will occasionally cause Mob Chunks to drop, which can be used to craft vanilla spawners for that mob or even be smelted into colored Mob Ingots."
);
EXPLOSION = new IForceUpgrade(7, "Explosion", 1, "This upgrade is not yet used.");
GRAFTING = new IForceUpgrade(
EXPLOSION = new ForceUpgrade(7, "Explosion", 1, "This upgrade is not yet used.");
GRAFTING = new ForceUpgrade(
7,
"Grafting",
1,
"This upgrade will give the Force Axe the potential to function as a Forestry Grafter on leaves that a grafter would normally function on. Of course this uses significant durability each time, so be prepared to throw some serious Liquid Force at this tool and apply some Sturdy upgrades if possible."
);
REPAIR = new IForceUpgrade(
REPAIR = new ForceUpgrade(
7,
"Repair",
1,
"This upgrade gives the Repair enchant from Thaumcraft on Force Tools. Repair will attempt to repair one durability damage per 10 seconds."
);
LIGHT = new IForceUpgrade(
LIGHT = new ForceUpgrade(
7,
"Light",
5,
"At the moment this can only be used to add Smite to Force Swords. (This will change eventually.)"
);
TREASURE = new IForceUpgrade(
TREASURE = new ForceUpgrade(
7,
"Treasure",
1,
"When entities are killed with a Treasure imbued weapon they will occasionally drop Treasure Cards, which can then be crafted into a Spoils Bag for some phat loot. Fortune increases the drop rate as well."
);
IMPERVIOUS = new IForceUpgrade(
IMPERVIOUS = new ForceUpgrade(
7,
"Impervious",
1,
@ -667,18 +669,22 @@ public class ForceUpgradeManager {
));
}
/*private static void loadWildCards() {
ForceWildCards.addWildCard(new IForceWildCard(new ItemStack(Block.stoneBrick, 1,
0), new ItemStack(DartBlock.forceBrick, 1, 11), FORCE)); ItemStack tomeStack = new
ItemStack((Item)DartItem.forceTome);
private static void loadWildCards() {
ForceWildCards.addWildCard(new ForceWildCard(
new ItemStack(Blocks.brick_block, 1, 0),
new ItemStack(DartBlocks.forcebrick[11], 1, 0),
FORCE
));
ItemStack tomeStack = new ItemStack((Item) DartItems.forcetome);
tomeStack.setTagCompound(TomeUtils.initExpComp());
ForceWildCards.addWildCard(new IForceWildCard(new ItemStack(Items.book),
tomeStack, EXP));
}*/
ForceWildCards.addWildCard(
new ForceWildCard(new ItemStack(Items.book), tomeStack, EXP)
);
}
public static boolean addUpgrade(IForceUpgrade upgrade) {
public static boolean addUpgrade(ForceUpgrade upgrade) {
if (upgrades.size() > 0)
for (IForceUpgrade temp : upgrades) {
for (ForceUpgrade temp : upgrades) {
if (temp.getID() == upgrade.getID())
return false;
}
@ -701,9 +707,9 @@ public class ForceUpgradeManager {
}
}
public static IForceUpgrade getFromID(int id) {
public static ForceUpgrade getFromID(int id) {
if (upgrades.size() > 0)
for (IForceUpgrade temp : upgrades) {
for (ForceUpgrade temp : upgrades) {
if (temp.getID() == id)
return temp;
}
@ -724,7 +730,7 @@ public class ForceUpgradeManager {
return null;
}
public static boolean isUpgradeValid(IForceUpgrade upgrade, IForceUpgradable item) {
public static boolean isUpgradeValid(ForceUpgrade upgrade, IForceUpgradable item) {
if (item.validUpgrades() != null)
for (int id : item.validUpgrades()) {
if (upgrade.getID() == id)

View file

@ -0,0 +1,198 @@
package ley.modding.dartcraft.util;
import ley.modding.dartcraft.api.upgrades.ForceUpgrade;
import ley.modding.dartcraft.api.upgrades.IForceUpgradeMaterial;
import ley.modding.dartcraft.item.DartItems;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class TomeUtils {
public static final int TIER_TWO = 96;
public static final int TIER_THREE = 270;
public static final int TIER_FOUR = 600;
public static final int TIER_FIVE = 1020;
public static final int TIER_SIX = 1440;
public static final int TIER_SEVEN = 2400;
public static final int TYPE_UPGRADE = 0;
public static final int TYPE_CRAFT = 1;
public static final int TYPE_EXP = 2;
public static int getTomeType(ItemStack stack) {
if (stack != null && stack.getItem() == DartItems.forcetome
&& stack.hasTagCompound() && stack.getTagCompound().hasKey("type")) {
return stack.getTagCompound().getInteger("type");
}
return -1;
}
public static int getPoints(ItemStack stack) {
int points = 0;
if (stack != null && stack.hasTagCompound()) {
NBTTagCompound comp = stack.getTagCompound();
for (ForceUpgrade upgrade : ForceUpgradeManager.upgrades) {
for (int i = 0; i < upgrade.getNumMats(); ++i) {
if (!comp.hasKey(upgrade.getName() + i))
continue;
points += TomeUtils.pointsFromTier(upgrade.getTier())
* comp.getInteger(upgrade.getName() + i);
if (comp.getInteger(upgrade.getName() + i) <= 0)
continue;
points += 25;
}
}
points += comp.getInteger("bonus");
}
return points;
}
public static int getStoredTier(ItemStack stack) {
if (stack != null && stack.hasTagCompound()) {
return stack.getTagCompound().getInteger("storedTier");
}
return 1;
}
public static void advanceTier(ItemStack stack) {
if (stack != null) {
if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
stack.getTagCompound().setInteger(
"storedTier", stack.getTagCompound().getInteger("storedTier") + 1
);
TomeUtils.canTomeAdvance(stack);
}
}
private static int pointsFromTier(int tier) {
switch (tier) {
case 0: {
return 1;
}
case 1: {
return 5;
}
case 2: {
return 15;
}
case 3: {
return 20;
}
case 4: {
return 25;
}
case 5:
case 6: {
return 40;
}
}
return 0;
}
public static boolean canTomeAdvance(ItemStack stack) {
int tier = TomeUtils.getStoredTier(stack);
int newTier = TomeUtils.getTierFromPoints(TomeUtils.getPoints(stack));
if (stack == null || !stack.hasTagCompound() || newTier <= tier) {
return false;
}
NBTTagCompound comp = stack.getTagCompound();
// TODO
//if (!Config.requiredMaterials) {
// return true;
//}
for (ForceUpgrade upgrade : ForceUpgradeManager.upgrades) {
for (int i = 0; i < upgrade.getNumMats(); ++i) {
IForceUpgradeMaterial mat;
if (upgrade.getTier() > tier
|| (mat = upgrade.getMaterialAt(i)) != null
&& mat.getDescription() == null
|| comp.hasKey(upgrade.getName() + i)
&& comp.getInteger(upgrade.getName() + i) > 0
|| !mat.isRequired())
continue;
stack.getTagCompound().setBoolean("canAdvance", false);
return false;
}
}
stack.getTagCompound().setBoolean("canAdvance", true);
return true;
}
public static boolean getCanAdvanceStored(ItemStack stack) {
if (stack != null && stack.hasTagCompound()) {
return stack.getTagCompound().getBoolean("canAdvance");
}
return false;
}
public static int getTierFromPoints(int points) {
if (points < 96) {
return 1;
}
if (points < 270) {
return 2;
}
if (points < 600) {
return 3;
}
if (points < 1020) {
return 4;
}
if (points < 1440) {
return 5;
}
if (points < 2400) {
return 6;
}
return 7;
}
public static int getPointsToNext(ItemStack stack) {
int points = TomeUtils.getPoints(stack);
int tier = TomeUtils.getStoredTier(stack);
if (tier < 2) {
return 96 - points;
}
if (tier < 3) {
return 270 - points;
}
if (tier < 4) {
return 600 - points;
}
if (tier < 5) {
return 1020 - points;
}
if (tier < 6) {
return 1440 - points;
}
if (tier < 7) {
return 2400 - points;
}
return 0;
}
public static NBTTagCompound initUpgradeComp(boolean debug) {
NBTTagCompound data = new NBTTagCompound();
data.setInteger("type", 0);
if (debug) {
data.setInteger("storedTier", 7);
data.setInteger("bonus", 2400);
for (ForceUpgrade upgrade : ForceUpgradeManager.upgrades) {
for (int i = 0; i < upgrade.getNumMats(); ++i) {
data.setInteger(upgrade.getName() + i, 1);
}
}
} else {
data.setInteger("storedTier", 1);
data.setInteger("bonus", 0);
}
return data;
}
public static NBTTagCompound initExpComp() {
NBTTagCompound data = new NBTTagCompound();
data.setInteger("type", 2);
data.setInteger("stored", 0);
return data;
}
}

View file

@ -1,7 +0,0 @@
package ley.modding.tileralib.api;
import net.minecraft.item.ItemBlock;
public interface ICustomItemBlockProvider {
Class<? extends ItemBlock> getItemBlockClass();
}

View file

@ -1,9 +0,0 @@
package ley.modding.tileralib.api;
public interface IIngredient {
char getKey();
int getCount();
Object getIngredient();
}

View file

@ -1,21 +0,0 @@
package ley.modding.tileralib.api;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public interface IRegistry {
String getModID();
Item registerItem(Item item);
Block registerBlock(Block block);
Item getItem(String id);
Block getBlock(String id);
void addShapedRecipe(ItemStack output, String[] pattern, IIngredient[] ingredients);
void addShapelessRecipe(ItemStack output, IIngredient[] input);
}

View file

@ -1,7 +0,0 @@
package ley.modding.tileralib.api;
import net.minecraft.tileentity.TileEntity;
public interface ITEProvider {
Class<? extends TileEntity> getTEClass();
}

View file

@ -1,2 +1,3 @@
public net.minecraft.entity.monster.EntityCreeper field_82225_f # fuseTime
public net.minecraft.entity.monster.EntityCreeper field_82226_g # explosionRadius
public net.minecraft.client.gui.inventory.GuiContainer func_146981_a(Lnet/minecraft/inventory/Slot;II)Z # isMouseOverSlot

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

@ -6,6 +6,7 @@ item.forceshard.name=Force Shard
item.forcemitts.name=Force Mitts
item.forceshears.name=Force Shears
item.forceshovel.name=Force Shovel
item.forcepickaxe.name=Force Pickaxe
item.forceaxe.name=Force Axe
item.forceflask_empty.name=Force Flask
item.forceflask_milk.name=Milk Flask
@ -14,12 +15,16 @@ item.forceflask_potion_green.name=Green Liquid Flask
item.forceflask_potion_blue.name=Blue Liquid Flask
item.forceflask_potion_red.name=Red Liquid Flask
item.clipboard.name=Clipboard
item.forcetome_upgrade.name=Upgrade Tome
item.forcetome_experience.name=Experience Tome
item.claw.name=Claw
tile.powerore0.name=Power Ore
tile.powerore1.name=Nether Power Ore
tile.forcelog.name=Force Log
tile.forceleaves.name=Force Leaves
tile.forcesapling.name=Force Sapling
tile.forcepickaxe.name=Force Pickaxe
tile.infuser.name=Force Infuser
tile.forceplanks.name=Force Planks
tile.forcebrick0.name=Black Force Brick

View file

@ -52,6 +52,15 @@
}
]
},
"socket": {
"category": "master",
"sounds": [
{
"name": "socket",
"stream": false
}
]
},
"swipe": {
"category": "master",
"sounds": [

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Some files were not shown because too many files have changed in this diff Show more