generated from tilera/1710mod
feat: modifiers/upgrades
This commit is contained in:
parent
f4a938ab3d
commit
ffab2a109d
19
build.gradle
19
build.gradle
|
@ -11,7 +11,9 @@ buildscript {
|
|||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {
|
||||
changing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,22 +47,15 @@ repositories {
|
|||
dependencies {
|
||||
compile "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
|
||||
compile "codechicken:CodeChickenCore:1.7.10-1.0.7.48:dev"
|
||||
compile "codechicken:CodeChickenLib:1.7.10-1.1.3.141:dev"
|
||||
compile "universalelectricity:basiccomponents:1.0.2-dirty:deobf"
|
||||
compile "codechicken:CodeChickenLib:1.7.10-1.1.3.141:dev"
|
||||
compile "universalelectricity:basiccomponents:1.1.1:deobf"
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
filesMatching('mcmod.info') {
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.minecraft.inventory.IInventory;
|
|||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import universalelectricity.core.item.IItemElectric;
|
||||
import universalelectricity.prefab.modifier.SlotModifier;
|
||||
|
||||
public class ContainerAdvBatteryBox extends Container {
|
||||
private TileEntityAdvancedBatteryBox tileEntity;
|
||||
|
@ -19,12 +20,8 @@ public class ContainerAdvBatteryBox extends Container {
|
|||
(IInventory) advBatteryBox, 0, 11, 24));
|
||||
this.addSlotToContainer((Slot) new SlotUniversalElectricItem(
|
||||
(IInventory) advBatteryBox, 1, 11, 48));
|
||||
// TODO: WTF
|
||||
// this.addSlotToContainer((Slot)new SlotModifier((IInventory)advBatteryBox,
|
||||
// 2, 149, 7)); this.addSlotToContainer((Slot)new
|
||||
// SlotModifier((IInventory)advBatteryBox, 3, 149, 31));
|
||||
// this.addSlotToContainer((Slot)new SlotModifier((IInventory)advBatteryBox,
|
||||
// 4, 149, 55));
|
||||
this.addSlotToContainer((Slot)new SlotModifier((IInventory)advBatteryBox, 2, 149, 7)); this.addSlotToContainer((Slot)new SlotModifier((IInventory)advBatteryBox, 3, 149, 31));
|
||||
this.addSlotToContainer((Slot)new SlotModifier((IInventory)advBatteryBox, 4, 149, 55));
|
||||
this.addSlotToContainer(new Slot((IInventory) advBatteryBox, 2, 149, 7));
|
||||
this.addSlotToContainer(new Slot((IInventory) advBatteryBox, 3, 149, 31));
|
||||
this.addSlotToContainer(new Slot((IInventory) advBatteryBox, 4, 149, 55));
|
||||
|
|
|
@ -8,15 +8,14 @@ import java.util.List;
|
|||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
// TODO: WTF
|
||||
// import universalelectricity.prefab.modifier.IModifier;
|
||||
import universalelectricity.prefab.modifier.IModifier;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import universalelectricity.core.electricity.ElectricityDisplay;
|
||||
|
||||
public class ItemUpgrade extends Item /* implements IModifier */ {
|
||||
public class ItemUpgrade extends Item implements IModifier {
|
||||
private String[] names;
|
||||
private IIcon[] icons;
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -65,7 +64,7 @@ public class ItemUpgrade extends Item /* implements IModifier */ {
|
|||
}
|
||||
}
|
||||
|
||||
//@Override
|
||||
@Override
|
||||
public String getType(final ItemStack itemstack) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0:
|
||||
|
@ -96,7 +95,7 @@ public class ItemUpgrade extends Item /* implements IModifier */ {
|
|||
}
|
||||
}
|
||||
|
||||
//@Override
|
||||
@Override
|
||||
public double getEffectiveness(final ItemStack itemstack) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
|
@ -170,7 +169,7 @@ public class ItemUpgrade extends Item /* implements IModifier */ {
|
|||
}
|
||||
}
|
||||
|
||||
//@Override
|
||||
@Override
|
||||
public int getTier(final ItemStack i) {
|
||||
switch (i.getItemDamage()) {
|
||||
case 0: {
|
||||
|
|
|
@ -118,7 +118,7 @@ public class EENetwork implements IElectricityNetwork
|
|||
for (final Vector3 node2 : (Iterable<Vector3>)finder.closedSet) {
|
||||
final TileEntity nodeTile2 = node2.getTileEntity((IBlockAccess)((TileEntity)splitPoint).getWorldObj());
|
||||
if (nodeTile2 instanceof INetworkProvider && nodeTile2 != splitPoint) {
|
||||
newNetwork.getConductors().add(nodeTile2);
|
||||
newNetwork.getConductors().add((IConductor) nodeTile2);
|
||||
}
|
||||
}
|
||||
newNetwork.cleanUpConductors();
|
||||
|
@ -353,4 +353,12 @@ public class EENetwork implements IElectricityNetwork
|
|||
public void addRsInterfacer(final IRedstoneNetAccessor interfacer) {
|
||||
this.redstoneInterfacers.add(interfacer);
|
||||
}
|
||||
|
||||
public boolean isInactive() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import universalelectricity.core.item.IItemElectric;
|
|||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import universalelectricity.prefab.implement.IRedstoneProvider;
|
||||
import universalelectricity.prefab.modifier.IModifier;
|
||||
import universalelectricity.prefab.tile.TileEntityElectricityStorage;
|
||||
|
||||
public class TileEntityAdvancedBatteryBox extends TileEntityElectricityStorage
|
||||
|
@ -244,28 +245,27 @@ public class TileEntityAdvancedBatteryBox extends TileEntityElectricityStorage
|
|||
double slot1 = 0.0;
|
||||
double slot2 = 0.0;
|
||||
double slot3 = 0.0;
|
||||
// TODO: austri3Fix
|
||||
// if (this.containingItems[2] != null &&
|
||||
// this.containingItems[2].getItem() instanceof IModifier &&
|
||||
// ((IModifier) this.containingItems[2].getItem())
|
||||
// .getType(this.containingItems[2]) == "Capacity") {
|
||||
// slot1 = ((IModifier) this.containingItems[2].getItem())
|
||||
// .getEffectiveness(this.containingItems[2]);
|
||||
// }
|
||||
// if (this.containingItems[3] != null &&
|
||||
// this.containingItems[3].getItem() instanceof IModifier &&
|
||||
// ((IModifier) this.containingItems[3].getItem())
|
||||
// .getType(this.containingItems[3]) == "Capacity") {
|
||||
// slot2 = ((IModifier) this.containingItems[3].getItem())
|
||||
// .getEffectiveness(this.containingItems[3]);
|
||||
// }
|
||||
// if (this.containingItems[4] != null &&
|
||||
// this.containingItems[4].getItem() instanceof IModifier &&
|
||||
// ((IModifier) this.containingItems[4].getItem())
|
||||
// .getType(this.containingItems[4]) == "Capacity") {
|
||||
// slot3 = ((IModifier) this.containingItems[4].getItem())
|
||||
// .getEffectiveness(this.containingItems[4]);
|
||||
// }
|
||||
if (this.containingItems[2] != null &&
|
||||
this.containingItems[2].getItem() instanceof IModifier &&
|
||||
((IModifier) this.containingItems[2].getItem())
|
||||
.getType(this.containingItems[2]) == "Capacity") {
|
||||
slot1 = ((IModifier) this.containingItems[2].getItem())
|
||||
.getEffectiveness(this.containingItems[2]);
|
||||
}
|
||||
if (this.containingItems[3] != null &&
|
||||
this.containingItems[3].getItem() instanceof IModifier &&
|
||||
((IModifier) this.containingItems[3].getItem())
|
||||
.getType(this.containingItems[3]) == "Capacity") {
|
||||
slot2 = ((IModifier) this.containingItems[3].getItem())
|
||||
.getEffectiveness(this.containingItems[3]);
|
||||
}
|
||||
if (this.containingItems[4] != null &&
|
||||
this.containingItems[4].getItem() instanceof IModifier &&
|
||||
((IModifier) this.containingItems[4].getItem())
|
||||
.getType(this.containingItems[4]) == "Capacity") {
|
||||
slot3 = ((IModifier) this.containingItems[4].getItem())
|
||||
.getEffectiveness(this.containingItems[4]);
|
||||
}
|
||||
return 5000000.0 + slot1 + slot2 + slot3;
|
||||
}
|
||||
|
||||
|
@ -314,28 +314,27 @@ public class TileEntityAdvancedBatteryBox extends TileEntityElectricityStorage
|
|||
double slot1 = 1.0;
|
||||
double slot2 = 1.0;
|
||||
double slot3 = 1.0;
|
||||
// TODO: austri3Fix
|
||||
// if (this.containingItems[2] != null &&
|
||||
// this.containingItems[2].getItem() instanceof IModifier &&
|
||||
// ((IModifier) this.containingItems[2].getItem())
|
||||
// .getType(this.containingItems[2]) == type) {
|
||||
// slot1 = ((IModifier) this.containingItems[2].getItem())
|
||||
// .getEffectiveness(this.containingItems[2]);
|
||||
// }
|
||||
// if (this.containingItems[3] != null &&
|
||||
// this.containingItems[3].getItem() instanceof IModifier &&
|
||||
// ((IModifier) this.containingItems[3].getItem())
|
||||
// .getType(this.containingItems[3]) == type) {
|
||||
// slot2 = ((IModifier) this.containingItems[3].getItem())
|
||||
// .getEffectiveness(this.containingItems[3]);
|
||||
// }
|
||||
// if (this.containingItems[4] != null &&
|
||||
// this.containingItems[4].getItem() instanceof IModifier &&
|
||||
// ((IModifier) this.containingItems[4].getItem())
|
||||
// .getType(this.containingItems[4]) == type) {
|
||||
// slot3 = ((IModifier) this.containingItems[4].getItem())
|
||||
// .getEffectiveness(this.containingItems[4]);
|
||||
// }
|
||||
if (this.containingItems[2] != null &&
|
||||
this.containingItems[2].getItem() instanceof IModifier &&
|
||||
((IModifier) this.containingItems[2].getItem())
|
||||
.getType(this.containingItems[2]) == type) {
|
||||
slot1 = ((IModifier) this.containingItems[2].getItem())
|
||||
.getEffectiveness(this.containingItems[2]);
|
||||
}
|
||||
if (this.containingItems[3] != null &&
|
||||
this.containingItems[3].getItem() instanceof IModifier &&
|
||||
((IModifier) this.containingItems[3].getItem())
|
||||
.getType(this.containingItems[3]) == type) {
|
||||
slot2 = ((IModifier) this.containingItems[3].getItem())
|
||||
.getEffectiveness(this.containingItems[3]);
|
||||
}
|
||||
if (this.containingItems[4] != null &&
|
||||
this.containingItems[4].getItem() instanceof IModifier &&
|
||||
((IModifier) this.containingItems[4].getItem())
|
||||
.getType(this.containingItems[4]) == type) {
|
||||
slot3 = ((IModifier) this.containingItems[4].getItem())
|
||||
.getEffectiveness(this.containingItems[4]);
|
||||
}
|
||||
return slot1 * slot2 * slot3;
|
||||
}
|
||||
|
||||
|
@ -343,28 +342,27 @@ public class TileEntityAdvancedBatteryBox extends TileEntityElectricityStorage
|
|||
double slot1 = 0.0;
|
||||
double slot2 = 0.0;
|
||||
double slot3 = 0.0;
|
||||
// TODO: austri3Fix
|
||||
// if (this.containingItems[2] != null &&
|
||||
// this.containingItems[2].getItem() instanceof IModifier &&
|
||||
// ((IModifier) this.containingItems[2].getItem())
|
||||
// .getType(this.containingItems[2]) == "Unlimiter") {
|
||||
// slot1 = ((IModifier) this.containingItems[2].getItem())
|
||||
// .getEffectiveness(this.containingItems[2]);
|
||||
// }
|
||||
// if (this.containingItems[3] != null &&
|
||||
// this.containingItems[3].getItem() instanceof IModifier &&
|
||||
// ((IModifier) this.containingItems[3].getItem())
|
||||
// .getType(this.containingItems[3]) == "Unlimiter") {
|
||||
// slot2 = ((IModifier) this.containingItems[3].getItem())
|
||||
// .getEffectiveness(this.containingItems[3]);
|
||||
// }
|
||||
// if (this.containingItems[4] != null &&
|
||||
// this.containingItems[4].getItem() instanceof IModifier &&
|
||||
// ((IModifier) this.containingItems[4].getItem())
|
||||
// .getType(this.containingItems[4]) == "Unlimiter") {
|
||||
// slot3 = ((IModifier) this.containingItems[4].getItem())
|
||||
// .getEffectiveness(this.containingItems[4]);
|
||||
// }
|
||||
if (this.containingItems[2] != null &&
|
||||
this.containingItems[2].getItem() instanceof IModifier &&
|
||||
((IModifier) this.containingItems[2].getItem())
|
||||
.getType(this.containingItems[2]) == "Unlimiter") {
|
||||
slot1 = ((IModifier) this.containingItems[2].getItem())
|
||||
.getEffectiveness(this.containingItems[2]);
|
||||
}
|
||||
if (this.containingItems[3] != null &&
|
||||
this.containingItems[3].getItem() instanceof IModifier &&
|
||||
((IModifier) this.containingItems[3].getItem())
|
||||
.getType(this.containingItems[3]) == "Unlimiter") {
|
||||
slot2 = ((IModifier) this.containingItems[3].getItem())
|
||||
.getEffectiveness(this.containingItems[3]);
|
||||
}
|
||||
if (this.containingItems[4] != null &&
|
||||
this.containingItems[4].getItem() instanceof IModifier &&
|
||||
((IModifier) this.containingItems[4].getItem())
|
||||
.getType(this.containingItems[4]) == "Unlimiter") {
|
||||
slot3 = ((IModifier) this.containingItems[4].getItem())
|
||||
.getEffectiveness(this.containingItems[4]);
|
||||
}
|
||||
return (100.0 + slot1) * (100.0 + slot2) * (100.0 + slot3) / 1000000.0 *
|
||||
10000.0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue