initial 1.6.2 migration
This commit is contained in:
parent
cdd202a3de
commit
11952d676c
31 changed files with 137 additions and 93 deletions
12
build.xml
12
build.xml
|
@ -4,21 +4,21 @@
|
|||
|
||||
|
||||
<!-- Versions -->
|
||||
<property name="build.ver" value="0.7.1"/>
|
||||
<property name="build.ver" value="0.8.0"/>
|
||||
<property name="fullversion" value="${build.ver}-${env.BUILD_NUMBER}"/>
|
||||
<property name="scala.version" value="2.10.1"/>
|
||||
|
||||
<property name="mcp.version" value="742"/>
|
||||
<property name="minecraft.version" value="1.5.2"/>
|
||||
<property name="forgemajor.version" value="7.8.0"/>
|
||||
<property name="forgebuild" value="712"/>
|
||||
<property name="mcp.version" value="805"/>
|
||||
<property name="minecraft.version" value="1.6.2"/>
|
||||
<property name="forgemajor.version" value="9.10.0"/>
|
||||
<property name="forgebuild" value="802"/>
|
||||
|
||||
<property name="forge.version" value="${minecraft.version}-${forgemajor.version}.${forgebuild}"/>
|
||||
<property name="forgeant.version" value="${forgemajor.version}.${forgebuild}"/>
|
||||
|
||||
<property name="ic2api.version" value="1.116.354-lf"/>
|
||||
<property name="ueapi.version" value="1.3.1.56"/>
|
||||
<property name="asapi.version" value="0.5.1.3"/>
|
||||
<property name="asapi.version" value="0.7.0.114"/>
|
||||
<property name="icbmapi.version" value="1.1.1.26"/>
|
||||
<property name="thermexapi.version" value="2.3.0b"/>
|
||||
<property name="galacticraftapi.version" value="1"/>
|
||||
|
|
|
@ -5,9 +5,9 @@ import net.minecraft.item.ItemStack
|
|||
import net.machinemuse.utils.{ElectricItemUtils, MuseItemUtils}
|
||||
import net.machinemuse.powersuits.powermodule.armor.{HazmatModule, ApiaristArmorModule}
|
||||
import forestry.api.apiculture.IArmorApiarist
|
||||
import net.minecraft.entity.EntityLiving
|
||||
import atomicscience.api.poison.Poison
|
||||
import net.minecraft.entity.EntityLivingBase
|
||||
import atomicscience.api.IAntiPoisonArmor
|
||||
import atomicscience.api.poison.Poison
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
|
@ -29,9 +29,9 @@ trait ApiaristArmor extends IArmorApiarist {
|
|||
}
|
||||
|
||||
trait RadiationArmor extends IAntiPoisonArmor {
|
||||
def isProtectedFromPoison(itemStack: ItemStack, entityLiving: EntityLiving, `type`: Poison): Boolean = {
|
||||
def isProtectedFromPoison(itemStack: ItemStack, EntityLivingBase: EntityLivingBase, `type`: Poison): Boolean = {
|
||||
MuseItemUtils.itemHasActiveModule(itemStack, HazmatModule.MODULE_HAZMAT)
|
||||
}
|
||||
|
||||
def onProtectFromPoison(itemStack: ItemStack, entityLiving: EntityLiving, `type`: Poison) {}
|
||||
def onProtectFromPoison(itemStack: ItemStack, EntityLivingBase: EntityLivingBase, `type`: Poison) {}
|
||||
}
|
|
@ -11,6 +11,7 @@ import universalelectricity.prefab.implement.IToolConfigurator
|
|||
import cpw.mods.fml.common.FMLCommonHandler
|
||||
import mods.mffs.api.IFieldTeleporter
|
||||
import powercrystals.minefactoryreloaded.api.IToolHammerAdvanced
|
||||
import net.minecraft.util.ChatMessageComponent
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
|
@ -79,7 +80,7 @@ trait ForceFieldManipulator extends IFieldTeleporter {
|
|||
return true
|
||||
}
|
||||
else if (FMLCommonHandler.instance.getEffectiveSide.isServer) {
|
||||
player.sendChatToPlayer("[Field Security] Could not teleport through forcefield. 20,000J is required to teleport.")
|
||||
player.sendChatToPlayer(ChatMessageComponent.func_111066_d("[Field Security] Could not teleport through forcefield. 20,000J is required to teleport."))
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.machinemuse.utils.render.MuseRenderer;
|
|||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -55,7 +56,7 @@ public class ClickableKeybinding extends ClickableButton {
|
|||
for (ClickableModule module : boundModules) {
|
||||
String valstring = toggleval ? " on" : " off";
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
||||
player.sendChatToPlayer("Toggled " + module.getModule().getDataName() + valstring);
|
||||
player.sendChatToPlayer(ChatMessageComponent.func_111066_d("Toggled " + module.getModule().getDataName() + valstring));
|
||||
}
|
||||
MuseItemUtils.toggleModuleForPlayer(player, module.getModule().getDataName(), toggleval);
|
||||
MusePacketToggleRequest toggleRequest = new MusePacketToggleRequest((Player) player, module.getModule().getDataName(), toggleval);
|
||||
|
|
|
@ -32,7 +32,7 @@ class PartManipSubFrame(val model: ModelSpec, val colourframe: ColourPickerFrame
|
|||
|
||||
def getItemTag = MuseItemUtils.getMuseItemTag(getSelectedItem.getItem)
|
||||
|
||||
def isValidArmor(clickie: ClickableItem, slot: Int): Boolean = if (clickie == null) false else clickie.getItem.getItem.isValidArmor(clickie.getItem, slot)
|
||||
def isValidArmor(clickie: ClickableItem, slot: Int): Boolean = if (clickie == null) false else clickie.getItem.getItem.isValidArmor(clickie.getItem, slot, Minecraft.getMinecraft.thePlayer)
|
||||
|
||||
def getSpecTag(spec: ModelPartSpec) = getRenderTag.getCompoundTag(ModelRegistry.makeName(spec))
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class RecipeManager {
|
|||
ItemStack paper = new ItemStack(Item.paper);
|
||||
ItemStack glass = new ItemStack(Block.glass);
|
||||
ItemStack glassPane = new ItemStack(Block.thinGlass);
|
||||
ItemStack glowstone = new ItemStack(Item.lightStoneDust);
|
||||
ItemStack glowstone = new ItemStack(Item.glowstone);
|
||||
ItemStack emerald = new ItemStack(Item.emerald);
|
||||
ItemStack diamond = new ItemStack(Item.diamond);
|
||||
ItemStack lapis = new ItemStack(Item.dyePowder, 1, 4);
|
||||
|
|
|
@ -13,10 +13,11 @@ import net.machinemuse.powersuits.common.Config
|
|||
* Handles sound mechanics
|
||||
*/
|
||||
object Musique {
|
||||
def soundsystem = SoundManager.sndSystem
|
||||
|
||||
def mcsound = Minecraft.getMinecraft.sndManager
|
||||
|
||||
def soundsystem = mcsound.sndSystem
|
||||
|
||||
def options = Minecraft.getMinecraft.gameSettings
|
||||
|
||||
val soundprefix = "MMMPS"
|
||||
|
@ -44,7 +45,7 @@ object Musique {
|
|||
if (!soundsystem.playing(soundid)) {
|
||||
val soundfile = getSoundPoolEntry(soundname)
|
||||
val amp: Float = 16.0F * Math.max(1, volume)
|
||||
soundsystem.newSource(unknownflag, soundid, soundfile.soundUrl, soundfile.soundName, false, player.posX.toFloat, player.posY.toFloat, player.posZ.toFloat, 2, amp)
|
||||
soundsystem.newSource(unknownflag, soundid, soundfile.func_110457_b, soundfile.func_110458_a, false, player.posX.toFloat, player.posY.toFloat, player.posZ.toFloat, 2, amp)
|
||||
soundsystem.setLooping(soundid, continuous)
|
||||
soundsystem.play(soundid)
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public class SoundLoader {
|
|||
public void onSoundLoad(SoundLoadEvent event) {
|
||||
for (String soundFile : soundFiles) {
|
||||
try {
|
||||
event.manager.soundPoolSounds.addSound(soundFile, ModularPowersuits.class.getResource('/' + soundFile));
|
||||
event.manager.soundPoolSounds.addSound(soundFile);
|
||||
MuseLogger.logDebug("MMMPS registered sound: " + soundFile);
|
||||
} catch (Exception e) {
|
||||
MuseLogger.logError("Failed to register sound:" + soundFile);
|
||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.entity.Entity
|
|||
* Author: MachineMuse (Claire Semple)
|
||||
* Created: 1:08 PM, 5/8/13
|
||||
*/
|
||||
class RenderMultiBlockEntity extends Render {
|
||||
abstract class RenderMultiBlockEntity extends Render {
|
||||
|
||||
|
||||
def doRender(entity: EntityMultiBlock, x: Double, y: Double, z: Double, yaw: Float, partialTickTime: Float) {
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package net.machinemuse.powersuits.client.render.block;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
* Created: 4:28 PM, 8/3/13
|
||||
*/
|
||||
public abstract class MuseTESR extends TileEntitySpecialRenderer {
|
||||
public void bindTextureByName(String tex) {
|
||||
this.func_110628_a(new ResourceLocation(tex));
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
|
||||
public class RenderLuxCapacitorTESR extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||
public class RenderLuxCapacitorTESR extends MuseTESR implements ISimpleBlockRenderingHandler {
|
||||
protected static WavefrontObject lightmodel;
|
||||
protected static WavefrontObject framemodel;
|
||||
protected int renderId;
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.lwjgl.opengl.GL11;
|
|||
*
|
||||
* @author MachineMuse
|
||||
*/
|
||||
public class TinkerTableRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||
public class TinkerTableRenderer extends MuseTESR implements ISimpleBlockRenderingHandler {
|
||||
protected TinkerTableModel model;
|
||||
protected int renderId;
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package net.machinemuse.powersuits.client.render.entity;
|
||||
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
* Created: 4:31 PM, 8/3/13
|
||||
*/
|
||||
public abstract class MuseRender extends Render {
|
||||
|
||||
@Override
|
||||
protected ResourceLocation func_110775_a(Entity entity) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -4,12 +4,13 @@ import net.machinemuse.powersuits.common.Config;
|
|||
import net.machinemuse.utils.render.MuseRenderer;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.obj.WavefrontObject;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
|
||||
public class RenderLuxCapacitorEntity extends Render {
|
||||
public class RenderLuxCapacitorEntity extends MuseRender {
|
||||
protected static WavefrontObject lightmodel;
|
||||
protected static WavefrontObject framemodel;
|
||||
|
||||
|
@ -42,4 +43,5 @@ public class RenderLuxCapacitorEntity extends Render {
|
|||
MuseRenderer.popTexture();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.lwjgl.opengl.GL12;
|
|||
|
||||
import java.nio.DoubleBuffer;
|
||||
|
||||
public class RenderPlasmaBolt extends Render {
|
||||
public class RenderPlasmaBolt extends MuseRender {
|
||||
protected static DrawableMuseCircle circle1;
|
||||
protected static DrawableMuseCircle circle2;
|
||||
protected static DrawableMuseCircle circle3;
|
||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.entity.Entity;
|
|||
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
|
||||
public class RenderSpinningBlade extends Render {
|
||||
public class RenderSpinningBlade extends MuseRender {
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float yaw, float partialticktime) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import net.machinemuse.general.MuseLogger
|
|||
import net.machinemuse.powersuits.client.render.modelspec._
|
||||
import net.minecraft.client.model.{ModelBiped, ModelRenderer}
|
||||
import net.minecraft.entity.Entity
|
||||
import net.minecraft.entity.EntityLiving
|
||||
import net.minecraft.entity.EntityLivingBase
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraftforge.client.model.obj.WavefrontObject
|
||||
|
@ -46,9 +46,9 @@ trait ArmorModel extends ModelBiped {
|
|||
|
||||
|
||||
def setInitialOffsets(r: ModelRenderer, x: Float, y: Float, z: Float) {
|
||||
r.field_82906_o = x
|
||||
r.field_82907_q = y
|
||||
r.field_82908_p = z
|
||||
r.offsetX = x
|
||||
r.offsetY = y
|
||||
r.offsetZ = z
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,7 +56,7 @@ trait ArmorModel extends ModelBiped {
|
|||
*/
|
||||
override def render(entity: Entity, par2: Float, par3: Float, par4: Float, par5: Float, par6: Float, scale: Float) {
|
||||
try {
|
||||
val entLive: EntityLiving = entity.asInstanceOf[EntityLiving]
|
||||
val entLive: EntityLivingBase = entity.asInstanceOf[EntityLivingBase]
|
||||
val stack: ItemStack = entLive.getCurrentItemOrArmor(0)
|
||||
this.heldItemRight = if (stack != null) 1 else 0
|
||||
this.isSneak = entLive.isSneaking
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
package net.machinemuse.powersuits.client.render.item;
|
||||
|
||||
import net.machinemuse.general.geometry.Colour;
|
||||
import net.machinemuse.powersuits.client.render.entity.MuseRender;
|
||||
import net.machinemuse.powersuits.common.ModularPowersuits;
|
||||
import net.machinemuse.powersuits.item.ItemPowerFist;
|
||||
import net.machinemuse.utils.render.MuseRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.RenderEngine;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.storage.MapData;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
@ -28,7 +31,7 @@ import org.lwjgl.opengl.GL12;
|
|||
*
|
||||
* @author MachineMuse
|
||||
*/
|
||||
public class ToolRenderer extends Render implements IItemRenderer {
|
||||
public class ToolRenderer extends MuseRender implements IItemRenderer {
|
||||
public ToolModel model = new ToolModel();
|
||||
|
||||
/**
|
||||
|
@ -73,7 +76,7 @@ public class ToolRenderer extends Render implements IItemRenderer {
|
|||
break;
|
||||
case EQUIPPED:
|
||||
RenderBlocks renderEquipped = (RenderBlocks) data[0];
|
||||
EntityLiving entityEquipped = (EntityLiving) data[1];
|
||||
EntityLivingBase entityEquipped = (EntityLivingBase) data[1];
|
||||
|
||||
if (entityEquipped instanceof EntityPlayer) {
|
||||
model.setPoseForPlayer((EntityPlayer) entityEquipped, itemStack);
|
||||
|
@ -85,7 +88,7 @@ public class ToolRenderer extends Render implements IItemRenderer {
|
|||
break;
|
||||
case FIRST_PERSON_MAP:
|
||||
EntityPlayer playerFirstPerson = (EntityPlayer) data[0];
|
||||
RenderEngine engineFirstPerson = (RenderEngine) data[1];
|
||||
TextureManager engineFirstPerson = (TextureManager) data[1];
|
||||
MapData mapDataFirstPerson = (MapData) data[2];
|
||||
model.setPoseForPlayer(playerFirstPerson, itemStack);
|
||||
|
||||
|
@ -93,7 +96,7 @@ public class ToolRenderer extends Render implements IItemRenderer {
|
|||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
RenderBlocks renderEquFP = (RenderBlocks) data[0];
|
||||
EntityLiving entityEquFP = (EntityLiving) data[1];
|
||||
EntityLivingBase entityEquFP = (EntityLivingBase) data[1];
|
||||
if (entityEquFP instanceof EntityPlayer) {
|
||||
model.setPoseForPlayer((EntityPlayer) entityEquFP, itemStack);
|
||||
} else {
|
||||
|
@ -129,7 +132,6 @@ public class ToolRenderer extends Render implements IItemRenderer {
|
|||
|
||||
}
|
||||
|
||||
|
||||
public void renderFirstPersonArm(EntityClientPlayerMP entityclientplayermp, float par1) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
float changeItemProgress = 0;
|
||||
|
@ -148,8 +150,8 @@ public class ToolRenderer extends Render implements IItemRenderer {
|
|||
swingProgressy = MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float) Math.PI);
|
||||
GL11.glRotatef(swingProgressy * 70.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-swingProgressx * 20.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTextureForDownloadableImage(mc.thePlayer.skinUrl, mc.thePlayer.getTexture()));
|
||||
mc.renderEngine.resetBoundTexture();
|
||||
// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTextureForDownloadableImage(mc.thePlayer.skinUrl, mc.thePlayer.getTexture()));
|
||||
// mc.renderEngine.resetBoundTexture();
|
||||
GL11.glTranslatef(-1.0F, 3.6F, 3.5F);
|
||||
GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F);
|
||||
|
|
|
@ -3,11 +3,13 @@ package net.machinemuse.powersuits.client.render.modelspec
|
|||
import net.machinemuse.general.geometry.Colour
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.machinemuse.powersuits.client.render.item.ArmorModel
|
||||
import net.machinemuse.utils.render.Render
|
||||
import net.machinemuse.utils.render.{MuseRenderer, Render}
|
||||
import net.minecraft.client.model.{ModelBase, ModelRenderer}
|
||||
import net.machinemuse.general.NBTTagAccessor
|
||||
import org.lwjgl.opengl.GL11._
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import java.net.URI
|
||||
import net.minecraft.util.ResourceLocation
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
|
@ -30,7 +32,7 @@ class RenderPart(base: ModelBase, val parent: ModelRenderer) extends ModelRender
|
|||
Render.withPushedMatrix {
|
||||
Render {
|
||||
glScaled(scale, scale, scale)
|
||||
Minecraft.getMinecraft.renderEngine.bindTexture(part.getTexture(nbt))
|
||||
MuseRenderer.bindTexture(part.getTexture(nbt))
|
||||
applyTransform
|
||||
val ix = part.getColourIndex(nbt)
|
||||
if (ix < colours.size && ix >= 0) {
|
||||
|
@ -63,7 +65,7 @@ class RenderPart(base: ModelBase, val parent: ModelRenderer) extends ModelRender
|
|||
// glRotatef(rotateAngleX * degrad, 1.0F, 0.0F, 0.0F)
|
||||
glRotatef(180, 1.0F, 0.0F, 0.0F)
|
||||
|
||||
glTranslated(field_82906_o, field_82907_q - 26, field_82908_p)
|
||||
glTranslated(offsetX, offsetY - 26, offsetZ)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.io._
|
|||
import net.machinemuse.general.MuseLogger
|
||||
import java.util.Properties
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry
|
||||
import net.minecraft.client.Minecraft
|
||||
import com.google.common.base.Charsets
|
||||
|
||||
/**
|
||||
|
@ -15,7 +16,7 @@ object Localization {
|
|||
val LANG_PATH = "/mods/mmmPowersuits/lang/"
|
||||
var extractedLanguage = ""
|
||||
|
||||
def getCurrentLanguage = StringTranslate.getInstance().getCurrentLanguage
|
||||
def getCurrentLanguage = Minecraft.getMinecraft.func_135016_M().func_135041_c().func_135034_a()
|
||||
|
||||
def loadCurrentLanguage() {
|
||||
if (getCurrentLanguage != extractedLanguage) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package net.machinemuse.powersuits.entity;
|
|||
import net.machinemuse.powersuits.block.BlockLuxCapacitor;
|
||||
import net.machinemuse.powersuits.block.TileEntityLuxCapacitor;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
|
@ -17,7 +17,7 @@ public class EntityLuxCapacitor extends EntityThrowable {
|
|||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityLuxCapacitor(World par1World, EntityLiving shootingEntity) {
|
||||
public EntityLuxCapacitor(World par1World, EntityLivingBase shootingEntity) {
|
||||
super(par1World, shootingEntity);
|
||||
Vec3 direction = shootingEntity.getLookVec().normalize();
|
||||
double speed = 1.0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package net.machinemuse.powersuits.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
@ -24,7 +24,7 @@ public class EntityPlasmaBolt extends EntityThrowable {
|
|||
super(world);
|
||||
}
|
||||
|
||||
public EntityPlasmaBolt(World world, EntityLiving shootingEntity, double explosiveness, double damagingness, int chargeTicks) {
|
||||
public EntityPlasmaBolt(World world, EntityLivingBase shootingEntity, double explosiveness, double damagingness, int chargeTicks) {
|
||||
super(world);
|
||||
this.shootingEntity = shootingEntity;
|
||||
this.size = ((chargeTicks) > 50 ? 50 : chargeTicks);
|
||||
|
|
|
@ -6,7 +6,8 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
|
@ -32,7 +33,7 @@ public class EntitySpinningBlade extends EntityThrowable {
|
|||
super(world);
|
||||
}
|
||||
|
||||
public EntitySpinningBlade(World par1World, EntityLiving shootingEntity) {
|
||||
public EntitySpinningBlade(World par1World, EntityLivingBase shootingEntity) {
|
||||
super(par1World, shootingEntity);
|
||||
this.shootingEntity = shootingEntity;
|
||||
if (shootingEntity instanceof EntityPlayer) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package net.machinemuse.powersuits.item
|
|||
import net.machinemuse.powersuits.common.Config
|
||||
import net.machinemuse.powersuits.powermodule.misc.{InvisibilityModule, TransparentArmorModule, TintModule}
|
||||
import net.machinemuse.utils._
|
||||
import net.minecraft.entity.{Entity, EntityLiving}
|
||||
import net.minecraft.entity.{EntityLivingBase, Entity}
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.EnumArmorMaterial
|
||||
import net.minecraft.item.ItemStack
|
||||
|
@ -34,7 +34,7 @@ abstract class ItemPowerArmor(id: Int, renderIndex: Int, armorType: Int)
|
|||
* Inherited from ISpecialArmor, allows significant customization of damage
|
||||
* calculations.
|
||||
*/
|
||||
def getProperties(player: EntityLiving, armor: ItemStack, source: DamageSource, damage: Double, slot: Int): ISpecialArmor.ArmorProperties = {
|
||||
override def getProperties(player: EntityLivingBase, armor: ItemStack, source: DamageSource, damage: Double, slot: Int): ISpecialArmor.ArmorProperties = {
|
||||
val priority: Int = 1
|
||||
if (source.isFireDamage && !(source == MuseHeatUtils.overheatDamage)) {
|
||||
return new ISpecialArmor.ArmorProperties(priority, 0.25, (25 * damage).toInt)
|
||||
|
@ -62,15 +62,17 @@ abstract class ItemPowerArmor(id: Int, renderIndex: Int, armorType: Int)
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
override def getArmorModel(entityLiving: EntityLiving, itemstack: ItemStack, armorSlot: Int): ModelBiped = {
|
||||
override def getArmorModel(entity: EntityLivingBase, itemstack: ItemStack, armorSlot: Int): ModelBiped = {
|
||||
val model: ArmorModel = ArmorModel.instance
|
||||
|
||||
model.visibleSection = armorSlot
|
||||
|
||||
if (itemstack != null) {
|
||||
if (entityLiving.isInstanceOf[EntityPlayer]) {
|
||||
Option(entityLiving.asInstanceOf[EntityPlayer].getCurrentArmor(2)).map(chest =>
|
||||
if (MuseItemUtils.itemHasActiveModule(chest, InvisibilityModule.MODULE_ACTIVE_CAMOUFLAGE)) return null)
|
||||
entity match {
|
||||
case player: EntityPlayer =>
|
||||
Option(player.getCurrentArmor(2)).map(chest =>
|
||||
if (MuseItemUtils.itemHasActiveModule(chest, InvisibilityModule.MODULE_ACTIVE_CAMOUFLAGE)) return null)
|
||||
case _ =>
|
||||
}
|
||||
if (MuseItemUtils.itemHasActiveModule(itemstack, TransparentArmorModule.MODULE_TRANSPARENT_ARMOR)) {
|
||||
return null
|
||||
|
@ -123,7 +125,7 @@ abstract class ItemPowerArmor(id: Int, renderIndex: Int, armorType: Int)
|
|||
* Inherited from ISpecialArmor, allows us to customize how the armor
|
||||
* handles being damaged.
|
||||
*/
|
||||
def damageArmor(entity: EntityLiving, stack: ItemStack, source: DamageSource, damage: Int, slot: Int) {
|
||||
override def damageArmor(entity: EntityLivingBase, stack: ItemStack, source: DamageSource, damage: Int, slot: Int) {
|
||||
val itemProperties: NBTTagCompound = MuseItemUtils.getMuseItemTag(stack)
|
||||
if (entity.isInstanceOf[EntityPlayer]) {
|
||||
if (source == MuseHeatUtils.overheatDamage) {
|
||||
|
@ -145,4 +147,5 @@ abstract class ItemPowerArmor(id: Int, renderIndex: Int, armorType: Int)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package net.machinemuse.powersuits.item
|
||||
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry
|
||||
import cpw.mods.fml.relauncher.Side
|
||||
import cpw.mods.fml.relauncher.SideOnly
|
||||
import forestry.api.arboriculture.IToolGrafter
|
||||
|
@ -15,8 +14,7 @@ import net.machinemuse.utils.MuseHeatUtils
|
|||
import net.machinemuse.utils.MuseItemUtils
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.client.renderer.texture.IconRegister
|
||||
import net.minecraft.entity.Entity
|
||||
import net.minecraft.entity.EntityLiving
|
||||
import net.minecraft.entity.{EntityLivingBase, Entity}
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.EnumAction
|
||||
import net.minecraft.item.EnumToolMaterial
|
||||
|
@ -61,7 +59,7 @@ with OmniWrench {
|
|||
* Current implementations of this method in child classes do not use the
|
||||
* entry argument beside stack. They just raise the damage on the stack.
|
||||
*/
|
||||
override def hitEntity(stack: ItemStack, entityBeingHit: EntityLiving, entityDoingHitting: EntityLiving): Boolean = {
|
||||
override def hitEntity(stack: ItemStack, entityBeingHit: EntityLivingBase, entityDoingHitting: EntityLivingBase): Boolean = {
|
||||
if (MuseItemUtils.itemHasActiveModule(stack, OmniWrenchModule.MODULE_OMNI_WRENCH)) {
|
||||
entityBeingHit.rotationYaw += 90.0F;
|
||||
entityBeingHit.rotationYaw %= 360.0F;
|
||||
|
@ -88,18 +86,20 @@ with OmniWrench {
|
|||
* <p/>
|
||||
* Returns: Whether to increment player use stats with this item
|
||||
*/
|
||||
override def onBlockDestroyed(stack: ItemStack, world: World, blockID: Int, x: Int, y: Int, z: Int, entity: EntityLiving): Boolean = {
|
||||
if (entity.isInstanceOf[EntityPlayer]) {
|
||||
import scala.collection.JavaConversions._
|
||||
for (module <- ModuleManager.getBlockBreakingModules) {
|
||||
if (MuseItemUtils.itemHasActiveModule(stack, module.getDataName)) {
|
||||
if (module.onBlockDestroyed(stack, world, blockID, x, y, z, entity.asInstanceOf[EntityPlayer])) {
|
||||
return true
|
||||
override def onBlockDestroyed(stack: ItemStack, world: World, blockID: Int, x: Int, y: Int, z: Int, entity: EntityLivingBase): Boolean = {
|
||||
entity match {
|
||||
case player: EntityPlayer =>
|
||||
import scala.collection.JavaConversions._
|
||||
for (module <- ModuleManager.getBlockBreakingModules) {
|
||||
if (MuseItemUtils.itemHasActiveModule(stack, module.getDataName)) {
|
||||
if (module.onBlockDestroyed(stack, world, blockID, x, y, z, player)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case _ =>
|
||||
}
|
||||
return true
|
||||
true
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,8 +112,8 @@ with OmniWrench {
|
|||
* @param itemStack The itemstack
|
||||
* @return the damage
|
||||
*/
|
||||
override def getDamageVsEntity(par1Entity: Entity, itemStack: ItemStack): Int = {
|
||||
return ModuleManager.computeModularProperty(itemStack, MeleeAssistModule.PUNCH_DAMAGE).asInstanceOf[Int]
|
||||
override def getDamageVsEntity(par1Entity: Entity, itemStack: ItemStack): Float = {
|
||||
ModuleManager.computeModularProperty(itemStack, MeleeAssistModule.PUNCH_DAMAGE).toFloat
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT) override def isFull3D: Boolean = {
|
||||
|
@ -124,30 +124,24 @@ with OmniWrench {
|
|||
* Return the enchantability factor of the item. In this case, 0. Might add
|
||||
* an enchantability module later :P
|
||||
*/
|
||||
override def getItemEnchantability: Int = {
|
||||
return 0
|
||||
}
|
||||
override def getItemEnchantability = 0
|
||||
|
||||
/**
|
||||
* Return the name for this tool's material.
|
||||
*/
|
||||
override def getToolMaterialName: String = {
|
||||
return this.toolMaterial.toString
|
||||
}
|
||||
override def getToolMaterialName = this.toolMaterial.toString
|
||||
|
||||
|
||||
/**
|
||||
* Return whether this item is repairable in an anvil.
|
||||
*/
|
||||
override def getIsRepairable(par1ItemStack: ItemStack, par2ItemStack: ItemStack): Boolean = {
|
||||
return false
|
||||
}
|
||||
override def getIsRepairable(par1ItemStack: ItemStack, par2ItemStack: ItemStack) = false
|
||||
|
||||
/**
|
||||
* How long it takes to use or consume an item
|
||||
*/
|
||||
override def getMaxItemUseDuration(par1ItemStack: ItemStack): Int = {
|
||||
return 72000
|
||||
}
|
||||
override def getMaxItemUseDuration(par1ItemStack: ItemStack): Int = 72000
|
||||
|
||||
|
||||
/**
|
||||
* Called when the right click button is pressed
|
||||
|
|
|
@ -46,7 +46,6 @@ class MusePacketHandler extends IPacketHandler {
|
|||
packet => FMLCommonHandler.instance.getEffectiveSide match {
|
||||
case Side.SERVER => packet handleServer player.asInstanceOf[EntityPlayerMP]
|
||||
case Side.CLIENT => packet handleClient player.asInstanceOf[EntityClientPlayerMP]
|
||||
case Side.BUKKIT => MuseLogger.logError("Wat O.o")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.ArrayList
|
|||
import java.util.List
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.machinemuse.general.MuseLogger
|
||||
import net.minecraft.util.ChatMessageComponent
|
||||
|
||||
/**
|
||||
* Packet for requesting to purchase an upgrade. Player-to-server. Server decides whether it is a valid upgrade or not and replies with an associated
|
||||
|
@ -52,7 +53,7 @@ class MusePacketInstallModuleRequest(player: Player, itemSlot: Int, moduleName:
|
|||
val inventory: InventoryPlayer = playerEntity.inventory
|
||||
val moduleType: IPowerModule = ModuleManager.getModule(moduleName)
|
||||
if (moduleType == null || !moduleType.isAllowed) {
|
||||
playerEntity.sendChatToPlayer("Server has disallowed this module. Sorry!")
|
||||
playerEntity.sendChatToPlayer(ChatMessageComponent.func_111066_d("Server has disallowed this module. Sorry!"))
|
||||
return
|
||||
}
|
||||
val cost: List[ItemStack] = moduleType.getInstallCost
|
||||
|
|
|
@ -59,7 +59,7 @@ public class JumpAssistModule extends PowerModuleBase implements IToggleableModu
|
|||
player.motionY += 0.15 * Math.min(multiplier, 1) * MusePlayerUtils.getWeightPenaltyRatio(MuseItemUtils.getPlayerWeight(player), 25000);
|
||||
MovementManager.setPlayerJumpTicks(player, multiplier - 1);
|
||||
}
|
||||
player.jumpMovementFactor = player.landMovementFactor * .7f;
|
||||
player.jumpMovementFactor = player.getAIMoveSpeed() * .7f;
|
||||
} else {
|
||||
MovementManager.setPlayerJumpTicks(player, 0);
|
||||
}
|
||||
|
|
|
@ -63,18 +63,18 @@ public class SprintAssistModule extends PowerModuleBase implements IToggleableMo
|
|||
double sprintMultiplier = ModuleManager.computeModularProperty(item, SPRINT_SPEED_MULTIPLIER);
|
||||
double exhaustionComp = ModuleManager.computeModularProperty(item, SPRINT_FOOD_COMPENSATION);
|
||||
ElectricItemUtils.drainPlayerEnergy(player, sprintCost * horzMovement * 5);
|
||||
player.landMovementFactor *= sprintMultiplier;
|
||||
player.setAIMoveSpeed((float) (player.getAIMoveSpeed() * sprintMultiplier));
|
||||
|
||||
player.getFoodStats().addExhaustion((float) (-0.01 * exhaustion * exhaustionComp));
|
||||
player.jumpMovementFactor = player.landMovementFactor * .5f;
|
||||
player.jumpMovementFactor = player.getAIMoveSpeed() * .5f;
|
||||
}
|
||||
} else {
|
||||
double cost = ModuleManager.computeModularProperty(item, WALKING_ENERGY_CONSUMPTION);
|
||||
if (cost < totalEnergy) {
|
||||
double walkMultiplier = ModuleManager.computeModularProperty(item, WALKING_SPEED_MULTIPLIER);
|
||||
ElectricItemUtils.drainPlayerEnergy(player, cost * horzMovement * 5);
|
||||
player.landMovementFactor *= walkMultiplier;
|
||||
player.jumpMovementFactor = player.landMovementFactor * .5f;
|
||||
player.setAIMoveSpeed((float) (player.getAIMoveSpeed() * walkMultiplier));
|
||||
player.jumpMovementFactor = player.getAIMoveSpeed() * .5f;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public class LuxCapacitor extends PowerModuleBase implements IRightClickModule {
|
|||
|
||||
public LuxCapacitor(List<IModularItem> validItems) {
|
||||
super(validItems);
|
||||
addInstallCost(new ItemStack(Item.lightStoneDust, 1));
|
||||
addInstallCost(new ItemStack(Item.glowstone, 1));
|
||||
addInstallCost(new ItemStack(Item.ingotIron, 2));
|
||||
addBaseProperty(ENERGY, 100, "J");
|
||||
}
|
||||
|
|
|
@ -14,12 +14,13 @@ import net.minecraft.client.gui.ScaledResolution;
|
|||
import net.minecraft.client.model.PositionTextureVertex;
|
||||
import net.minecraft.client.model.TexturedQuad;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderEngine;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
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 net.minecraft.util.Icon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
@ -65,12 +66,16 @@ public abstract class MuseRenderer {
|
|||
public static void pushTexture(String filename) {
|
||||
texturestack.push(TEXTURE_MAP);
|
||||
TEXTURE_MAP = filename;
|
||||
getRenderEngine().bindTexture(TEXTURE_MAP);
|
||||
bindTexture(TEXTURE_MAP);
|
||||
}
|
||||
|
||||
public static void popTexture() {
|
||||
TEXTURE_MAP = texturestack.pop();
|
||||
getRenderEngine().bindTexture(TEXTURE_MAP);
|
||||
bindTexture(TEXTURE_MAP);
|
||||
}
|
||||
|
||||
public static void bindTexture(String tex) {
|
||||
getRenderEngine().func_110577_a(new ResourceLocation(tex));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -522,7 +527,7 @@ public abstract class MuseRenderer {
|
|||
/**
|
||||
* Singleton pattern for RenderEngine
|
||||
*/
|
||||
public static RenderEngine getRenderEngine() {
|
||||
public static TextureManager getRenderEngine() {
|
||||
return Minecraft.getMinecraft().renderEngine;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue