Infinite staff (#83)

* fix readme

* added a creative staff of travelling

* spotless

* add back tooltip

* adress reviews
This commit is contained in:
boubou19 authored and GitHub committed 2022-09-20 16:53:04 +02:00
1 parent 52b0cabc0b
commit fd85b9aee9
7 files changed
+104 -3

No files matched your search

+2 -2
View File
@@ -8,11 +8,11 @@ Issues can be reported to the [GTNH tracker](https://github.com/GTNewHorizons/GT
All code (excluding the bundled APIs from other mods, which are covered by their respective licenses) were released without restriction into the public domain under the CC0 1.0 license (http://creativecommons.org/publicdomain/zero/1.0/legalcode) FAQ (https://wiki.creativecommons.org/CC0_FAQ). All code (excluding the bundled APIs from other mods, which are covered by their respective licenses) were released without restriction into the public domain under the CC0 1.0 license (http://creativecommons.org/publicdomain/zero/1.0/legalcode) FAQ (https://wiki.creativecommons.org/CC0_FAQ).
Do what you want with it, as long as you smile while doing so. Do what you want with it, as long as you smile while doing so.
###GTNH Modifications: ### GTNH Modifications:
LGPL v3.0 or later. Feel free to use our changes, just give back any changes you make to the community as well! LGPL v3.0 or later. Feel free to use our changes, just give back any changes you make to the community as well!
###Sound Credits ### Sound Credits
Most sound attributed under Creative Commons Attribution 3.0 Unported (CC BY 3.0) Most sound attributed under Creative Commons Attribution 3.0 Unported (CC BY 3.0)
@@ -150,6 +150,7 @@ import crazypants.enderio.material.endergy.ItemAlloyEndergy;
import crazypants.enderio.material.endergy.ItemGrindingBallEndergy; import crazypants.enderio.material.endergy.ItemGrindingBallEndergy;
import crazypants.enderio.network.PacketHandler; import crazypants.enderio.network.PacketHandler;
import crazypants.enderio.rail.BlockEnderRail; import crazypants.enderio.rail.BlockEnderRail;
import crazypants.enderio.teleport.ItemInfiniteTravelStaff;
import crazypants.enderio.teleport.ItemTravelStaff; import crazypants.enderio.teleport.ItemTravelStaff;
import crazypants.enderio.teleport.TeleportRecipes; import crazypants.enderio.teleport.TeleportRecipes;
import crazypants.enderio.teleport.TravelController; import crazypants.enderio.teleport.TravelController;
@@ -228,6 +229,7 @@ public class EnderIO {
public static BlockTelePad blockTelePad; public static BlockTelePad blockTelePad;
public static ItemCoordSelector itemCoordSelector; public static ItemCoordSelector itemCoordSelector;
public static ItemTravelStaff itemTravelStaff; public static ItemTravelStaff itemTravelStaff;
public static ItemInfiniteTravelStaff itemInfiniteTravelStaff;
// Painter // Painter
public static BlockPainter blockPainter; public static BlockPainter blockPainter;
@@ -479,6 +481,7 @@ public class EnderIO {
itemYetaWench = ItemYetaWrench.create(); itemYetaWench = ItemYetaWrench.create();
itemEnderface = ItemEnderface.create(); itemEnderface = ItemEnderface.create();
itemTravelStaff = ItemTravelStaff.create(); itemTravelStaff = ItemTravelStaff.create();
itemInfiniteTravelStaff = ItemInfiniteTravelStaff.create();
itemConduitProbe = ItemConduitProbe.create(); itemConduitProbe = ItemConduitProbe.create();
itemXpTransfer = ItemXpTransfer.create(); itemXpTransfer = ItemXpTransfer.create();
@@ -120,7 +120,9 @@ public enum ModObject {
blockEnderRail, blockEnderRail,
itemEnderFood; itemEnderFood,
itemInfiniteTravelStaff;
public final String unlocalisedName; public final String unlocalisedName;
@@ -52,6 +52,7 @@ public class NEIEnderIOConfig implements IConfigureNEI {
} }
if (!Config.travelAnchorEnabled) { if (!Config.travelAnchorEnabled) {
API.hideItem(new ItemStack(EnderIO.itemTravelStaff)); API.hideItem(new ItemStack(EnderIO.itemTravelStaff));
API.hideItem(new ItemStack(EnderIO.itemInfiniteTravelStaff));
} }
if (!Config.reinforcedObsidianEnabled) { if (!Config.reinforcedObsidianEnabled) {
API.hideItem(new ItemStack(EnderIO.blockReinforcedObsidian)); API.hideItem(new ItemStack(EnderIO.blockReinforcedObsidian));
@@ -0,0 +1,89 @@
package crazypants.enderio.teleport;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.EnderIO;
import crazypants.enderio.ModObject;
import crazypants.enderio.machine.power.PowerDisplayUtil;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemInfiniteTravelStaff extends ItemTravelStaff {
protected ItemInfiniteTravelStaff() {
super();
setUnlocalizedName(ModObject.itemInfiniteTravelStaff.name());
}
public static ItemInfiniteTravelStaff create() {
ItemInfiniteTravelStaff result = new ItemInfiniteTravelStaff();
result.init();
return result;
}
public static boolean isEquipped(EntityPlayer ep) {
if (ep == null || ep.getCurrentEquippedItem() == null) {
return false;
}
return ep.getCurrentEquippedItem().getItem() == EnderIO.itemInfiniteTravelStaff;
}
@Override
protected void init() {
GameRegistry.registerItem(this, ModObject.itemInfiniteTravelStaff.unlocalisedName);
}
@Override
public void onCreated(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
setFull(itemStack);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister IIconRegister) {
itemIcon = IIconRegister.registerIcon("enderio:itemInfiniteTravelStaff");
}
@Override
public void extractInternal(ItemStack item, int powerUse) {
return;
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
ItemStack is = new ItemStack(this);
setFull(is);
par3List.add(is);
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
super.addInformation(itemStack, par2EntityPlayer, list, par4);
String str = "Infinite " + PowerDisplayUtil.abrevation();
list.set(list.size() - 1, str); // Changing charge indicator to infinite RF
}
@Override
public String getUnlocalizedNameForTooltip(ItemStack stack) {
return getUnlocalizedName();
}
@Override
public boolean isActive(EntityPlayer ep, ItemStack equipped) {
return isEquipped(ep);
}
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D() {
return true;
}
}
@@ -726,6 +726,12 @@ item.itemTravelStaff.tooltip.detailed.line4=Shift-R-Click will teleport the
item.itemTravelStaff.tooltip.detailed.line5=player a short distance item.itemTravelStaff.tooltip.detailed.line5=player a short distance
enderio.itemTravelStaff.notEnoughPower=Not enough power enderio.itemTravelStaff.notEnoughPower=Not enough power
item.itemInfiniteTravelStaff.name=Creative Staff of Traveling
item.itemInfiniteTravelStaff.tooltip.detailed.line1=When held Travel Anchors and EnderIO
item.itemInfiniteTravelStaff.tooltip.detailed.line2=blocks become visible and can be
item.itemInfiniteTravelStaff.tooltip.detailed.line3=activated by R-Click
item.itemInfiniteTravelStaff.tooltip.detailed.line4=Shift-R-Click will teleport the
item.itemInfiniteTravelStaff.tooltip.detailed.line5=player a short distance
item.itemCoordSelector.name=Coordinate Selector item.itemCoordSelector.name=Coordinate Selector
item.itemCoordSelector.tooltip.detailed.line1=Stores coordinates of a block. item.itemCoordSelector.tooltip.detailed.line1=Stores coordinates of a block.
item.itemCoordSelector.tooltip.detailed.line2=Right click at block to select item.itemCoordSelector.tooltip.detailed.line2=Right click at block to select
Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B