mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-15 17:44:57 +00:00
Revert "Manually added EoDs PR."
This reverts commit 752bb63900e67f7242accdef0799ae7bd2a7c9aa due to some missing changes
This commit is contained in:
1 parent
376c485f3c
commit
ffcbf444cd
2 files changed
+20
-60
No files matched your search
@@ -1,9 +1,12 @@
|
||||
package info.jbcs.minecraft.chisel;
|
||||
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.*;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -25,7 +28,6 @@ import info.jbcs.minecraft.chisel.item.ItemBallOMoss;
|
||||
import info.jbcs.minecraft.chisel.item.ItemChisel;
|
||||
import info.jbcs.minecraft.chisel.item.ItemCloudInABottle;
|
||||
import info.jbcs.minecraft.chisel.item.ItemSmashingRock;
|
||||
import info.jbcs.minecraft.utilities.General;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -85,44 +87,6 @@ public class Chisel
|
||||
{
|
||||
m.warn();//(Action.WARN);
|
||||
}
|
||||
|
||||
// Fix mapping of snakestoneSand, snakestoneStone, limestoneStairs, marbleStairs when loading an old (1.5.4) save
|
||||
else if(m.type == Type.BLOCK)
|
||||
{
|
||||
Block block = null;
|
||||
|
||||
if(General.cleanTags(m.name).equals("sandSnakestone"))
|
||||
block = GameRegistry.findBlock(Chisel.MOD_ID, "tile.snakestoneSand");
|
||||
else if(General.cleanTags(m.name).equals("snakestone"))
|
||||
block = GameRegistry.findBlock(Chisel.MOD_ID, "tile.snakestoneStone");
|
||||
else
|
||||
block = GameRegistry.findBlock(Chisel.MOD_ID, General.cleanTags(m.name));
|
||||
|
||||
if(block != null)
|
||||
{
|
||||
m.remap(block);
|
||||
FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block));
|
||||
} else
|
||||
FMLLog.getLogger().warn("Block " + m.name + " could not get remapped.");
|
||||
} else if(m.type == Type.ITEM)
|
||||
{
|
||||
Item item = null;
|
||||
|
||||
if(General.cleanTags(m.name).equals("sandSnakestone"))
|
||||
item = GameRegistry.findItem(Chisel.MOD_ID, "tile.snakestoneSand");
|
||||
else if(General.cleanTags(m.name).equals("snakestone"))
|
||||
item = GameRegistry.findItem(Chisel.MOD_ID, "tile.snakestoneStone");
|
||||
else
|
||||
item = GameRegistry.findItem(Chisel.MOD_ID, General.cleanTags(m.name));
|
||||
|
||||
if(item != null)
|
||||
{
|
||||
m.remap(item);
|
||||
FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item));
|
||||
|
||||
} else
|
||||
FMLLog.getLogger().warn("Item " + m.name + " could not get remapped.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,13 +193,12 @@ public class Chisel
|
||||
Random random = new Random();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerClick(PlayerInteractEvent event)
|
||||
{
|
||||
public void onPlayerClick(PlayerInteractEvent event) {
|
||||
if(event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
|
||||
if(!Configurations.enableChiseling) return;
|
||||
if (!Configurations.enableChiseling) return;
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
ItemStack stack = player.getHeldItem();
|
||||
if(stack == null || stack.getItem() != chisel) return;
|
||||
if (stack == null || stack.getItem() != chisel) return;
|
||||
|
||||
World world = event.world;
|
||||
int x = event.x;
|
||||
@@ -266,14 +229,14 @@ public class Chisel
|
||||
long cooldown = 20;
|
||||
long time = world.getWorldInfo().getWorldTotalTime();
|
||||
|
||||
if(time > useTime - cooldown && time < useTime + cooldown) return; //noReplace = true;
|
||||
if(time>useTime-cooldown && time<useTime+cooldown) return; //noReplace = true;
|
||||
}
|
||||
|
||||
CarvingVariation[] variations = ItemChisel.carving.getVariations(block, blockMeta);
|
||||
if(variations == null || variations.length < 2) return; //noReplace = true;
|
||||
else
|
||||
{
|
||||
int index = blockMeta + 1;
|
||||
int index = blockMeta +1;
|
||||
while(variations[index].block.equals(block) && variations[index].damage == blockMeta)
|
||||
{
|
||||
index++;
|
||||
@@ -349,12 +312,11 @@ public class Chisel
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBlockBreak(BlockEvent.BreakEvent event)
|
||||
{
|
||||
if(!Configurations.enableChiseling) return;
|
||||
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
||||
if (!Configurations.enableChiseling) return;
|
||||
EntityPlayer player = event.getPlayer();
|
||||
ItemStack stack = player.getHeldItem();
|
||||
if(stack == null || stack.getItem() != chisel) return;
|
||||
if (stack == null || stack.getItem() != chisel) return;
|
||||
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package info.jbcs.minecraft.utilities;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -11,8 +14,6 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class General
|
||||
{
|
||||
public static Random rand = new Random();
|
||||
@@ -56,10 +57,12 @@ public class General
|
||||
return stack.getItem();
|
||||
}
|
||||
|
||||
public static String getName(Item item)
|
||||
public static String getUnlocalizedName(Block block)
|
||||
{
|
||||
String res = item.getUnlocalizedName();
|
||||
return cleanTags(res);
|
||||
String name = block.getUnlocalizedName();
|
||||
if(name.startsWith("tile.")) name = name.substring(5);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public static String getName(Block block)
|
||||
@@ -96,9 +99,4 @@ public class General
|
||||
return par1World.rayTraceBlocks(var13, var23, par3);
|
||||
}
|
||||
|
||||
public static String cleanTags(String tag)
|
||||
{
|
||||
return tag.replaceAll("[Cc]hisel\\p{Punct}", "").replaceFirst("^tile\\.", "").replaceFirst("^item\\.", "");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user