a couple fixes
This commit is contained in:
parent
bd3a04505d
commit
402234e210
|
@ -1,5 +1,5 @@
|
|||
forge_version=10.13.4.1614-1.7.10
|
||||
mod_version=0.11.0
|
||||
mod_version=0.11.1
|
||||
minecraft_version=1.7.10
|
||||
group_id=net.machinemuse
|
||||
mod_id=ModularPowersuits
|
||||
|
|
|
@ -15,9 +15,9 @@ import net.minecraft.item.ItemStack;
|
|||
@Optional.Interface(iface = "forestry.api.apiculture.IArmorApiarist", modid = "Forestry", striprefs = true)
|
||||
public interface IApiaristArmor extends IArmorApiarist {
|
||||
@Optional.Method(modid = "Forestry")
|
||||
public boolean protectPlayer(final EntityPlayer player, final ItemStack armor, final String cause, final boolean doProtect);
|
||||
boolean protectPlayer(final EntityPlayer player, final ItemStack armor, final String cause, final boolean doProtect);
|
||||
|
||||
|
||||
@Optional.Method(modid = "Forestry")
|
||||
public boolean protectEntity(final EntityLivingBase player, final ItemStack armor, final String cause, final boolean doProtect);
|
||||
boolean protectEntity(final EntityLivingBase player, final ItemStack armor, final String cause, final boolean doProtect);
|
||||
}
|
|
@ -59,10 +59,12 @@ public class NBTTagAccessor extends NBTTagCompound {
|
|||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
MuseLogger.logError("Unable to access nbt tag map!");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static List<NBTTagCompound> getValues(NBTTagCompound nbt) {
|
||||
Set<String> keyset = (Set<String>) nbt.func_150296_c();
|
||||
ArrayList<NBTTagCompound> a = new ArrayList<>(keyset.size());
|
||||
|
|
|
@ -18,7 +18,6 @@ public class CosmeticGui extends MuseGui {
|
|||
final int worldx;
|
||||
final int worldy;
|
||||
final int worldz;
|
||||
|
||||
ItemSelectionFrame itemSelect;
|
||||
ItemStack lastSelectedItem;
|
||||
|
||||
|
@ -27,7 +26,6 @@ public class CosmeticGui extends MuseGui {
|
|||
this.worldx = worldx;
|
||||
this.worldy = worldy;
|
||||
this.worldz = worldz;
|
||||
|
||||
this.xSize = 256;
|
||||
this.ySize = 200;
|
||||
}
|
||||
|
@ -86,4 +84,4 @@ public class CosmeticGui extends MuseGui {
|
|||
public void drawScreen(int x, int y, float z) {
|
||||
super.drawScreen(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,4 +29,4 @@ public class EnergyMeter extends HeatMeter {
|
|||
RenderState.off2D();
|
||||
MuseTextureUtils.popTexture();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,7 +18,6 @@ import net.minecraft.util.StatCollector;
|
|||
*/
|
||||
public class GuiFieldTinker extends MuseGui {
|
||||
protected final EntityClientPlayerMP player;
|
||||
|
||||
protected ItemSelectionFrame itemSelectFrame;
|
||||
|
||||
/**
|
||||
|
@ -65,4 +64,4 @@ public class GuiFieldTinker extends MuseGui {
|
|||
MuseRenderer.drawCenteredString(StatCollector.translateToLocal("gui.noModulesFound.line2"), centerx, centery + 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,9 +15,7 @@ import net.minecraft.util.StatCollector;
|
|||
*/
|
||||
public class GuiTinkerTable extends MuseGui {
|
||||
protected final EntityClientPlayerMP player;
|
||||
|
||||
protected ItemSelectionFrame itemSelectFrame;
|
||||
|
||||
protected int worldx;
|
||||
protected int worldy;
|
||||
protected int worldz;
|
||||
|
@ -40,7 +38,6 @@ public class GuiTinkerTable extends MuseGui {
|
|||
this.worldx = x;
|
||||
this.worldy = y;
|
||||
this.worldz = z;
|
||||
|
||||
}
|
||||
/**
|
||||
* Add the buttons (and other controls) to the screen.
|
||||
|
@ -82,4 +79,4 @@ public class GuiTinkerTable extends MuseGui {
|
|||
MuseRenderer.drawCenteredString(StatCollector.translateToLocal("gui.noModulesFound.line2"), centerx, centery + 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -292,4 +292,4 @@ public class MuseGui extends GuiScreen {
|
|||
*/
|
||||
public void refresh() {
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,7 +13,6 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class PortableCraftingGui extends GuiContainer {
|
||||
|
||||
public PortableCraftingGui(EntityPlayer player, World world, int x, int y, int z) {
|
||||
super(new PortableCraftingContainer(player.inventory, world, x, y, z));
|
||||
}
|
||||
|
|
|
@ -39,4 +39,4 @@ public abstract class Clickable implements IClickable {
|
|||
public List<String> getToolTip() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -96,5 +96,4 @@ public class ClickableButton extends Clickable {
|
|||
}
|
||||
|
||||
public String getLabel() { return label; }
|
||||
|
||||
}
|
||||
}
|
|
@ -57,4 +57,4 @@ public class ClickableItem extends Clickable {
|
|||
MuseRenderer.drawString("e", getPosition().x() + 3, getPosition().y() + 1, Colour.DARKGREEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -52,5 +52,4 @@ public class ClickableLabel implements IClickable {
|
|||
public MusePoint2D getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -100,4 +100,4 @@ public class ClickableModule extends Clickable {
|
|||
public void setInstalled(boolean installed) {
|
||||
this.installed = installed;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,4 +15,4 @@ public interface IClickable {
|
|||
boolean hitBox(double x, double y);
|
||||
|
||||
List getToolTip();
|
||||
}
|
||||
}
|
|
@ -24,14 +24,12 @@ import org.apache.commons.lang3.ArrayUtils;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
* Created: 4:19 AM, 03/05/13
|
||||
*
|
||||
* Ported to Java by lehjr on 11/2/16.
|
||||
*/
|
||||
|
||||
public class ColourPickerFrame implements IGuiFrame {
|
||||
public ItemSelectionFrame itemSelector;
|
||||
public DrawableMuseRect border;
|
||||
|
@ -189,9 +187,9 @@ public class ColourPickerFrame implements IGuiFrame {
|
|||
/* TODO - for 1.10.2 and above, simplyfy with Java 8 collections and streams. Seriously, all this to remove an element fron an int array*/
|
||||
List<Integer> integerArray = new ArrayList<>();
|
||||
int intToRemove = intArray[selectedColour];
|
||||
for (int i = 0; i < intArray.length; i++) {
|
||||
if (intArray[i] != intToRemove)
|
||||
integerArray.add(intArray[i]);
|
||||
for (int anIntArray : intArray) {
|
||||
if (anIntArray != intToRemove)
|
||||
integerArray.add(anIntArray);
|
||||
}
|
||||
int[] newIntArray = new int[integerArray.size()];
|
||||
int j = 0;
|
||||
|
|
|
@ -53,6 +53,8 @@ public class DetailedSummaryFrame extends ScrollableFrame {
|
|||
int nexty = (int) border.top() + margin;
|
||||
MuseRenderer.drawCenteredString(StatCollector.translateToLocal("gui.equippedTotals"), (border.left() + border.right())/2, nexty);
|
||||
nexty += 10;
|
||||
|
||||
|
||||
String formattedValue = MuseStringUtils.formatNumberFromUnits(energy, PowerModule.getUnit(ElectricItemUtils.MAXIMUM_ENERGY));
|
||||
String name = StatCollector.translateToLocal("gui.energyStorage");
|
||||
double valueWidth = MuseRenderer.getStringWidth(formattedValue);
|
||||
|
@ -86,6 +88,7 @@ public class DetailedSummaryFrame extends ScrollableFrame {
|
|||
MuseRenderer.drawString(namesList.get(i), border.left() + margin, nexty + 9*i);
|
||||
}
|
||||
MuseRenderer.drawRightAlignedString(formattedValue, border.right() - margin, nexty + 9 * (namesList.size() - 1) / 2);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
@ -93,11 +96,13 @@ public class DetailedSummaryFrame extends ScrollableFrame {
|
|||
@Override
|
||||
public void onMouseDown(double x, double y, int button) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseUp(double x, double y, int button) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -105,4 +110,4 @@ public class DetailedSummaryFrame extends ScrollableFrame {
|
|||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,4 +13,4 @@ public interface IGuiFrame {
|
|||
void draw();
|
||||
|
||||
List<String> getToolTip(int x, int y);
|
||||
}
|
||||
}
|
|
@ -31,14 +31,10 @@ public class InstallSalvageFrame extends ScrollableFrame {
|
|||
protected final ClickableButton salvageButton;
|
||||
protected final EntityClientPlayerMP player;
|
||||
|
||||
public InstallSalvageFrame(EntityClientPlayerMP player,
|
||||
MusePoint2D topleft,
|
||||
public InstallSalvageFrame(EntityClientPlayerMP player, MusePoint2D topleft,
|
||||
MusePoint2D bottomright,
|
||||
Colour borderColour,
|
||||
Colour insideColour,
|
||||
ItemSelectionFrame targetItem,
|
||||
ModuleSelectionFrame targetModule) {
|
||||
|
||||
Colour borderColour, Colour insideColour,
|
||||
ItemSelectionFrame targetItem, ModuleSelectionFrame targetModule) {
|
||||
super(topleft, bottomright, borderColour, insideColour);
|
||||
this.player = player;
|
||||
this.targetItem = targetItem;
|
||||
|
@ -46,11 +42,14 @@ public class InstallSalvageFrame extends ScrollableFrame {
|
|||
double sizex = border.right() - border.left();
|
||||
double sizey = border.bottom() - border.top();
|
||||
|
||||
this.installButton = new ClickableButton(StatCollector.translateToLocal("gui.install"),
|
||||
new MusePoint2D(border.right() - sizex / 2.0, border.bottom() - sizey / 4.0),
|
||||
this.installButton = new ClickableButton(StatCollector.translateToLocal("gui.install"), new MusePoint2D(
|
||||
border.right() - sizex / 2.0, border.bottom() - sizey
|
||||
/ 4.0),
|
||||
true);
|
||||
this.salvageButton = new ClickableButton(StatCollector.translateToLocal("gui.salvage"),
|
||||
new MusePoint2D(border.left() + sizex / 2.0, border.top() + sizey / 4.0), true);
|
||||
this.salvageButton = new ClickableButton(StatCollector.translateToLocal("gui.salvage"), new MusePoint2D(
|
||||
border.left() + sizex / 2.0, border.top() + sizey / 4.0),
|
||||
true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,8 +121,9 @@ public class InstallSalvageFrame extends ScrollableFrame {
|
|||
ItemStack stack = targetItem.getSelectedItem().getItem();
|
||||
IPowerModule module = targetModule.getSelectedModule().getModule();
|
||||
if (!ModuleManager.itemHasModule(stack, module.getDataName())) {
|
||||
installButton.setEnabled(player.capabilities.isCreativeMode ||
|
||||
MuseItemUtils.hasInInventory(module.getInstallCost(), player.inventory));
|
||||
|
||||
installButton.setEnabled(player.capabilities.isCreativeMode || MuseItemUtils.hasInInventory(
|
||||
module.getInstallCost(), player.inventory));
|
||||
installButton.draw();
|
||||
} else {
|
||||
salvageButton.draw();
|
||||
|
@ -137,15 +137,25 @@ public class InstallSalvageFrame extends ScrollableFrame {
|
|||
if (selItem != null && selModule != null) {
|
||||
ItemStack stack = selItem.getItem();
|
||||
IPowerModule module = selModule.getModule();
|
||||
if (!ModuleManager.itemHasModule(stack, module.getDataName()))
|
||||
if (installButton.hitBox(x, y)) doInstall();
|
||||
else if (salvageButton.hitBox(x, y)) doSalvage();
|
||||
|
||||
if (!ModuleManager.itemHasModule(stack, module.getDataName())) {
|
||||
if (installButton.hitBox(x, y)) {
|
||||
doInstall();
|
||||
}
|
||||
} else {
|
||||
if (salvageButton.hitBox(x, y)) {
|
||||
doSalvage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doSalvage() {
|
||||
IPowerModule module = targetModule.getSelectedModule().getModule();
|
||||
MusePacket newpacket = new MusePacketSalvageModuleRequest(player, targetItem.getSelectedItem().inventorySlot, module.getDataName());
|
||||
MusePacket newpacket = new MusePacketSalvageModuleRequest(
|
||||
player,
|
||||
targetItem.getSelectedItem().inventorySlot,
|
||||
module.getDataName());
|
||||
PacketSender.sendToServer(newpacket.getPacket131());
|
||||
}
|
||||
|
||||
|
@ -159,8 +169,11 @@ public class InstallSalvageFrame extends ScrollableFrame {
|
|||
if (player.capabilities.isCreativeMode || MuseItemUtils.hasInInventory(module.getInstallCost(), player.inventory)) {
|
||||
Musique.playClientSound(SoundDictionary.SOUND_GUI_INSTALL, 1);
|
||||
// Now send request to server to make it legit
|
||||
MusePacket newpacket = new MusePacketInstallModuleRequest(player, targetItem.getSelectedItem().inventorySlot, module.getDataName());
|
||||
MusePacket newpacket = new MusePacketInstallModuleRequest(
|
||||
player,
|
||||
targetItem.getSelectedItem().inventorySlot,
|
||||
module.getDataName());
|
||||
PacketSender.sendToServer(newpacket.getPacket131());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -64,11 +64,13 @@ public class ItemInfoFrame extends ScrollableFrame {
|
|||
@Override
|
||||
public void onMouseDown(double x, double y, int button) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseUp(double x, double y, int button) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -76,4 +78,4 @@ public class ItemInfoFrame extends ScrollableFrame {
|
|||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,8 +23,7 @@ import java.util.List;
|
|||
*
|
||||
* Ported to Java by lehjr on 11/2/16.
|
||||
*/
|
||||
public class ItemModelViewFrame implements IGuiFrame
|
||||
{
|
||||
public class ItemModelViewFrame implements IGuiFrame {
|
||||
private final ItemSelectionFrame itemSelector;
|
||||
private final DrawableMuseRect border;
|
||||
private double anchorx;
|
||||
|
|
|
@ -21,12 +21,8 @@ public class ItemSelectionFrame extends ScrollableFrame {
|
|||
protected final EntityPlayer player;
|
||||
protected List<MusePoint2D> itemPoints;
|
||||
|
||||
public ItemSelectionFrame(MusePoint2D topleft,
|
||||
MusePoint2D bottomright,
|
||||
Colour borderColour,
|
||||
Colour insideColour,
|
||||
EntityPlayer player) {
|
||||
|
||||
public ItemSelectionFrame(MusePoint2D topleft, MusePoint2D bottomright,
|
||||
Colour borderColour, Colour insideColour, EntityPlayer player) {
|
||||
super(topleft, bottomright, borderColour, insideColour);
|
||||
this.player = player;
|
||||
List<Integer> slots = MuseItemUtils
|
||||
|
@ -44,7 +40,9 @@ public class ItemSelectionFrame extends ScrollableFrame {
|
|||
new MusePoint2D(centerx, border.top()));
|
||||
for (MusePoint2D point : targetPoints) {
|
||||
// Fly from middle over 200 ms
|
||||
itemPoints.add(new FlyFromPointToPoint2D(new MusePoint2D(centerx, centery), point, 200));
|
||||
itemPoints.add(new FlyFromPointToPoint2D(
|
||||
new MusePoint2D(centerx, centery),
|
||||
point, 200));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +60,9 @@ public class ItemSelectionFrame extends ScrollableFrame {
|
|||
Iterator<MusePoint2D> pointiterator = itemPoints.iterator();
|
||||
|
||||
for (int slot : slots) {
|
||||
ClickableItem clickie = new ClickableItem(player.inventory.getStackInSlot(slot), pointiterator.next(), slot);
|
||||
ClickableItem clickie = new ClickableItem(
|
||||
player.inventory.getStackInSlot(slot),
|
||||
pointiterator.next(), slot);
|
||||
itemButtons.add(clickie);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,6 +87,7 @@ public class ModuleTweakFrame extends ScrollableFrame {
|
|||
}
|
||||
MuseRenderer.drawRightAlignedString(formattedValue, border.right() - margin, nexty + 9 * (namesList.size()-1)/2);
|
||||
nexty += 9*namesList.size()+1;
|
||||
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
@ -147,8 +148,7 @@ public class ModuleTweakFrame extends ScrollableFrame {
|
|||
if (selectedSlider != null && itemTarget.getSelectedItem() != null && moduleTarget.getSelectedModule() != null) {
|
||||
ClickableItem item = itemTarget.getSelectedItem();
|
||||
IPowerModule module = moduleTarget.getSelectedModule().getModule();
|
||||
MusePacket tweakRequest = new MusePacketTweakRequest(player, item.inventorySlot, module.getDataName(), selectedSlider.name(),
|
||||
selectedSlider.value());
|
||||
MusePacket tweakRequest = new MusePacketTweakRequest(player, item.inventorySlot, module.getDataName(), selectedSlider.name(), selectedSlider.value());
|
||||
PacketSender.sendToServer(tweakRequest.getPacket131());
|
||||
}
|
||||
if (button == 0) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import javax.annotation.Nullable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Author: MachineMuse (Claire Semple)
|
||||
|
@ -102,7 +103,7 @@ public class PartManipContainer extends ScrollableFrame {
|
|||
@Override
|
||||
public void update(double mousex, double mousey) {
|
||||
super.update(mousex, mousey);
|
||||
if (lastItemSlot != getItemSlot()) {
|
||||
if (!Objects.equals(lastItemSlot, getItemSlot())) {
|
||||
lastItemSlot = getItemSlot();
|
||||
colourSelect.refreshColours();
|
||||
|
||||
|
@ -130,7 +131,6 @@ public class PartManipContainer extends ScrollableFrame {
|
|||
GL11.glTranslated(0.0, (double)(-this.currentscrollpixels), 0.0);
|
||||
for (PartManipSubFrame f : modelframes) {
|
||||
f.drawPartial(currentscrollpixels + 4 + border.top(), this.currentscrollpixels + border.bottom() - 4);
|
||||
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
super.postDraw();
|
||||
|
|
|
@ -35,8 +35,7 @@ import java.util.List;
|
|||
* Ported to Java by lehjr on 11/2/16.
|
||||
*/
|
||||
|
||||
public class PartManipSubFrame
|
||||
{
|
||||
public class PartManipSubFrame {
|
||||
public ModelSpec model;
|
||||
public ColourPickerFrame colourframe;
|
||||
public ItemSelectionFrame itemSelector;
|
||||
|
|
|
@ -58,4 +58,4 @@ public class StatsFrame extends ScrollableFrame {
|
|||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -50,12 +50,10 @@ public class TabSelectFrame implements IGuiFrame {
|
|||
|
||||
@Override
|
||||
public void onMouseUp(double x, double y, int button) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(double mousex, double mousey) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,4 +27,5 @@ public class SoundDictionary {
|
|||
public static final String SOUND_JETPACK = SOUND_PREFIX + "Jetpack";
|
||||
public static final String SOUND_SWIMASSIST = SOUND_PREFIX + "SwimAssist";
|
||||
public static final String SOUND_ELECTROLYZER = SOUND_PREFIX + "WaterElectrolyzer";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,11 +23,11 @@ public class SMovingArmorModel extends ModelPlayer implements IArmorModel {
|
|||
public static NBTTagCompound renderSpec = null;
|
||||
public static int visibleSection = 0;
|
||||
private SmartRenderModelPlayerBase renderPlayerBase = SmartRender.getPlayerBase(this);
|
||||
private SmartRenderModel model = renderPlayerBase.getRenderModel();
|
||||
|
||||
private SMovingArmorModel() {
|
||||
super(0);
|
||||
|
||||
SmartRenderModel model = renderPlayerBase.getRenderModel();
|
||||
this.bipedBody = model.bipedBody;
|
||||
this.bipedRightArm = model.bipedRightArm;
|
||||
this.bipedLeftArm = model.bipedLeftArm;
|
||||
|
|
|
@ -18,7 +18,6 @@ import javax.xml.parsers.DocumentBuilder;
|
|||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.awt.*;
|
||||
import java.net.URL;
|
||||
import java.util.Iterator;
|
||||
|
||||
import static net.machinemuse.powersuits.client.render.modelspec.MorphTarget.*;
|
||||
|
||||
|
@ -122,9 +121,8 @@ public class ModelSpecXMLReader {
|
|||
|
||||
@Nullable
|
||||
public String validatePolygroup(String s, ModelSpec m) {
|
||||
Iterator<GroupObject> it = m.model.groupObjects.iterator();
|
||||
while (it.hasNext()) {
|
||||
if (it.next().name.equals(s)) return s;
|
||||
for (GroupObject groupObject : m.model.groupObjects) {
|
||||
if (groupObject.name.equals(s)) return s;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -27,10 +27,7 @@ import org.lwjgl.input.Keyboard;
|
|||
import java.io.*;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.CopyOption;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
@ -376,8 +373,8 @@ public class Config {
|
|||
String moduleName = cost.moduleName;
|
||||
Item item = GameRegistry.findItem(cost.modId, cost.itemName);
|
||||
if(item != null) {
|
||||
int metadata = (cost.itemMetadata == null) ? 0 : cost.itemMetadata.intValue();
|
||||
int quantity = (cost.itemQuantity == null) ? 1 : cost.itemQuantity.intValue();
|
||||
int metadata = (cost.itemMetadata == null) ? 0 : cost.itemMetadata;
|
||||
int quantity = (cost.itemQuantity == null) ? 1 : cost.itemQuantity;
|
||||
ItemStack stack = new ItemStack(item, quantity, metadata);
|
||||
if(stack != null) {
|
||||
ModuleManager.addCustomInstallCost(moduleName, stack);
|
||||
|
|
|
@ -17,7 +17,6 @@ import net.machinemuse.powersuits.control.KeybindManager;
|
|||
import net.machinemuse.powersuits.control.PlayerInputMap;
|
||||
import net.machinemuse.powersuits.item.ItemPowerArmorChestplate;
|
||||
import net.machinemuse.powersuits.item.ItemPowerArmorHelmet;
|
||||
import net.machinemuse.powersuits.item.ItemPowerFist;
|
||||
import net.machinemuse.powersuits.network.packets.MusePacketPlayerUpdate;
|
||||
import net.machinemuse.powersuits.powermodule.armor.WaterTankModule;
|
||||
import net.machinemuse.powersuits.powermodule.misc.AutoFeederModule;
|
||||
|
@ -33,6 +32,7 @@ import net.minecraft.init.Items;
|
|||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Ported to Java by lehjr on 10/24/16.
|
||||
|
@ -78,8 +78,8 @@ public class ClientTickHandler {
|
|||
public void findInstalledModules(EntityPlayer player) {
|
||||
if (player != null) {
|
||||
ItemStack tool = player.getCurrentEquippedItem();
|
||||
if (tool != null && tool.getItem() instanceof ItemPowerFist) {
|
||||
}
|
||||
// if (tool != null && tool.getItem() instanceof ItemPowerFist) {
|
||||
// }
|
||||
ItemStack helmet = player.getCurrentArmor(3);
|
||||
if (helmet != null && helmet.getItem() instanceof ItemPowerArmorHelmet) {
|
||||
if (ModuleManager.itemHasActiveModule(helmet, AutoFeederModule.MODULE_AUTO_FEEDER)) {
|
||||
|
@ -130,7 +130,7 @@ public class ClientTickHandler {
|
|||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution screen = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
for (int i = 0; i < modules.size(); i++) {
|
||||
if (modules.get(i) == AutoFeederModule.MODULE_AUTO_FEEDER) {
|
||||
if (Objects.equals(modules.get(i), AutoFeederModule.MODULE_AUTO_FEEDER)) {
|
||||
int foodLevel = (int) MuseItemUtils.getFoodLevel(player.getCurrentArmor(3));
|
||||
String num = MuseStringUtils.formatNumberShort(foodLevel);
|
||||
if (i == 0) {
|
||||
|
@ -140,7 +140,7 @@ public class ClientTickHandler {
|
|||
MuseRenderer.drawString(num, 17, yBaseString + (yOffsetString * i));
|
||||
MuseRenderer.drawItemAt(-1.0, yBaseIcon + (yOffsetIcon * i), food);
|
||||
}
|
||||
} else if (modules.get(i) == ClockModule.MODULE_CLOCK) {
|
||||
} else if (Objects.equals(modules.get(i), ClockModule.MODULE_CLOCK)) {
|
||||
long time = player.worldObj.provider.getWorldTime();
|
||||
long hour = ((time % 24000) / 1000);
|
||||
if (Config.use24hClock()) {
|
||||
|
@ -175,13 +175,13 @@ public class ClientTickHandler {
|
|||
MuseRenderer.drawString(hour + ampm, 17, yBaseString + (yOffsetString * i));
|
||||
MuseRenderer.drawItemAt(-1.0, yBaseIcon + (yOffsetIcon * i), clock);
|
||||
}
|
||||
} else if (modules.get(i) == CompassModule.MODULE_COMPASS) {
|
||||
} else if (Objects.equals(modules.get(i), CompassModule.MODULE_COMPASS)) {
|
||||
if (i == 0) {
|
||||
MuseRenderer.drawItemAt(-1.0, yBaseIcon, compass);
|
||||
} else {
|
||||
MuseRenderer.drawItemAt(-1.0, yBaseIcon + (yOffsetIcon * i), compass);
|
||||
}
|
||||
} else if (modules.get(i) == WaterTankModule.MODULE_WATER_TANK) {
|
||||
} else if (Objects.equals(modules.get(i), WaterTankModule.MODULE_WATER_TANK)) {
|
||||
drawWaterMeter = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,8 +96,10 @@ public abstract class ItemPowerArmor extends ItemElectricArmor implements ISpeci
|
|||
if (entity instanceof EntityPlayer) {
|
||||
ItemStack armorChest = ((EntityPlayer)entity).getCurrentArmor(2);
|
||||
|
||||
if (!armorChest.equals(null) && armorChest.getItem() instanceof ItemPowerArmor)
|
||||
if (ModuleManager.itemHasActiveModule(armorChest, InvisibilityModule.MODULE_ACTIVE_CAMOUFLAGE)) ((IArmorModel)model).setVisibleSection(99);
|
||||
if (armorChest != null) {
|
||||
if (armorChest.getItem() instanceof ItemPowerArmor)
|
||||
if (ModuleManager.itemHasActiveModule(armorChest, InvisibilityModule.MODULE_ACTIVE_CAMOUFLAGE)) ((IArmorModel)model).setVisibleSection(99);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import net.minecraft.item.ItemStack;
|
|||
@Optional.InterfaceList({ @Optional.Interface(iface = "ic2.api.item.IMetalArmor", modid = "IC2", striprefs = true) })
|
||||
public class ItemPowerArmorBoots extends ItemPowerArmor implements IMetalArmor
|
||||
{
|
||||
private final String iconpath = MuseRenderer.ICON_PREFIX + "armorfeet";
|
||||
public ItemPowerArmorBoots() {
|
||||
super(0, 3);
|
||||
this.setUnlocalizedName("powerArmorBoots");
|
||||
|
@ -23,7 +22,8 @@ public class ItemPowerArmorBoots extends ItemPowerArmor implements IMetalArmor
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(this.iconpath);
|
||||
String iconpath = MuseRenderer.ICON_PREFIX + "armorfeet";
|
||||
this.itemIcon = iconRegister.registerIcon(iconpath);
|
||||
}
|
||||
|
||||
public boolean isMetalArmor(final ItemStack itemStack, final EntityPlayer entityPlayer) {
|
||||
|
|
|
@ -9,7 +9,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||
* Ported to Java by lehjr on 10/26/16.
|
||||
*/
|
||||
public class ItemPowerArmorChestplate extends ItemPowerArmor {
|
||||
private final String iconpath = MuseRenderer.ICON_PREFIX + "armortorso";
|
||||
|
||||
public ItemPowerArmorChestplate() {
|
||||
super(0, 1);
|
||||
|
@ -17,7 +16,8 @@ public class ItemPowerArmorChestplate extends ItemPowerArmor {
|
|||
}
|
||||
|
||||
public String iconpath() {
|
||||
return this.iconpath;
|
||||
String iconpath = MuseRenderer.ICON_PREFIX + "armortorso";
|
||||
return iconpath;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
|
@ -9,7 +9,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
|||
* Ported to Java by lehjr on 10/26/16.
|
||||
*/
|
||||
public class ItemPowerArmorLeggings extends ItemPowerArmor {
|
||||
private final String iconpath = MuseRenderer.ICON_PREFIX + "armorlegs";
|
||||
|
||||
public ItemPowerArmorLeggings() {
|
||||
super(0, 2);
|
||||
|
@ -18,6 +17,7 @@ public class ItemPowerArmorLeggings extends ItemPowerArmor {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(this.iconpath);
|
||||
String iconpath = MuseRenderer.ICON_PREFIX + "armorlegs";
|
||||
this.itemIcon = iconRegister.registerIcon(iconpath);
|
||||
}
|
||||
}
|
|
@ -76,7 +76,6 @@ implements
|
|||
IModularItem,
|
||||
IModeChangingModularItem
|
||||
{
|
||||
private final String iconpath = MuseIcon.ICON_PREFIX + "handitem";
|
||||
public ItemPowerFist() {
|
||||
super(0.0f, Item.ToolMaterial.EMERALD);
|
||||
// IModeChangingItem$class.$init$(this);
|
||||
|
@ -104,7 +103,8 @@ implements
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(this.iconpath);
|
||||
String iconpath = MuseIcon.ICON_PREFIX + "handitem";
|
||||
this.itemIcon = iconRegister.registerIcon(iconpath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package net.machinemuse.powersuits.network.packets;
|
||||
|
||||
import net.machinemuse.api.electricity.IModularItem;
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.machinemuse.utils.MuseItemUtils;
|
||||
|
@ -30,7 +29,7 @@ public class MusePacketColourInfo extends MusePacket {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package net.machinemuse.powersuits.network.packets;
|
|||
|
||||
import net.machinemuse.api.electricity.IModularItem;
|
||||
import net.machinemuse.numina.general.MuseLogger;
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.machinemuse.utils.MuseItemUtils;
|
||||
|
@ -32,7 +31,7 @@ public class MusePacketCosmeticInfo extends MusePacket {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package net.machinemuse.powersuits.network.packets;
|
|||
|
||||
import net.machinemuse.api.IPowerModule;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.machinemuse.numina.network.PacketSender;
|
||||
|
@ -39,7 +38,7 @@ public class MusePacketInstallModuleRequest extends MusePacket {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package net.machinemuse.powersuits.network.packets;
|
||||
|
||||
import net.machinemuse.general.gui.MuseGui;
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -29,9 +28,8 @@ public class MusePacketInventoryRefresh extends MusePacket {
|
|||
this.stack = stack;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package net.machinemuse.powersuits.network.packets;
|
|||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.machinemuse.powersuits.entity.EntityPlasmaBolt;
|
||||
|
@ -31,7 +30,7 @@ public class MusePacketPlasmaBolt extends MusePacket {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.machinemuse.powersuits.network.packets;
|
||||
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.machinemuse.numina.network.PacketSender;
|
||||
|
@ -26,7 +25,7 @@ public class MusePacketPlayerUpdate extends MusePacket {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import net.machinemuse.api.IPowerModule;
|
||||
import net.machinemuse.api.IPropertyModifier;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
|
||||
|
@ -35,7 +34,7 @@ public class MusePacketPropertyModifierConfig extends MusePacket {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package net.machinemuse.powersuits.network.packets;
|
|||
|
||||
import net.machinemuse.api.IPowerModule;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.machinemuse.numina.network.PacketSender;
|
||||
|
@ -40,7 +39,7 @@ public class MusePacketSalvageModuleRequest extends MusePacket {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.machinemuse.powersuits.network.packets;
|
||||
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.machinemuse.utils.MuseItemUtils;
|
||||
|
@ -26,7 +25,7 @@ public class MusePacketToggleRequest extends MusePacket{
|
|||
}
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
package net.machinemuse.powersuits.network.packets;
|
||||
|
||||
import net.machinemuse.numina.network.IMusePackager;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.numina.general.MuseMathUtils;
|
||||
import net.machinemuse.numina.network.MusePackager;
|
||||
import net.machinemuse.numina.network.MusePacket;
|
||||
import net.machinemuse.utils.MuseItemUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
|
||||
|
@ -18,30 +23,43 @@ import java.io.DataInputStream;
|
|||
* Ported to Java by lehjr on 11/14/16.
|
||||
*/
|
||||
public class MusePacketTweakRequest extends MusePacket {
|
||||
EntityPlayer player;
|
||||
int itemSlot;
|
||||
String moduleName;
|
||||
String tweakName;
|
||||
final EntityPlayer player;
|
||||
final int itemSlot;
|
||||
final String moduleName;
|
||||
final String tweakName;
|
||||
double tweakValue;
|
||||
|
||||
public MusePacketTweakRequest(EntityPlayer player, int itemSlot, String moduleName, String tweakName, double tweakValue) {
|
||||
public MusePacketTweakRequest(EntityPlayer player, int itemSlot, String moduleName, String tweakName, double tweakValue) {
|
||||
this.player = player;
|
||||
this.itemSlot = itemSlot;
|
||||
this.moduleName = moduleName;
|
||||
this.tweakName = tweakName;
|
||||
this.tweakValue = tweakValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMusePackager packager() {
|
||||
public MusePackager packager() {
|
||||
return getPackagerInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write() {
|
||||
writeInt(itemSlot);
|
||||
writeString(moduleName);
|
||||
writeString(tweakName);
|
||||
writeDouble(tweakValue);
|
||||
writeInt(this.itemSlot);
|
||||
writeString(this.moduleName);
|
||||
writeString(this.tweakName);
|
||||
writeDouble(this.tweakValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleServer(EntityPlayerMP player) {
|
||||
if (moduleName != null && tweakName != null) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(itemSlot);
|
||||
NBTTagCompound itemTag = MuseItemUtils.getMuseItemTag(stack);
|
||||
if (itemTag != null && ModuleManager.tagHasModule(itemTag, moduleName)) {
|
||||
NBTTagCompound moduleTag = itemTag.getCompoundTag(moduleName);
|
||||
moduleTag.setDouble(tweakName, MuseMathUtils.clampDouble(tweakValue, 0, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static MusePacketTweakRequestPackager PACKAGERINSTANCE;
|
||||
|
|
|
@ -73,7 +73,6 @@ public class GliderModule extends PowerModuleBase implements IToggleableModule,
|
|||
// sprinting speed
|
||||
player.jumpMovementFactor += 0.03f;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.nbt.NBTTagList;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Created by leon on 10/18/16.
|
||||
|
@ -72,7 +73,7 @@ public class SprintAssistModule extends PowerModuleBase implements IToggleableMo
|
|||
NBTTagList modifiers = item.getTagCompound().getTagList("AttributeModifiers", (byte)10);
|
||||
for (int i = 0; i< modifiers.tagCount(); i++) {
|
||||
NBTTagCompound tag = modifiers.getCompoundTagAt(i);
|
||||
if (new AttributeModifier(tag).name == "Sprint Assist") {
|
||||
if (Objects.equals(new AttributeModifier(tag).name, "Sprint Assist")) {
|
||||
tag.setDouble("Amount", 0);
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +86,7 @@ public class SprintAssistModule extends PowerModuleBase implements IToggleableMo
|
|||
List sprintModifiers = new ArrayList();
|
||||
for (int i = 0; i < modifiers.tagCount(); i++) {
|
||||
NBTTagCompound tag = modifiers.getCompoundTagAt(i);
|
||||
if (new AttributeModifier(tag).name == "Sprint Assist") {
|
||||
if (Objects.equals(new AttributeModifier(tag).name, "Sprint Assist")) {
|
||||
tag.setInteger("Operation", 1);
|
||||
tag.setDouble("Amount", multiplier - 1);
|
||||
sprintModifiers.add(tag);
|
||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class AxeModule extends PowerModuleBase implements IBlockBreakingModule, IToggleableModule {
|
||||
|
@ -81,7 +82,7 @@ public class AxeModule extends PowerModuleBase implements IBlockBreakingModule,
|
|||
}
|
||||
}
|
||||
}
|
||||
return effectiveTool == "axe";
|
||||
return Objects.equals(effectiveTool, "axe");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Created by User: Andrew2448
|
||||
|
@ -82,21 +83,21 @@ public class LeafBlowerModule extends PowerModuleBase implements IRightClickModu
|
|||
return false;
|
||||
|
||||
// Plants
|
||||
if (blocktype == "plants" && (block instanceof BlockTallGrass || block instanceof BlockFlower) && block.canHarvestBlock(player, meta)) {
|
||||
if (Objects.equals(blocktype, "plants") && (block instanceof BlockTallGrass || block instanceof BlockFlower) && block.canHarvestBlock(player, meta)) {
|
||||
block.harvestBlock(world, player, x, y, z, meta);
|
||||
world.setBlockToAir(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Leaves
|
||||
if (blocktype == "leaves" && block instanceof BlockLeaves && block.canHarvestBlock(player, meta)) {
|
||||
if (Objects.equals(blocktype, "leaves") && block instanceof BlockLeaves && block.canHarvestBlock(player, meta)) {
|
||||
block.harvestBlock(world, player, x, y, z, meta);
|
||||
world.setBlockToAir(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Snow
|
||||
if (blocktype == "snow" && block instanceof BlockSnow && block.canHarvestBlock(player, meta)) {
|
||||
if (Objects.equals(blocktype, "snow") && block instanceof BlockSnow && block.canHarvestBlock(player, meta)) {
|
||||
block.harvestBlock(world, player, x, y, z, meta);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class PickaxeModule extends PowerModuleBase implements IBlockBreakingModule, IToggleableModule {
|
||||
|
@ -83,7 +84,7 @@ public class PickaxeModule extends PowerModuleBase implements IBlockBreakingModu
|
|||
private static boolean istEffectiveHarvestTool(Block block, int metadata) {
|
||||
ItemStack emulatedTool = new ItemStack(Items.iron_pickaxe);
|
||||
String effectiveHarvestTool = block.getHarvestTool(metadata);
|
||||
if (effectiveHarvestTool == "pickaxe") {
|
||||
if (Objects.equals(effectiveHarvestTool, "pickaxe")) {
|
||||
return block.getHarvestLevel(metadata) <= 2; // higher than 2 requires better then iron
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ShovelModule extends PowerModuleBase implements IBlockBreakingModule, IToggleableModule {
|
||||
public static final String MODULE_SHOVEL = "Shovel";
|
||||
|
@ -72,7 +73,7 @@ public class ShovelModule extends PowerModuleBase implements IBlockBreakingModul
|
|||
return true;
|
||||
}
|
||||
}
|
||||
return effectiveTool == "shovel";
|
||||
return Objects.equals(effectiveTool, "shovel");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -291,7 +291,7 @@ public abstract class MuseRenderer {
|
|||
by = y1 + cy;
|
||||
bz = z1 + cz;
|
||||
|
||||
int index = (int) Math.random() * 50;
|
||||
int index = (int) Math.random() * 50; // FIXME: Math.random() cast to int is always rounded down to 0
|
||||
|
||||
drawLightningBetweenPointsFast(ax, ay, az, bx, by, bz, index);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue