mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 06:52:58 +00:00
Added the Ring of Far Reach.
This commit is contained in:
1 parent
5655fd39f5
commit
a2fcf453dd
12 files changed
+123
-4
No files matched your search
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 22, 2014, 3:33:25 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.core.handler;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class BotaniaPlayerController extends PlayerControllerMP {
|
||||
|
||||
public float distance = 0F;
|
||||
|
||||
public BotaniaPlayerController(Minecraft p_i45062_1_, NetHandlerPlayClient p_i45062_2_) {
|
||||
super(p_i45062_1_, p_i45062_2_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockReachDistance() {
|
||||
return super.getBlockReachDistance() + distance;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,13 +12,18 @@
|
||||
package vazkii.botania.client.core.proxy;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSettings.GameType;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.handler.BotaniaPlayerController;
|
||||
import vazkii.botania.client.core.handler.BoundTileRenderer;
|
||||
import vazkii.botania.client.core.handler.CapeHandler;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.core.handler.LightningHandler;
|
||||
@@ -66,10 +71,12 @@ import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.entity.EntityPixie;
|
||||
import vazkii.botania.common.entity.EntityVineBall;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@@ -80,7 +87,6 @@ public class ClientProxy extends CommonProxy {
|
||||
FMLCommonHandler.instance().bus().register(new ClientTickHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new HUDHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new LightningHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new CapeHandler());
|
||||
if(ConfigHandler.boundBlockWireframe)
|
||||
MinecraftForge.EVENT_BUS.register(new BoundTileRenderer());
|
||||
if(ConfigHandler.versionCheckEnabled)
|
||||
@@ -131,6 +137,23 @@ public class ClientProxy extends CommonProxy {
|
||||
public void setEntryToOpen(LexiconEntry entry) {
|
||||
GuiLexicon.currentOpenLexicon = new GuiLexiconEntry(entry, new GuiLexiconIndex(entry.category));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraReach(EntityLivingBase entity, float reach) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
if(entity == player) {
|
||||
if(!(mc.playerController instanceof BotaniaPlayerController)) {
|
||||
GameType type = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.CURRENT_GAME_TYPE);
|
||||
NetHandlerPlayClient net = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.NET_CLIENT_HANDLER);
|
||||
BotaniaPlayerController controller = new BotaniaPlayerController(mc, net);
|
||||
controller.setGameType(type);
|
||||
mc.playerController = controller;
|
||||
}
|
||||
|
||||
((BotaniaPlayerController) mc.playerController).distance = reach;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getWorldElapsedTicks() {
|
||||
|
||||
@@ -91,7 +91,7 @@ public class BlockPlatform extends BlockCamo implements ILexiconable {
|
||||
@Override
|
||||
public float getBlockHardness(World par1World, int par2, int par3, int par4) {
|
||||
int meta = par1World.getBlockMetadata(par2, par3, par4);
|
||||
return meta == 2 ? -1 : super.getBlockHardness(par1World, par2, par3, par4);
|
||||
return meta == 2 ? -1F : super.getBlockHardness(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -175,6 +175,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.waterRing);
|
||||
addItem(ModItems.miningRing);
|
||||
addItem(ModItems.magnetRing);
|
||||
addItem(ModItems.reachRing);
|
||||
addItem(ModItems.pixieRing);
|
||||
addItem(ModItems.travelBelt);
|
||||
addItem(ModItems.superTravelBelt);
|
||||
|
||||
@@ -13,6 +13,8 @@ package vazkii.botania.common.core.proxy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -103,7 +105,12 @@ public class CommonProxy {
|
||||
public void setEntryToOpen(LexiconEntry entry) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public void setExtraReach(EntityLivingBase entity, float reach) {
|
||||
if(entity instanceof EntityPlayerMP)
|
||||
((EntityPlayerMP) entity).theItemInWorldManager.setBlockReachDistance(reach);
|
||||
}
|
||||
|
||||
public long getWorldElapsedTicks() {
|
||||
return MinecraftServer.getServer().worldServers[0].getTotalWorldTime();
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ import vazkii.botania.common.item.equipment.bauble.ItemMagnetRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemManaRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMiningRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemPixieRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemReachRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemSuperTravelBelt;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemTinyPlanet;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemTravelBelt;
|
||||
@@ -133,6 +134,7 @@ public final class ModItems {
|
||||
public static Item manaBottle;
|
||||
public static Item laputaShard;
|
||||
public static Item virus;
|
||||
public static Item reachRing;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -208,6 +210,7 @@ public final class ModItems {
|
||||
manaBottle = new ItemBottledMana();
|
||||
laputaShard = new ItemLaputaShard();
|
||||
virus = new ItemVirus();
|
||||
reachRing = new ItemReachRing();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 22, 2014, 3:00:09 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import baubles.api.BaubleType;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemReachRing extends ItemBauble {
|
||||
|
||||
public ItemReachRing() {
|
||||
super(LibItemNames.REACH_RING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
|
||||
Botania.proxy.setExtraReach(player, 3.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
|
||||
Botania.proxy.setExtraReach(player, 0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.RING;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -86,6 +86,7 @@ public final class LibItemNames {
|
||||
public static final String MANA_BOTTLE = "manaBottle";
|
||||
public static final String LAPUTA_SHARD = "laputaShard";
|
||||
public static final String VIRUS = "virus";
|
||||
public static final String REACH_RING = "reachRing";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
@@ -50,4 +50,10 @@ public final class LibObfuscation {
|
||||
|
||||
// EntityHorse
|
||||
public static final String[] HORSE_JUMP_STRENGTH = new String[] { "horseJumpStrength", "field_110271_bv", "bv" };
|
||||
|
||||
// PlayerControllerMP
|
||||
public static final String[] NET_CLIENT_HANDLER = new String[] { "netClientHandler", "field_78774_b", "b" };
|
||||
public static final String[] CURRENT_GAME_TYPE = new String[] { "currentGameType", "field_78779_k", "k" };
|
||||
|
||||
}
|
||||
|
||||
@@ -573,6 +573,7 @@ item.botania:redstoneRoot.name=Redstone Root
|
||||
item.botania:magnetRing.name=Ring of Magnetization
|
||||
item.botania:waterRing.name=Ring of Chordata
|
||||
item.botania:miningRing.name=Ring of the Mantle
|
||||
item.botania:miningRing.name=Ring of Far Reach
|
||||
item.botania:terraPick.name=Terra Shatterer
|
||||
item.botania:divaCharm.name=Charm of the Diva
|
||||
item.botania:flightTiara.name=Flügel Tiara
|
||||
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 435 B After Width: | Height: | Size: 435 B |
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB |
Reference in new issue
Block a user