mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-23 00:49:50 +00:00
Merge branch 'dev' of https://github.com/KAMKEEL/CustomNPC-Plus
This commit is contained in:
commit
17c6fe9728
544 files changed
+5004
-3903
No files matched your search
+1
-1
Submodule src/api updated: 3f8d6e5581...80c4e90fef.
@@ -3,6 +3,7 @@ package foxz.command;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
import jdk.nashorn.internal.runtime.regexp.joni.Config;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockIce;
|
||||
import net.minecraft.block.BlockLeavesBase;
|
||||
@@ -10,6 +11,7 @@ import net.minecraft.block.BlockVine;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.Server;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.controllers.ChunkController;
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
@@ -37,19 +39,22 @@ public class CmdConfig extends ChMcLogger {
|
||||
)
|
||||
public boolean leavesdecay(String[] args){
|
||||
if(args.length == 0){
|
||||
sendmessage("LeavesDecay: " + CustomNpcs.LeavesDecayEnabled);
|
||||
sendmessage("LeavesDecay: " + ConfigMain.LeavesDecayEnabled);
|
||||
}
|
||||
else{
|
||||
CustomNpcs.LeavesDecayEnabled = Boolean.parseBoolean(args[0]);
|
||||
CustomNpcs.Config.updateConfig();
|
||||
ConfigMain.LeavesDecayEnabled = Boolean.parseBoolean(args[0]);
|
||||
ConfigMain.LeavesDecayEnabledProperty.set(ConfigMain.LeavesDecayEnabled);
|
||||
if(ConfigMain.config.hasChanged()){
|
||||
ConfigMain.config.save();
|
||||
}
|
||||
Set<String> names = Block.blockRegistry.getKeys();
|
||||
for(String name : names){
|
||||
Block block = (Block) Block.blockRegistry.getObject(name);
|
||||
if(block instanceof BlockLeavesBase){
|
||||
block.setTickRandomly(CustomNpcs.LeavesDecayEnabled);
|
||||
block.setTickRandomly(ConfigMain.LeavesDecayEnabled);
|
||||
}
|
||||
}
|
||||
sendmessage("LeavesDecay is now " + CustomNpcs.LeavesDecayEnabled);
|
||||
sendmessage("LeavesDecay is now " + ConfigMain.LeavesDecayEnabled);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -62,19 +67,22 @@ public class CmdConfig extends ChMcLogger {
|
||||
)
|
||||
public boolean vinegrowth(String[] args){
|
||||
if(args.length == 0){
|
||||
sendmessage("VineGrowth: " + CustomNpcs.VineGrowthEnabled);
|
||||
sendmessage("VineGrowth: " + ConfigMain.VineGrowthEnabled);
|
||||
}
|
||||
else{
|
||||
CustomNpcs.VineGrowthEnabled = Boolean.parseBoolean(args[0]);
|
||||
CustomNpcs.Config.updateConfig();
|
||||
ConfigMain.VineGrowthEnabled = Boolean.parseBoolean(args[0]);
|
||||
ConfigMain.VineGrowthEnabledProperty.set(ConfigMain.VineGrowthEnabled);
|
||||
if(ConfigMain.config.hasChanged()){
|
||||
ConfigMain.config.save();
|
||||
}
|
||||
Set<String> names = Block.blockRegistry.getKeys();
|
||||
for(String name : names){
|
||||
Block block = (Block) Block.blockRegistry.getObject(name);
|
||||
if(block instanceof BlockVine){
|
||||
block.setTickRandomly(CustomNpcs.VineGrowthEnabled);
|
||||
block.setTickRandomly(ConfigMain.VineGrowthEnabled);
|
||||
}
|
||||
}
|
||||
sendmessage("VineGrowth is now " + CustomNpcs.VineGrowthEnabled);
|
||||
sendmessage("VineGrowth is now " + ConfigMain.VineGrowthEnabled);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -87,19 +95,22 @@ public class CmdConfig extends ChMcLogger {
|
||||
)
|
||||
public boolean icemelts(String[] args){
|
||||
if(args.length == 0){
|
||||
sendmessage("IceMelts: " + CustomNpcs.IceMeltsEnabled);
|
||||
sendmessage("IceMelts: " + ConfigMain.IceMeltsEnabled);
|
||||
}
|
||||
else{
|
||||
CustomNpcs.IceMeltsEnabled = Boolean.parseBoolean(args[0]);
|
||||
CustomNpcs.Config.updateConfig();
|
||||
ConfigMain.IceMeltsEnabled = Boolean.parseBoolean(args[0]);
|
||||
ConfigMain.IceMeltsEnabledProperty.set(ConfigMain.IceMeltsEnabled);
|
||||
if(ConfigMain.config.hasChanged()){
|
||||
ConfigMain.config.save();
|
||||
}
|
||||
Set<String> names = Block.blockRegistry.getKeys();
|
||||
for(String name : names){
|
||||
Block block = (Block) Block.blockRegistry.getObject(name);
|
||||
if(block instanceof BlockIce){
|
||||
block.setTickRandomly(CustomNpcs.IceMeltsEnabled);
|
||||
block.setTickRandomly(ConfigMain.IceMeltsEnabled);
|
||||
}
|
||||
}
|
||||
sendmessage("IceMelts is now " + CustomNpcs.IceMeltsEnabled);
|
||||
sendmessage("IceMelts is now " + ConfigMain.IceMeltsEnabled);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -112,12 +123,15 @@ public class CmdConfig extends ChMcLogger {
|
||||
)
|
||||
public boolean guns(String[] args){
|
||||
if(args.length == 0){
|
||||
sendmessage("GunsEnabled: " + CustomNpcs.GunsEnabled);
|
||||
sendmessage("GunsEnabled: " + ConfigMain.GunsEnabled);
|
||||
}
|
||||
else{
|
||||
CustomNpcs.GunsEnabled = Boolean.parseBoolean(args[0]);
|
||||
CustomNpcs.Config.updateConfig();
|
||||
sendmessage("GunsEnabled is now " + CustomNpcs.GunsEnabled);
|
||||
ConfigMain.GunsEnabled = Boolean.parseBoolean(args[0]);
|
||||
ConfigMain.GunsEnabledProperty.set(ConfigMain.GunsEnabled);
|
||||
if(ConfigMain.config.hasChanged()){
|
||||
ConfigMain.config.save();
|
||||
}
|
||||
sendmessage("GunsEnabled is now " + ConfigMain.GunsEnabled);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -147,24 +161,27 @@ public class CmdConfig extends ChMcLogger {
|
||||
)
|
||||
public boolean chunkloaders(String[] args){
|
||||
if(args.length == 0){
|
||||
sendmessage("ChunkLoaders: " + ChunkController.instance.size() + "/" + CustomNpcs.ChunkLoaders);
|
||||
sendmessage("ChunkLoaders: " + ChunkController.instance.size() + "/" + ConfigMain.ChunkLoaders);
|
||||
}
|
||||
else{
|
||||
try{
|
||||
CustomNpcs.ChunkLoaders = Integer.parseInt(args[0]);
|
||||
ConfigMain.ChunkLoaders = Integer.parseInt(args[0]);
|
||||
}
|
||||
catch(NumberFormatException ex){
|
||||
sendmessage("Didnt get a number");
|
||||
return false;
|
||||
}
|
||||
CustomNpcs.Config.updateConfig();
|
||||
|
||||
int size = ChunkController.instance.size();
|
||||
if(size > CustomNpcs.ChunkLoaders){
|
||||
ChunkController.instance.unload(size - CustomNpcs.ChunkLoaders);
|
||||
sendmessage(size - CustomNpcs.ChunkLoaders + " chunksloaders unloaded");
|
||||
|
||||
ConfigMain.ChunkLoadersProperty.set(ConfigMain.ChunkLoaders);
|
||||
if(ConfigMain.config.hasChanged()){
|
||||
ConfigMain.config.save();
|
||||
}
|
||||
sendmessage("ChunkLoaders: " + ChunkController.instance.size() + "/" + CustomNpcs.ChunkLoaders);
|
||||
int size = ChunkController.instance.size();
|
||||
if(size > ConfigMain.ChunkLoaders){
|
||||
ChunkController.instance.unload(size - ConfigMain.ChunkLoaders);
|
||||
sendmessage(size - ConfigMain.ChunkLoaders + " chunksloaders unloaded");
|
||||
}
|
||||
sendmessage("ChunkLoaders: " + ChunkController.instance.size() + "/" + ConfigMain.ChunkLoaders);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package foxz.command;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import noppes.npcs.api.ICommand;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ScriptedCommand extends CommandBase implements ICommand {
|
||||
private String commandName;
|
||||
private int permissionLevel;
|
||||
private String commandUsage;
|
||||
private ArrayList<String> aliases;
|
||||
|
||||
public ScriptedCommand(String commandName, int permissionLevel) {
|
||||
this.commandName = commandName;
|
||||
this.permissionLevel = permissionLevel;
|
||||
this.commandUsage = "";
|
||||
this.aliases = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setCommandName(String commandName) {
|
||||
this.commandName = commandName;
|
||||
}
|
||||
|
||||
public void setCommandUsage(String commandUsage) {
|
||||
this.commandUsage = commandUsage;
|
||||
}
|
||||
|
||||
public void setPermissionLevel(int permissionLevel) {
|
||||
this.permissionLevel = permissionLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return this.commandName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender p_71518_1_) {
|
||||
return this.commandUsage;
|
||||
}
|
||||
|
||||
public String getCommandUsage() {
|
||||
return this.commandUsage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
|
||||
}
|
||||
|
||||
public int getRequiredPermissionLevel()
|
||||
{
|
||||
return this.permissionLevel;
|
||||
}
|
||||
|
||||
public int getPermissionLevel() { return this.getRequiredPermissionLevel(); }
|
||||
|
||||
public List<?> getCommandAliases() {
|
||||
return this.aliases;
|
||||
}
|
||||
|
||||
public String[] getAliases() {
|
||||
return this.aliases.toArray(new String[0]);
|
||||
}
|
||||
|
||||
public void addAliases(String... aliases) {
|
||||
this.aliases.addAll(Arrays.asList(aliases));
|
||||
}
|
||||
|
||||
public boolean hasAlias(String alias) {
|
||||
return this.aliases.contains(alias);
|
||||
}
|
||||
|
||||
public void removeAlias(String alias) {
|
||||
this.aliases.remove(alias);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package noppes.npcs;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.handler.data.IAnimationData;
|
||||
import noppes.npcs.api.handler.data.IAnimation;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.FramePart;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class AnimationData implements IAnimationData {
|
||||
//Server-side: DataDisplay, PlayerData
|
||||
//Client-side: DataDisplay, EntityPlayer
|
||||
public Object parent;
|
||||
|
||||
public Animation animation;
|
||||
public boolean allowAnimation = false;
|
||||
|
||||
//client-sided use only
|
||||
public HashMap<EnumAnimationPart, FramePart> originalPivots = new HashMap<>();
|
||||
|
||||
public AnimationData(Object parent){
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void updateClient() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound = this.writeToNBT(compound);
|
||||
compound.setTag("Animation",this.animation.writeToNBT());
|
||||
if (parent instanceof PlayerData) {
|
||||
Server.sendToAll(EnumPacketClient.UPDATE_ANIMATIONS, compound, ((PlayerData) parent).player.getCommandSenderName());
|
||||
} else if (parent instanceof DataDisplay) {
|
||||
compound.setInteger("EntityId",((DataDisplay) parent).npc.getEntityId());
|
||||
Server.sendAssociatedData(((DataDisplay) parent).npc, EnumPacketClient.UPDATE_ANIMATIONS, compound);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
if (!this.allowAnimation || this.animation == null || this.animation.currentFrame == this.animation.frames.size())
|
||||
return false;
|
||||
|
||||
if (this.parent instanceof DataDisplay) {
|
||||
EntityNPCInterface npc = ((DataDisplay)this.parent).npc;
|
||||
if (!npc.isEntityAlive())
|
||||
return false;
|
||||
|
||||
return animation.whileAttacking && npc.isAttacking() || animation.whileMoving && npc.isWalking() || animation.whileStanding && !npc.isWalking();
|
||||
} else {
|
||||
EntityPlayer player;
|
||||
if (this.parent instanceof PlayerData) {
|
||||
player = ((PlayerData) this.parent).player;
|
||||
} else {
|
||||
player = (EntityPlayer) this.parent;
|
||||
}
|
||||
if (!player.isEntityAlive())
|
||||
return false;
|
||||
|
||||
boolean moving = Math.sqrt(player.motionX*player.motionX + player.motionY*player.motionY + player.motionZ*player.motionZ) != 0.0D;
|
||||
|
||||
return animation.whileAttacking && player.getLastAttackerTime() - player.ticksExisted < 20 || animation.whileMoving && moving || animation.whileStanding && !moving;
|
||||
}
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
|
||||
compound.setBoolean("PuppetEnabled", allowAnimation);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
this.allowAnimation = compound.getBoolean("PuppetEnabled");
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.allowAnimation = enabled;
|
||||
}
|
||||
|
||||
public boolean enabled() {
|
||||
return this.allowAnimation;
|
||||
}
|
||||
|
||||
public void setAnimation(IAnimation animation) {
|
||||
this.animation = (Animation) animation;
|
||||
}
|
||||
|
||||
public IAnimation getAnimation() {
|
||||
return animation;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -9,13 +10,12 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.blocks.tiles.TileNpcContainer;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.containers.*;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import noppes.npcs.api.IWorld;
|
||||
|
||||
public class CommonProxy implements IGuiHandler {
|
||||
|
||||
|
||||
@@ -1,79 +1,23 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
import net.minecraft.dispenser.IBlockSource;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemFlintAndSteel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import noppes.npcs.blocks.BlockBanner;
|
||||
import noppes.npcs.blocks.BlockBarrel;
|
||||
import noppes.npcs.blocks.BlockBeam;
|
||||
import noppes.npcs.blocks.BlockBigSign;
|
||||
import noppes.npcs.blocks.BlockBlood;
|
||||
import noppes.npcs.blocks.BlockBook;
|
||||
import noppes.npcs.blocks.BlockBorder;
|
||||
import noppes.npcs.blocks.BlockCampfire;
|
||||
import noppes.npcs.blocks.BlockCandle;
|
||||
import noppes.npcs.blocks.BlockCarpentryBench;
|
||||
import noppes.npcs.blocks.BlockChair;
|
||||
import noppes.npcs.blocks.BlockCouchWood;
|
||||
import noppes.npcs.blocks.BlockCouchWool;
|
||||
import noppes.npcs.blocks.BlockCrate;
|
||||
import noppes.npcs.blocks.BlockCrystal;
|
||||
import noppes.npcs.blocks.BlockLamp;
|
||||
import noppes.npcs.blocks.BlockMailbox;
|
||||
import noppes.npcs.blocks.BlockNpcRedstone;
|
||||
import noppes.npcs.blocks.BlockPedestal;
|
||||
import noppes.npcs.blocks.BlockPlaceholder;
|
||||
import noppes.npcs.blocks.BlockShelf;
|
||||
import noppes.npcs.blocks.BlockSign;
|
||||
import noppes.npcs.blocks.BlockStool;
|
||||
import noppes.npcs.blocks.BlockTable;
|
||||
import noppes.npcs.blocks.BlockTallLamp;
|
||||
import noppes.npcs.blocks.BlockTombstone;
|
||||
import noppes.npcs.blocks.BlockWallBanner;
|
||||
import noppes.npcs.blocks.BlockWaypoint;
|
||||
import noppes.npcs.blocks.BlockWeaponRack;
|
||||
import noppes.npcs.blocks.tiles.TileBanner;
|
||||
import noppes.npcs.blocks.tiles.TileBarrel;
|
||||
import noppes.npcs.blocks.tiles.TileBeam;
|
||||
import noppes.npcs.blocks.tiles.TileBigSign;
|
||||
import noppes.npcs.blocks.tiles.TileBlockAnvil;
|
||||
import noppes.npcs.blocks.tiles.TileBook;
|
||||
import noppes.npcs.blocks.tiles.TileBorder;
|
||||
import noppes.npcs.blocks.tiles.TileCampfire;
|
||||
import noppes.npcs.blocks.tiles.TileCandle;
|
||||
import noppes.npcs.blocks.tiles.TileChair;
|
||||
import noppes.npcs.blocks.tiles.TileCouchWood;
|
||||
import noppes.npcs.blocks.tiles.TileCouchWool;
|
||||
import noppes.npcs.blocks.tiles.TileCrate;
|
||||
import noppes.npcs.blocks.tiles.TileLamp;
|
||||
import noppes.npcs.blocks.tiles.TileMailbox;
|
||||
import noppes.npcs.blocks.tiles.TilePedestal;
|
||||
import noppes.npcs.blocks.tiles.TileRedstoneBlock;
|
||||
import noppes.npcs.blocks.tiles.TileShelf;
|
||||
import noppes.npcs.blocks.tiles.TileSign;
|
||||
import noppes.npcs.blocks.tiles.TileStool;
|
||||
import noppes.npcs.blocks.tiles.TileTable;
|
||||
import noppes.npcs.blocks.tiles.TileTallLamp;
|
||||
import noppes.npcs.blocks.tiles.TileTombstone;
|
||||
import noppes.npcs.blocks.tiles.TileWallBanner;
|
||||
import noppes.npcs.blocks.tiles.TileWaypoint;
|
||||
import noppes.npcs.blocks.tiles.TileWeaponRack;
|
||||
import noppes.npcs.blocks.*;
|
||||
import noppes.npcs.blocks.tiles.*;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumNpcToolMaterial;
|
||||
import noppes.npcs.items.*;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class CustomItems {
|
||||
|
||||
@@ -261,7 +205,7 @@ public class CustomItems {
|
||||
GameRegistry.registerTileEntity(TileWaypoint.class, "TileWaypoint");
|
||||
GameRegistry.registerTileEntity(TileBanner.class, "TileNPCBanner");
|
||||
|
||||
if(!CustomNpcs.DisableExtraBlock){
|
||||
if(!ConfigMain.DisableExtraBlock){
|
||||
GameRegistry.registerTileEntity(TileWallBanner.class, "TileNPCWallBanner");
|
||||
GameRegistry.registerTileEntity(TileTallLamp.class, "TileNPCTallLamp");
|
||||
GameRegistry.registerTileEntity(TileChair.class, "TileNPCChair");
|
||||
@@ -324,7 +268,7 @@ public class CustomItems {
|
||||
|
||||
((ItemNpcBlock)Item.getItemFromBlock(carpentyBench)).names = new String[]{"tile.npcCarpentyBench", "tile.anvil"};
|
||||
|
||||
if(!CustomNpcs.DisableExtraBlock){
|
||||
if(!ConfigMain.DisableExtraBlock){
|
||||
blood = new BlockBlood().setBlockName("npcBloodBlock").setBlockTextureName("customnpcs:npcBloodBlock").setCreativeTab(tabBlocks);
|
||||
banner = new BlockBanner().setBlockName("npcBanner").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setCreativeTab(tabBlocks);
|
||||
wallBanner = new BlockWallBanner().setBlockName("npcWallBanner").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setCreativeTab(tabBlocks);
|
||||
@@ -413,7 +357,7 @@ public class CustomItems {
|
||||
clarinet = new ItemMusicClarinet().setUnlocalizedName("npcClarinet").setFull3D().setMaxStackSize(1).setTextureName("customnpcs:npcClarinet");
|
||||
|
||||
|
||||
if(!CustomNpcs.DisableExtraItems){
|
||||
if(!ConfigMain.DisableExtraItems){
|
||||
tabArmor = new CreativeTabNpcs("cnpcsa");
|
||||
tabWeapon = new CreativeTabNpcs("cnpcsw");
|
||||
|
||||
|
||||
@@ -16,14 +16,13 @@ import net.minecraft.block.BlockVine;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import nikedemos.markovnames.generators.*;
|
||||
import noppes.npcs.config.ConfigLoader;
|
||||
import noppes.npcs.config.ConfigProp;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.config.LoadConfiguration;
|
||||
import noppes.npcs.config.legacy.LegacyConfig;
|
||||
import noppes.npcs.controllers.*;
|
||||
import noppes.npcs.enchants.EnchantInterface;
|
||||
import noppes.npcs.entity.*;
|
||||
@@ -38,160 +37,20 @@ import java.util.UUID;
|
||||
@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.7")
|
||||
public class CustomNpcs {
|
||||
|
||||
@ConfigProp(info = "Disable Chat Bubbles")
|
||||
public static boolean EnableChatBubbles = true;
|
||||
|
||||
private static int NewEntityStartId = 0;
|
||||
|
||||
@ConfigProp(info = "Enables/Disables ALL scripting. You can still see and write code in the scripter, but these scripts won't run. True by default")
|
||||
public static boolean ScriptingEnabled = true;
|
||||
|
||||
@ConfigProp(info = "Enables/Disables the use of the the ECMA6 Javascript standard instead of ECMA5.1." +
|
||||
"\nEnabling this adds many more features to JS in scripts. Only use if on Java 8 or higher." +
|
||||
"\nNot all ECMA 6 language is supported through this functionality.")
|
||||
public static boolean ScriptingECMA6 = false;
|
||||
|
||||
@ConfigProp(info = "Enables global player event scripts to be used in the scripter. You can still see and write code in the scripter, but these scripts won't run. True by default.")
|
||||
public static boolean GlobalPlayerScripts = true;
|
||||
|
||||
@ConfigProp(info = "Enables global forge event scripts to be used in the scripter. You can still see and write code in the scripter, but these scripts won't run. True by default.")
|
||||
public static boolean GlobalForgeScripts = true;
|
||||
|
||||
@ConfigProp(info = "Enables global NPC scripts to be used in the scripter. You can still see and write code in the scripter, but these scripts won't run. False by default, use with caution!")
|
||||
public static boolean GlobalNPCScripts = false;
|
||||
|
||||
@ConfigProp(info = "If scripts are too long (>65535 characters), they normally won't be saved in NBT data.\n" +
|
||||
"This config adds additional compound tags to scripts that need it, so you can store much larger scripts!\n" +
|
||||
"Every additional compound tag adds 65535 more characters to your script length limit. Use incrementally, with caution.")
|
||||
public static int ExpandedScriptLimit = 2;
|
||||
|
||||
@ConfigProp(info = "Enables if Player Information (WAND-USE) should be printed to CustomNPCs Logs. IF on Server \n" +
|
||||
"Logs will only be present SERVER-SIDE only in CustomNPCs-latest, -1, -2, and -3")
|
||||
public static boolean PlayerLogging = false;
|
||||
|
||||
@ConfigProp(info = "Enables if Scripting Information should be printed to CustomNPCs Logs. IF on Server \n" +
|
||||
"Logs will only be present SERVER-SIDE only in CustomNPCs-latest, -1, -2, and -3")
|
||||
public static boolean ScriptLogging = false;
|
||||
|
||||
@ConfigProp(info = "Amount of Messages marked as SPAM [5, 3000]. Lower Number means MORE accurate messages \n" +
|
||||
"This frequency will determine if the log will print a line with [SPAM] to warn the console.")
|
||||
public static int ScriptFrequency = 20;
|
||||
|
||||
@ConfigProp(info = "IN Milliseconds 1s = 1000s. If a recent LOG of the same event is SENT within this threshold it will be ignored.")
|
||||
public static int ScriptIgnoreTime = 2000;
|
||||
|
||||
@ConfigProp(info = "Comma separated list of NPC Script Types that will omit these from the logs,\n" +
|
||||
"INIT,TICK,INTERACT,DIALOG,DAMAGED,KILLED,ATTACK,TARGET,COLLIDE,KILLS,DIALOG_CLOSE,TIMER")
|
||||
public static String ScriptLogIgnoreType = "TICK";
|
||||
|
||||
@ConfigProp(info = "Navigation search range for NPCs. Not recommended to increase if you have a slow pc or on a server. Minimum of 16, maximum of 96.")
|
||||
public static int NpcNavRange = 32;
|
||||
|
||||
@ConfigProp(info = "Size limit for NPCs. Default 100, larger sizes may cause lag on clients and servers that can't take it!")
|
||||
public static int NpcSizeLimit = 100;
|
||||
|
||||
@ConfigProp(info = "Set to true if you want the dialog command option to be able to use op commands like tp etc")
|
||||
public static boolean NpcUseOpCommands = false;
|
||||
|
||||
@ConfigProp(info = "Client sided! Determines where tracking quest info shows up on the screen based on a number from 0 to 8. Default: 3")
|
||||
public static int TrackingInfoAlignment = 3;
|
||||
|
||||
@ConfigProp(info = "Client sided! Offsets the tracking info GUI by this amount in the X direction.")
|
||||
public static int TrackingInfoX = 0;
|
||||
|
||||
@ConfigProp(info = "Client sided! Offsets the tracking info GUI by this amount in the Y direction.")
|
||||
public static int TrackingInfoY = 0;
|
||||
|
||||
@ConfigProp
|
||||
public static boolean InventoryGuiEnabled = true;
|
||||
|
||||
@ConfigProp
|
||||
public static boolean DisableExtraItems = false;
|
||||
@ConfigProp
|
||||
public static boolean DisableExtraBlock = false;
|
||||
|
||||
public static long ticks;
|
||||
|
||||
@SidedProxy(clientSide = "noppes.npcs.client.ClientProxy", serverSide = "noppes.npcs.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@ConfigProp(info = "Enables CustomNpcs startup update message")
|
||||
public static boolean EnableUpdateChecker = true;
|
||||
public static File Dir;
|
||||
|
||||
private static int NewEntityStartId = 0;
|
||||
public static long ticks;
|
||||
public static CustomNpcs instance;
|
||||
|
||||
public static boolean FreezeNPCs = false;
|
||||
|
||||
@ConfigProp(info = "Only ops can create and edit npcs")
|
||||
public static boolean OpsOnly = false;
|
||||
|
||||
@ConfigProp(info = "Only ops can see and edit scripts")
|
||||
public static boolean ScriptOpsOnly = false;
|
||||
|
||||
@ConfigProp(info = "Comma separated list of player UUIDs that can see and edit scripts. If ScriptsOpsOnly is true,\n" +
|
||||
"ops and players with these IDs can see and edit scripts. Example:\n" +
|
||||
"b876ec32-e396-476b-a115-8438d83c67d4,069a79f4-44e9-4726-a5be-fca90e38aaf5,be951074-c7ea-4f02-a725-bf017bc88650\n" +
|
||||
"Get a player's UUID from a site like NameMC or the API IPlayer.getUniqueID() function!\n" +
|
||||
"If left empty and ScriptsOpsOnly is false, anyone can see and edit scripts with a scripter.")
|
||||
public static String ScriptDevIDs = "";
|
||||
|
||||
@ConfigProp(info = "Default interact line. Leave empty to not have one")
|
||||
public static String DefaultInteractLine = "Hello @p";
|
||||
|
||||
@ConfigProp
|
||||
public static boolean DisableEnchants = false;
|
||||
@ConfigProp(info = "Start Id for enchants. IDs can only range from 0-256")
|
||||
public static int EnchantStartId = 100;
|
||||
|
||||
@ConfigProp(info = "Number of chunk loading npcs that can be active at the same time")
|
||||
public static int ChunkLoaders = 20;
|
||||
|
||||
@ConfigProp(info = "The maximum number of images any dialog can hold.")
|
||||
public static int DialogImageLimit = 10;
|
||||
|
||||
@ConfigProp(info = "The maximum number of images any dialog can hold.")
|
||||
public static int SkinOverlayLimit = 10;
|
||||
|
||||
public static File Dir;
|
||||
|
||||
@ConfigProp(info = "Set to false if you want to disable guns")
|
||||
public static boolean GunsEnabled = true;
|
||||
|
||||
@ConfigProp(info = "Enables leaves decay")
|
||||
public static boolean LeavesDecayEnabled = true;
|
||||
|
||||
@ConfigProp(info = "Enables Vine Growth")
|
||||
public static boolean VineGrowthEnabled = true;
|
||||
|
||||
@ConfigProp(info = "Enables Ice Melting")
|
||||
public static boolean IceMeltsEnabled = true;
|
||||
|
||||
@ConfigProp(info = "Normal players can use soulstone on animals")
|
||||
public static boolean SoulStoneAnimals = true;
|
||||
|
||||
@ConfigProp(info = "Normal players can use soulstone on villagers")
|
||||
public static boolean SoulStoneVillagers = false;
|
||||
|
||||
@ConfigProp(info = "Normal players can use soulstone on all npcs")
|
||||
public static boolean SoulStoneNPCs = false;
|
||||
|
||||
@ConfigProp(info = "Normal players can use soulstone on friendly npcs")
|
||||
public static boolean SoulStoneFriendlyNPCs = false;
|
||||
|
||||
@ConfigProp(info="When set to Minecraft it will use minecrafts font, when Default it will use OpenSans. Can only use fonts installed on your PC")
|
||||
public static String FontType = "Default";
|
||||
|
||||
@ConfigProp(info="Font size for custom fonts (doesn't work with minecrafts font)")
|
||||
public static int FontSize = 18;
|
||||
|
||||
@ConfigProp(info = "Enables Overlay Mixins for Conflicts relating to Optifine or other Skin Renderers. If crashes occur, please disable.")
|
||||
public static boolean EntityRendererMixin = true;
|
||||
|
||||
public static FMLEventChannel Channel;
|
||||
public static FMLEventChannel ChannelPlayer;
|
||||
|
||||
public static ConfigLoader Config;
|
||||
|
||||
public static ArrayList<UUID> ScriptDevs = new ArrayList<>();
|
||||
|
||||
public static final MarkovGenerator[] MARKOV_GENERATOR = new MarkovGenerator[10];
|
||||
@@ -209,6 +68,12 @@ public class CustomNpcs {
|
||||
public static boolean DialogCloseIgnore = false;
|
||||
public static boolean TimerIgnore = false;
|
||||
|
||||
public static String configPath;
|
||||
public static String legacyPath;
|
||||
public static boolean legacyExist;
|
||||
|
||||
public static LegacyConfig legacyConfig;
|
||||
|
||||
public CustomNpcs() {
|
||||
instance = this;
|
||||
}
|
||||
@@ -228,99 +93,22 @@ public class CustomNpcs {
|
||||
Dir = new File(dir, "customnpcs");
|
||||
Dir.mkdir();
|
||||
|
||||
Config = new ConfigLoader(this.getClass(), new File(dir, "config"), "CustomNpcs");
|
||||
Config.loadConfig();
|
||||
configPath = ev.getModConfigurationDirectory() + File.separator + "CustomNpcPlus";
|
||||
legacyPath = ev.getModConfigurationDirectory() + "/CustomNpcs.cfg";
|
||||
|
||||
try {
|
||||
ScriptDevs.clear();
|
||||
String[] uuidStrings = ScriptDevIDs.split(",");
|
||||
for (String s : uuidStrings) {
|
||||
ScriptDevs.add(UUID.fromString(s));
|
||||
File configDir = new File(configPath);
|
||||
if(!configDir.exists()){
|
||||
// Convert Legacy Config to New Config if NO Config Folder Exists
|
||||
File legacyFile = new File(legacyPath);
|
||||
if(legacyFile.exists()){
|
||||
System.out.println("Loading Legacy Client");
|
||||
legacyExist = true;
|
||||
legacyConfig = new LegacyConfig();
|
||||
legacyConfig.init();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
if (NpcNavRange < 16) {
|
||||
NpcNavRange = 16;
|
||||
}
|
||||
if (NpcNavRange > 96) {
|
||||
NpcNavRange = 96;
|
||||
}
|
||||
|
||||
if(NpcSizeLimit < 1)
|
||||
NpcSizeLimit = 1;
|
||||
|
||||
if (DialogImageLimit < 0) {
|
||||
DialogImageLimit = 0;
|
||||
}
|
||||
|
||||
if (SkinOverlayLimit < 0) {
|
||||
SkinOverlayLimit = 0;
|
||||
}
|
||||
|
||||
if (TrackingInfoAlignment < 0)
|
||||
TrackingInfoAlignment = 0;
|
||||
if (TrackingInfoAlignment > 8)
|
||||
TrackingInfoAlignment = 8;
|
||||
|
||||
if (ExpandedScriptLimit < 0)
|
||||
ExpandedScriptLimit = 0;
|
||||
|
||||
if (ScriptFrequency < 5)
|
||||
ScriptFrequency = 5;
|
||||
if (ScriptFrequency > 3000)
|
||||
ScriptFrequency = 3000;
|
||||
|
||||
if (ScriptIgnoreTime < 0)
|
||||
ScriptIgnoreTime = 0;
|
||||
|
||||
try {
|
||||
String[] ignoreTypes = ScriptLogIgnoreType.split(",");
|
||||
for (String s : ignoreTypes) {
|
||||
EnumScriptType type = EnumScriptType.valueOfIgnoreCase(s);
|
||||
if(type != null){
|
||||
switch (type){
|
||||
case INIT:
|
||||
InitIgnore = true;
|
||||
break;
|
||||
case TICK:
|
||||
TickIgnore = true;
|
||||
break;
|
||||
case INTERACT:
|
||||
InteractIgnore = true;
|
||||
break;
|
||||
case DIALOG:
|
||||
DialogIgnore = true;
|
||||
break;
|
||||
case DAMAGED:
|
||||
DamagedIgnore = true;
|
||||
break;
|
||||
case KILLED:
|
||||
KilledIgnore = true;
|
||||
break;
|
||||
case ATTACK:
|
||||
AttackIgnore = true;
|
||||
break;
|
||||
case TARGET:
|
||||
TargetIgnore = true;
|
||||
break;
|
||||
case COLLIDE:
|
||||
CollideIgnore = true;
|
||||
break;
|
||||
case KILLS:
|
||||
KillsIgnore = true;
|
||||
break;
|
||||
case DIALOG_CLOSE:
|
||||
DialogCloseIgnore = true;
|
||||
break;
|
||||
case TIMER:
|
||||
TimerIgnore = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
configPath += File.separator;
|
||||
LoadConfiguration.init(configPath);
|
||||
|
||||
EnchantInterface.load();
|
||||
CustomItems.load();
|
||||
@@ -405,6 +193,7 @@ public class CustomNpcs {
|
||||
new QuestController();
|
||||
new PlayerDataController();
|
||||
new FactionController();
|
||||
new TagController();
|
||||
new TransportController();
|
||||
new GlobalDataController();
|
||||
new SpawnController();
|
||||
@@ -420,13 +209,13 @@ public class CustomNpcs {
|
||||
for(String name : names){
|
||||
Block block = (Block) Block.blockRegistry.getObject(name);
|
||||
if(block instanceof BlockLeavesBase){
|
||||
block.setTickRandomly(LeavesDecayEnabled);
|
||||
block.setTickRandomly(ConfigMain.LeavesDecayEnabled);
|
||||
}
|
||||
if(block instanceof BlockVine){
|
||||
block.setTickRandomly(VineGrowthEnabled);
|
||||
block.setTickRandomly(ConfigMain.VineGrowthEnabled);
|
||||
}
|
||||
if(block instanceof BlockIce){
|
||||
block.setTickRandomly(IceMeltsEnabled);
|
||||
block.setTickRandomly(ConfigMain.IceMeltsEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -508,11 +297,4 @@ public class CustomNpcs {
|
||||
public static MinecraftServer getServer(){
|
||||
return MinecraftServer.getServer();
|
||||
}
|
||||
|
||||
public static boolean isScriptDev(EntityPlayer player) {
|
||||
if(CustomNpcs.ScriptOpsOnly && !MinecraftServer.getServer().getConfigurationManager().func_152596_g(player.getGameProfile()) ||
|
||||
ScriptDevs.contains(player.getUniqueID())){
|
||||
return true;
|
||||
} else return ScriptDevIDs.isEmpty();
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,14 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import noppes.npcs.CustomNpcsPermissions.Permission;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
public class CustomNpcsPermissions{
|
||||
@@ -38,6 +33,7 @@ public class CustomNpcsPermissions{
|
||||
public static final Permission GLOBAL_TRANSPORT = new Permission("customnpcs.global.transport");
|
||||
public static final Permission GLOBAL_RECIPE = new Permission("customnpcs.global.recipe");
|
||||
public static final Permission GLOBAL_NATURALSPAWN = new Permission("customnpcs.global.naturalspawn");
|
||||
public static final Permission GLOBAL_TAG = new Permission("customnpcs.global.tag");
|
||||
|
||||
public static final Permission SPAWNER_MOB = new Permission("customnpcs.spawner.mob");
|
||||
public static final Permission SPAWNER_CREATE = new Permission("customnpcs.spawner.create");
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -12,6 +9,9 @@ import noppes.npcs.constants.EnumNavType;
|
||||
import noppes.npcs.constants.EnumStandingType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DataAI {
|
||||
private EntityNPCInterface npc;
|
||||
|
||||
@@ -256,8 +256,8 @@ public class DataAI {
|
||||
return npc.getDistanceSq(pos[0] + 0.5, pos[1], pos[2] + 0.5);
|
||||
}
|
||||
|
||||
public void setWalkingSpeed(int speed){
|
||||
this.moveSpeed = speed;
|
||||
public void setWalkingSpeed(double speed){
|
||||
this.moveSpeed = (int)speed;
|
||||
npc.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(npc.getSpeed());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
@@ -12,21 +10,9 @@ import noppes.npcs.controllers.data.FactionOptions;
|
||||
import noppes.npcs.controllers.data.Line;
|
||||
import noppes.npcs.controllers.data.Lines;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobBard;
|
||||
import noppes.npcs.roles.JobChunkLoader;
|
||||
import noppes.npcs.roles.JobConversation;
|
||||
import noppes.npcs.roles.JobFollower;
|
||||
import noppes.npcs.roles.JobGuard;
|
||||
import noppes.npcs.roles.JobHealer;
|
||||
import noppes.npcs.roles.JobItemGiver;
|
||||
import noppes.npcs.roles.JobPuppet;
|
||||
import noppes.npcs.roles.JobSpawner;
|
||||
import noppes.npcs.roles.RoleBank;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
import noppes.npcs.roles.RoleFollower;
|
||||
import noppes.npcs.roles.RolePostman;
|
||||
import noppes.npcs.roles.RoleTrader;
|
||||
import noppes.npcs.roles.RoleTransporter;
|
||||
import noppes.npcs.roles.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class DataAdvanced {
|
||||
|
||||
@@ -236,8 +222,6 @@ public class DataAdvanced {
|
||||
npc.jobInterface = new JobConversation(npc);
|
||||
else if (job == EnumJobType.ChunkLoader && !(npc.jobInterface instanceof JobChunkLoader))
|
||||
npc.jobInterface = new JobChunkLoader(npc);
|
||||
else if (job == EnumJobType.Puppet && !(npc.jobInterface instanceof JobPuppet))
|
||||
npc.jobInterface = new JobPuppet(npc);
|
||||
}
|
||||
|
||||
public boolean hasWorldLines() {
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.StringUtils;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.entity.data.DataSkinOverlays;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
public class DataDisplay {
|
||||
EntityNPCInterface npc;
|
||||
public EntityNPCInterface npc;
|
||||
|
||||
public String name;
|
||||
public String title = "";
|
||||
@@ -37,6 +39,8 @@ public class DataDisplay {
|
||||
public DataSkinOverlays skinOverlayData;
|
||||
public long overlayRenderTicks = 0;
|
||||
|
||||
public AnimationData animationData;
|
||||
|
||||
public String glowTexture = "";
|
||||
|
||||
public int visible = 0; //0:visible 1:Invisible 2:semi-invisible
|
||||
@@ -61,6 +65,7 @@ public class DataDisplay {
|
||||
markovGeneratorId = new Random().nextInt(CustomNpcs.MARKOV_GENERATOR.length-1);
|
||||
skinOverlayData = new DataSkinOverlays(npc);
|
||||
name = getRandomName();
|
||||
animationData = new AnimationData(this);
|
||||
}
|
||||
|
||||
public String getRandomName() {
|
||||
@@ -80,6 +85,8 @@ public class DataDisplay {
|
||||
|
||||
nbttagcompound = skinOverlayData.writeToNBT(nbttagcompound);
|
||||
|
||||
nbttagcompound = animationData.writeToNBT(nbttagcompound);
|
||||
|
||||
if (this.playerProfile != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
@@ -154,9 +161,11 @@ public class DataDisplay {
|
||||
|
||||
skinOverlayData.readFromNBT(nbttagcompound);
|
||||
|
||||
animationData.readFromNBT(nbttagcompound);
|
||||
|
||||
modelSize = ValueUtil.CorrectInt(nbttagcompound.getInteger("Size"), 1, Integer.MAX_VALUE);
|
||||
if(modelSize > CustomNpcs.NpcSizeLimit)
|
||||
modelSize = CustomNpcs.NpcSizeLimit;
|
||||
if(modelSize > ConfigMain.NpcSizeLimit)
|
||||
modelSize = ConfigMain.NpcSizeLimit;
|
||||
|
||||
modelType = nbttagcompound.getInteger("modelType");
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -16,6 +13,9 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class DataInventory implements IInventory{
|
||||
public HashMap<Integer,ItemStack> items = new HashMap<Integer,ItemStack>();
|
||||
public HashMap<Integer,Double> dropchance = new HashMap<Integer,Double>();
|
||||
|
||||
@@ -178,7 +178,7 @@ public class DataStats {
|
||||
public float getAttackStrength(){
|
||||
return attackStrength;
|
||||
}
|
||||
public void setAttackStrength(float strength){
|
||||
public void setAttackStrength(double strength){
|
||||
attackStrength = (float)(Math.floor(strength));
|
||||
npc.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackStrength);
|
||||
}
|
||||
|
||||
@@ -15,33 +15,24 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.controllers.*;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.event.*;
|
||||
import noppes.npcs.scripted.event.PlayerEvent.ChatEvent;
|
||||
import noppes.npcs.scripted.event.PlayerEvent.ContainerOpen;
|
||||
import noppes.npcs.scripted.event.PlayerEvent.DamagedEntityEvent;
|
||||
import noppes.npcs.scripted.event.PlayerEvent.KeyPressedEvent;
|
||||
import noppes.npcs.scripted.event.PlayerEvent.LoginEvent;
|
||||
import noppes.npcs.scripted.event.PlayerEvent.LogoutEvent;
|
||||
import noppes.npcs.scripted.event.PlayerEvent.PickUpEvent;
|
||||
import noppes.npcs.scripted.event.PlayerEvent.DropEvent;
|
||||
import noppes.npcs.api.entity.IEntity;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.gui.ICustomGui;
|
||||
import noppes.npcs.api.handler.data.INaturalSpawn;
|
||||
import noppes.npcs.api.item.IItemCustom;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.controllers.CustomGuiController;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.event.*;
|
||||
import noppes.npcs.scripted.event.PlayerEvent.*;
|
||||
import noppes.npcs.scripted.item.ScriptCustomItem;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import noppes.npcs.config.ConfigDebug;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.io.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.ConsoleHandler;
|
||||
import java.util.logging.Formatter;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.logging.StreamHandler;
|
||||
import java.util.logging.*;
|
||||
|
||||
public class LogWriter {
|
||||
private final static String name = "CustomNPCs";
|
||||
@@ -170,7 +161,7 @@ public class LogWriter {
|
||||
long secondsSinceFirst = TimeUnit.MILLISECONDS.toSeconds(new Date().getTime() - stamp.makeDate.getTime());
|
||||
long millisecSinceLast = TimeUnit.MILLISECONDS.toMillis(stamp.recentDate.getTime() - stamp.makeDate.getTime());
|
||||
|
||||
double frequency = (float)CustomNpcs.ScriptFrequency / 60;
|
||||
double frequency = (float) ConfigDebug.ScriptFrequency / 60;
|
||||
// Reset Log if 2 Minutes Pass
|
||||
if (secondsSinceFirst > 120) {
|
||||
LogWriter.script(message);
|
||||
@@ -184,7 +175,7 @@ public class LogWriter {
|
||||
stamp.recentDate = new Date();
|
||||
}
|
||||
// IF event occurs to QUICKLY Ignore.
|
||||
else if (millisecSinceLast < CustomNpcs.ScriptIgnoreTime){
|
||||
else if (millisecSinceLast < ConfigDebug.ScriptIgnoreTime){
|
||||
stamp.recentDate = new Date();
|
||||
}
|
||||
else if(secondsSinceFirst > 10 && (double)stamp.counter / secondsSinceFirst > frequency){
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntityBat;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class ModelDataShared{
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -10,6 +8,8 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
import noppes.npcs.controllers.data.IScriptHandler;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class NBTTags {
|
||||
|
||||
public static HashMap<Integer, ItemStack> getItemStackList(
|
||||
|
||||
@@ -1,24 +1,22 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.*;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
@@ -29,6 +27,8 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.event.CustomNPCsEvent;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class NPCSpawning {
|
||||
private static Set<ChunkCoordIntPair> eligibleChunksForSpawning = Sets.newHashSet();
|
||||
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.datatransfer.Clipboard;
|
||||
import java.awt.datatransfer.ClipboardOwner;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.datatransfer.*;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class NoppesStringUtils {
|
||||
|
||||
final static int[] illegalChars = {34, 60, 62, 124, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 58, 42, 63, 92, 47};
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -21,6 +15,9 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.handler.data.IQuestObjective;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.constants.EnumOptionType;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.constants.EnumPlayerPacket;
|
||||
@@ -32,14 +29,16 @@ import noppes.npcs.controllers.*;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleFollower;
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.ScriptSound;
|
||||
import noppes.npcs.scripted.event.DialogEvent;
|
||||
import noppes.npcs.scripted.event.QuestEvent;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.handler.data.IQuestObjective;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class NoppesUtilPlayer {
|
||||
|
||||
@@ -354,7 +353,7 @@ public class NoppesUtilPlayer {
|
||||
|
||||
while(var8.hasNext()) {
|
||||
ItemStack item = (ItemStack)var8.next();
|
||||
if (item.stackSize > 0) {
|
||||
if (item != null && item.stackSize > 0) {
|
||||
IItemStack iStack = NpcAPI.Instance().getIItemStack(item);
|
||||
if (iStack != null){
|
||||
list.add(iStack);
|
||||
@@ -371,7 +370,6 @@ public class NoppesUtilPlayer {
|
||||
EventHooks.onQuestTurnedIn(event);
|
||||
IItemStack[] var12 = event.itemRewards;
|
||||
int var14 = var12.length;
|
||||
|
||||
for(int var10 = 0; var10 < var14; ++var10) {
|
||||
IItemStack item = var12[var10];
|
||||
if (item != null) {
|
||||
@@ -382,7 +380,6 @@ public class NoppesUtilPlayer {
|
||||
data.quest.questInterface.handleComplete(player);
|
||||
if(data.quest.rewardExp > 0){
|
||||
player.worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 0.5F * ((player.worldObj.rand.nextFloat() - player.worldObj.rand.nextFloat()) * 0.7F + 1.8F));
|
||||
|
||||
player.addExperience(data.quest.rewardExp);
|
||||
}
|
||||
data.quest.factionOptions.addPoints(player);
|
||||
@@ -395,7 +392,12 @@ public class NoppesUtilPlayer {
|
||||
}
|
||||
|
||||
PlayerQuestController.setQuestFinished(data.quest, player);
|
||||
if(data.quest.hasNewQuest()) PlayerQuestController.addActiveQuest(data.quest.getNextQuest(), player);
|
||||
if (data.quest.hasNewQuest()) {
|
||||
Quest nextQuest = data.quest.getNextQuest();
|
||||
PlayerQuestController.addActiveQuest(nextQuest, player);
|
||||
NoppesUtilPlayer.sendTrackedQuestData(player,nextQuest);
|
||||
}
|
||||
playerData.savePlayerDataOnFile();
|
||||
}
|
||||
|
||||
public static boolean compareItems(ItemStack item, ItemStack item2, boolean ignoreDamage, boolean ignoreNBT){
|
||||
@@ -501,6 +503,13 @@ public class NoppesUtilPlayer {
|
||||
}
|
||||
}
|
||||
|
||||
public static void playSoundTo(EntityPlayerMP player, ScriptSound sound) {
|
||||
NBTTagCompound compound = sound.writeToNBT();
|
||||
if (sound.sourceEntity == null || player.worldObj.provider.dimensionId == sound.sourceEntity.getDimension()) {
|
||||
Server.sendData(player, EnumPacketClient.PLAY_SOUND_TO_NO_ID, compound);
|
||||
}
|
||||
}
|
||||
|
||||
public static void stopSoundFor(EntityPlayerMP player, int id) {
|
||||
Server.sendData(player, EnumPacketClient.STOP_SOUND_FOR, id);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import net.minecraft.command.server.CommandBlockLogic;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
@@ -36,44 +23,29 @@ import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.constants.EnumPlayerData;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.containers.ContainerManageBanks;
|
||||
import noppes.npcs.containers.ContainerManageRecipes;
|
||||
import noppes.npcs.controllers.data.Bank;
|
||||
import noppes.npcs.controllers.BankController;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.DialogCategory;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
import noppes.npcs.controllers.data.DialogOption;
|
||||
import noppes.npcs.controllers.data.Faction;
|
||||
import noppes.npcs.controllers.FactionController;
|
||||
import noppes.npcs.controllers.data.PlayerBankData;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.data.PlayerDialogData;
|
||||
import noppes.npcs.controllers.data.PlayerFactionData;
|
||||
import noppes.npcs.controllers.PlayerQuestController;
|
||||
import noppes.npcs.controllers.data.PlayerQuestData;
|
||||
import noppes.npcs.controllers.data.PlayerTransportData;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.QuestCategory;
|
||||
import noppes.npcs.controllers.QuestController;
|
||||
import noppes.npcs.controllers.data.RecipeCarpentry;
|
||||
import noppes.npcs.controllers.RecipeController;
|
||||
import noppes.npcs.controllers.ServerCloneController;
|
||||
import noppes.npcs.controllers.data.TransportCategory;
|
||||
import noppes.npcs.controllers.TransportController;
|
||||
import noppes.npcs.controllers.data.TransportLocation;
|
||||
import noppes.npcs.controllers.*;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.entity.EntityDialogNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleTransporter;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.ScriptSound;
|
||||
import noppes.npcs.scripted.event.DialogEvent;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
public class NoppesUtilServer {
|
||||
private static HashMap<String,Quest> editingQuests = new HashMap<String,Quest>();
|
||||
@@ -113,6 +85,14 @@ public class NoppesUtilServer {
|
||||
}
|
||||
sendScrollData(player, map);
|
||||
}
|
||||
|
||||
public static void sendTagDataAll(EntityPlayerMP player) {
|
||||
Map<String,Integer> map = new HashMap<String,Integer>();
|
||||
for(Tag tag : TagController.getInstance().tags.values()){
|
||||
map.put(tag.name, tag.id);
|
||||
}
|
||||
sendScrollData(player, map);
|
||||
}
|
||||
|
||||
public static void sendBankDataAll(EntityPlayerMP player) {
|
||||
Map<String,Integer> map = new HashMap<String,Integer>();
|
||||
@@ -333,6 +313,13 @@ public class NoppesUtilServer {
|
||||
}
|
||||
}
|
||||
|
||||
public static void playSound(ScriptSound sound) {
|
||||
List<EntityPlayer> list = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
|
||||
for (EntityPlayer player : list) {
|
||||
NoppesUtilPlayer.playSoundTo((EntityPlayerMP) player, sound);
|
||||
}
|
||||
}
|
||||
|
||||
public static void stopSound(int id) {
|
||||
List<EntityPlayer> list = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
|
||||
for (EntityPlayer player : list) {
|
||||
@@ -672,7 +659,7 @@ public class NoppesUtilServer {
|
||||
}
|
||||
Server.sendData(player, EnumPacketClient.GUI_CLOSE, i, comp);
|
||||
}
|
||||
|
||||
|
||||
public static Entity spawnCloneWithProtection(NBTTagCompound compound, int x, int y,
|
||||
int z, World worldObj) {
|
||||
ServerCloneController.Instance.cleanTags(compound);
|
||||
@@ -716,8 +703,19 @@ public class NoppesUtilServer {
|
||||
if(entity == null){
|
||||
return null;
|
||||
}
|
||||
worldObj.spawnEntityInWorld(entity);
|
||||
return entity;
|
||||
int i = MathHelper.floor_double(entity.posX / 16.0D);
|
||||
int j = MathHelper.floor_double(entity.posZ / 16.0D);
|
||||
if (!entity.forceSpawn && !worldObj.checkChunksExist(
|
||||
(int)entity.posX,(int)entity.posY,(int)entity.posZ,(int)entity.posX,(int)entity.posY,(int)entity.posZ
|
||||
))
|
||||
{
|
||||
return null;
|
||||
} else {
|
||||
worldObj.getChunkFromChunkCoords(i, j).addEntity(entity);
|
||||
worldObj.loadedEntityList.add(entity);
|
||||
worldObj.onEntityAdded(entity);
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isOp(EntityPlayer player) {
|
||||
@@ -784,4 +782,41 @@ public class NoppesUtilServer {
|
||||
public static boolean IsItemStackNull(ItemStack is) {
|
||||
return is == null || is.stackSize == 0 || is.getItem() == null;
|
||||
}
|
||||
|
||||
public static String millisToTime(long millis) {
|
||||
long seconds = millis / 1000;
|
||||
long minutes = seconds / 60;
|
||||
long hours = minutes / 60;
|
||||
long days = hours / 24;
|
||||
long months = days / 30;
|
||||
long years = months / 12;
|
||||
|
||||
months = months % 12;
|
||||
days = days % 30;
|
||||
hours = hours % 24;
|
||||
minutes = minutes % 60;
|
||||
seconds = seconds % 60;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (years > 0) {
|
||||
sb.append(years + " year(s) ");
|
||||
}
|
||||
if (months > 0) {
|
||||
sb.append(months + " month(s) ");
|
||||
}
|
||||
if (days > 0) {
|
||||
sb.append(days + " day(s) ");
|
||||
}
|
||||
if (hours > 0) {
|
||||
sb.append(hours + " hour(s) ");
|
||||
}
|
||||
if (minutes > 0) {
|
||||
sb.append(minutes + " minute(s) ");
|
||||
}
|
||||
if (seconds > 0) {
|
||||
sb.append(seconds + " second(s)");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class NpcMiscInventory implements IInventory {
|
||||
public HashMap<Integer,ItemStack> items = new HashMap<Integer,ItemStack>();
|
||||
public int stackLimit = 64;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemEditableBook;
|
||||
@@ -18,12 +16,15 @@ import noppes.npcs.blocks.tiles.TileBigSign;
|
||||
import noppes.npcs.blocks.tiles.TileBook;
|
||||
import noppes.npcs.constants.*;
|
||||
import noppes.npcs.containers.ContainerMail;
|
||||
import noppes.npcs.controllers.*;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.PlayerQuestController;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class PacketHandlerPlayer{
|
||||
|
||||
@@ -189,9 +190,6 @@ public class PacketHandlerPlayer{
|
||||
else if(type == EnumPlayerPacket.QuestLog){
|
||||
NoppesUtilPlayer.sendQuestLogData(player);
|
||||
}
|
||||
else if(type == EnumPlayerPacket.QuestCompletion){
|
||||
NoppesUtilPlayer.questCompletion(player, buffer.readInt());
|
||||
}
|
||||
else if(type == EnumPlayerPacket.FactionsGet){
|
||||
PlayerFactionData data = PlayerDataController.instance.getPlayerData(player).factionData;
|
||||
Server.sendData(player, EnumPacketClient.GUI_DATA, data.getPlayerGuiData());
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import foxz.utils.Market;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
@@ -31,13 +26,11 @@ import net.minecraft.village.MerchantRecipeList;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import noppes.npcs.constants.EnumCompanionStage;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.constants.EnumPlayerData;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.config.ConfigDebug;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.constants.*;
|
||||
import noppes.npcs.containers.ContainerCustomGui;
|
||||
import noppes.npcs.containers.ContainerMail;
|
||||
import noppes.npcs.controllers.*;
|
||||
@@ -49,19 +42,22 @@ import noppes.npcs.roles.JobSpawner;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
import noppes.npcs.roles.RoleTrader;
|
||||
import noppes.npcs.roles.RoleTransporter;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.gui.ScriptGui;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.scripted.item.ScriptCustomItem;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class PacketHandlerServer{
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerPacket(ServerCustomPacketEvent event) {
|
||||
EntityPlayerMP player = ((NetHandlerPlayServer)event.handler).playerEntity;
|
||||
if(CustomNpcs.OpsOnly && !NoppesUtilServer.isOp(player)){
|
||||
if(ConfigMain.OpsOnly && !NoppesUtilServer.isOp(player)){
|
||||
warn(player, "tried to use custom npcs without being an op");
|
||||
return;
|
||||
}
|
||||
@@ -123,7 +119,7 @@ public class PacketHandlerServer{
|
||||
featherPackets(type, buffer, player);
|
||||
else if (item.getItem() == Item.getItemFromBlock(CustomItems.waypoint) || item.getItem() == Item.getItemFromBlock(CustomItems.border) || item.getItem() == Item.getItemFromBlock(CustomItems.redstoneBlock))
|
||||
blockPackets(type, buffer, player);
|
||||
else if (CustomNpcs.isScriptDev(player)) {
|
||||
else if (ConfigScript.isScriptDev(player)) {
|
||||
if (type == EnumPacketServer.ScriptPlayerGet || type == EnumPacketServer.ScriptPlayerSave)
|
||||
playerScriptPackets(type, buffer, player);
|
||||
else if (type == EnumPacketServer.ScriptNPCGet || type == EnumPacketServer.ScriptNPCSave)
|
||||
@@ -178,18 +174,18 @@ public class PacketHandlerServer{
|
||||
private void getScriptsEnabled(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws IOException {
|
||||
if (type == EnumPacketServer.ScriptGlobalGuiDataGet) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setBoolean("ScriptsEnabled", CustomNpcs.ScriptingEnabled);
|
||||
compound.setBoolean("PlayerScriptsEnabled", CustomNpcs.GlobalPlayerScripts);
|
||||
compound.setBoolean("GlobalNPCScriptsEnabled", CustomNpcs.GlobalNPCScripts);
|
||||
compound.setBoolean("ForgeScriptsEnabled", CustomNpcs.GlobalForgeScripts);
|
||||
compound.setBoolean("ScriptsEnabled", ConfigScript.ScriptingEnabled);
|
||||
compound.setBoolean("PlayerScriptsEnabled", ConfigScript.GlobalPlayerScripts);
|
||||
compound.setBoolean("GlobalNPCScriptsEnabled", ConfigScript.GlobalNPCScripts);
|
||||
compound.setBoolean("ForgeScriptsEnabled", ConfigScript.GlobalForgeScripts);
|
||||
Server.sendData(player, EnumPacketClient.GUI_DATA, compound);
|
||||
}
|
||||
else if (type == EnumPacketServer.ScriptGlobalGuiDataSave) {
|
||||
NBTTagCompound compound = Server.readNBT(buffer);
|
||||
CustomNpcs.ScriptingEnabled = compound.getBoolean("ScriptsEnabled");
|
||||
CustomNpcs.GlobalPlayerScripts = compound.getBoolean("PlayerScriptsEnabled");
|
||||
CustomNpcs.GlobalNPCScripts = compound.getBoolean("GlobalNPCScriptsEnabled");
|
||||
CustomNpcs.GlobalForgeScripts = compound.getBoolean("ForgeScriptsEnabled");
|
||||
ConfigScript.ScriptingEnabled = compound.getBoolean("ScriptsEnabled");
|
||||
ConfigScript.GlobalPlayerScripts = compound.getBoolean("PlayerScriptsEnabled");
|
||||
ConfigScript.GlobalNPCScripts = compound.getBoolean("GlobalNPCScriptsEnabled");
|
||||
ConfigScript.GlobalForgeScripts = compound.getBoolean("ForgeScriptsEnabled");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +194,7 @@ public class PacketHandlerServer{
|
||||
npc.script.readFromNBT(Server.readNBT(buffer));
|
||||
npc.updateAI = true;
|
||||
npc.script.hasInited = false;
|
||||
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s SAVED NPC %s (%s, %s, %s) [%s]", "SCRIPTER", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)(npc).posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
}
|
||||
@@ -344,6 +340,9 @@ public class PacketHandlerServer{
|
||||
else if(type == EnumPacketServer.FactionsGet){
|
||||
NoppesUtilServer.sendFactionDataAll(player);
|
||||
}
|
||||
else if(type == EnumPacketServer.TagsGet){
|
||||
NoppesUtilServer.sendTagDataAll(player);
|
||||
}
|
||||
else if(type == EnumPacketServer.DialogGet){
|
||||
Dialog dialog = DialogController.instance.dialogs.get(buffer.readInt());
|
||||
if(dialog != null){
|
||||
@@ -369,11 +368,17 @@ public class PacketHandlerServer{
|
||||
faction.writeNBT(compound);
|
||||
Server.sendData(player, EnumPacketClient.GUI_DATA, compound);
|
||||
}
|
||||
else if(type == EnumPacketServer.TagGet){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
Tag tag = TagController.getInstance().get(buffer.readInt());
|
||||
tag.writeNBT(compound);
|
||||
Server.sendData(player, EnumPacketClient.GUI_DATA, compound);
|
||||
}
|
||||
}
|
||||
|
||||
private void wandPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player, EntityNPCInterface npc) throws IOException{
|
||||
if(type == EnumPacketServer.Delete){
|
||||
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s DELETE NPC %s (%s, %s, %s) [%s]", "WAND", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)npc.posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
npc.delete();
|
||||
@@ -411,7 +416,7 @@ public class PacketHandlerServer{
|
||||
npc.reset();
|
||||
if(npc.linkedData != null)
|
||||
LinkedNpcController.Instance.saveNpcData(npc);
|
||||
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s CLOSE NPC %s (%s, %s, %s) [%s]", "WAND", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)npc.posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
NoppesUtilServer.setEditingNpc(player, null);
|
||||
@@ -440,7 +445,7 @@ public class PacketHandlerServer{
|
||||
if(entity == null || !(entity instanceof EntityNPCInterface))
|
||||
return;
|
||||
NoppesUtilServer.sendOpenGui(player, EnumGuiType.MainMenuDisplay, (EntityNPCInterface) entity);
|
||||
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s OPEN NPC %s (%s, %s, %s) [%s]", "WAND", player.getCommandSenderName(), ((EntityNPCInterface)entity).display.getName(), entity.posX, entity.posY, entity.posZ, entity.worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
}
|
||||
@@ -449,7 +454,7 @@ public class PacketHandlerServer{
|
||||
if(entity == null || !(entity instanceof EntityNPCInterface))
|
||||
return;
|
||||
npc = (EntityNPCInterface) entity;
|
||||
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s DELETE NPC %s (%s, %s, %s) [%s]", "WAND", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)npc.posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
npc.delete();
|
||||
@@ -681,6 +686,25 @@ public class PacketHandlerServer{
|
||||
(new Faction()).writeNBT(compound);
|
||||
Server.sendData(player, EnumPacketClient.GUI_DATA, compound);
|
||||
}
|
||||
else if(type == EnumPacketServer.TagSet){
|
||||
// npc.setFaction(buffer.readInt());
|
||||
}
|
||||
else if(type == EnumPacketServer.TagSave){
|
||||
Tag tag = new Tag();
|
||||
tag.readNBT(Server.readNBT(buffer));
|
||||
TagController.getInstance().saveTag(tag);
|
||||
NoppesUtilServer.sendTagDataAll(player);
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
tag.writeNBT(compound);
|
||||
Server.sendData(player, EnumPacketClient.GUI_DATA, compound);
|
||||
}
|
||||
else if(type == EnumPacketServer.TagRemove){
|
||||
TagController.getInstance().delete(buffer.readInt());
|
||||
NoppesUtilServer.sendTagDataAll(player);
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
(new Tag()).writeNBT(compound);
|
||||
Server.sendData(player, EnumPacketClient.GUI_DATA, compound);
|
||||
}
|
||||
else if(type == EnumPacketServer.PlayerDataGet){
|
||||
int id = buffer.readInt();
|
||||
if(EnumPlayerData.values().length <= id)
|
||||
@@ -879,7 +903,7 @@ public class PacketHandlerServer{
|
||||
player.addChatMessage(new ChatComponentText("Failed to create an entity out of your clone"));
|
||||
return;
|
||||
}
|
||||
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s SPAWNED ENTITY %s", "CLONER", player.getCommandSenderName(), entity));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.constants.EnumQuestCompletion;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.PlayerQuestController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
public class QuestLogData {
|
||||
public String trackedQuestKey = "";
|
||||
public HashMap<String,Vector<String>> categories = new HashMap<String,Vector<String>>();
|
||||
|
||||
@@ -11,13 +11,13 @@ import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.player.EntityInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerUseItemEvent;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.items.ItemScripted;
|
||||
import noppes.npcs.scripted.event.ItemEvent;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.item.IItemCustom;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.items.ItemScripted;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.event.ItemEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
@@ -22,15 +22,16 @@ import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
|
||||
import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||
import net.minecraftforge.event.entity.living.*;
|
||||
import net.minecraftforge.event.entity.player.*;
|
||||
import net.minecraftforge.event.world.*;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.controllers.*;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
public class ScriptPlayerEventHandler {
|
||||
public ScriptPlayerEventHandler() {
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
@@ -18,9 +13,10 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.village.MerchantRecipeList;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Server {
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -34,11 +30,15 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
|
||||
import noppes.npcs.blocks.tiles.TileBanner;
|
||||
import noppes.npcs.config.ConfigDebug;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.constants.EnumQuestType;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.controllers.*;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.RecipeController;
|
||||
import noppes.npcs.controllers.ServerCloneController;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.items.ItemExcalibur;
|
||||
@@ -48,6 +48,10 @@ import noppes.npcs.quests.QuestItem;
|
||||
import noppes.npcs.quests.QuestKill;
|
||||
import noppes.npcs.roles.RoleFollower;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class ServerEventsHandler {
|
||||
|
||||
public static EntityVillager Merchant;
|
||||
@@ -61,13 +65,13 @@ public class ServerEventsHandler {
|
||||
boolean isRemote = event.entityPlayer.worldObj.isRemote;
|
||||
boolean npcInteracted = event.target instanceof EntityNPCInterface;
|
||||
|
||||
if(!isRemote && CustomNpcs.OpsOnly && !MinecraftServer.getServer().getConfigurationManager().func_152596_g(event.entityPlayer.getGameProfile())){
|
||||
if(!isRemote && ConfigMain.OpsOnly && !MinecraftServer.getServer().getConfigurationManager().func_152596_g(event.entityPlayer.getGameProfile())){
|
||||
return;
|
||||
}
|
||||
|
||||
if(!isRemote && item.getItem() == CustomItems.soulstoneEmpty && event.target instanceof EntityLivingBase) {
|
||||
((ItemSoulstoneEmpty)item.getItem()).store((EntityLivingBase)event.target, item, event.entityPlayer);
|
||||
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s PICKED ENTITY %s", "SOULSTONE", event.entityPlayer.getCommandSenderName(), event.target));
|
||||
}
|
||||
}
|
||||
@@ -78,7 +82,7 @@ public class ServerEventsHandler {
|
||||
}
|
||||
event.setCanceled(true);
|
||||
NoppesUtilServer.sendOpenGui(event.entityPlayer, EnumGuiType.MainMenuDisplay, (EntityNPCInterface) event.target);
|
||||
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s OPEN NPC %s (%s, %s, %s) [%s]", "WAND", event.entityPlayer.getCommandSenderName(), ((EntityNPCInterface)(event.target)).display.getName(), (int)(event.target).posX, (int)(event.target).posY, (int)(event.target).posZ, (event.target).worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
}
|
||||
@@ -99,7 +103,7 @@ public class ServerEventsHandler {
|
||||
NoppesUtilServer.setEditingNpc(event.entityPlayer, (EntityNPCInterface)event.target);
|
||||
event.setCanceled(true);
|
||||
Server.sendData((EntityPlayerMP)event.entityPlayer, EnumPacketClient.GUI, EnumGuiType.Script.ordinal());
|
||||
if(CustomNpcs.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s OPEN NPC %s (%s, %s, %s) [%s]", "SCRIPTER", event.entityPlayer.getCommandSenderName(), ((EntityNPCInterface)(event.target)).display.getName(), (int)(event.target).posX, (int)(event.target).posY, (int)(event.target).posZ, (event.target).worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.client.AnalyticsTracking;
|
||||
import noppes.npcs.controllers.SpawnController;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.client.AnalyticsTracking;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
public class ServerTickHandler {
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TextBlock {
|
||||
public List<IChatComponent> lines = new ArrayList<IChatComponent>();
|
||||
}
|
||||
@@ -1,17 +1,15 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagInt;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.controllers.data.Line;
|
||||
import noppes.npcs.controllers.data.Lines;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class VersionCompatibility {
|
||||
public static int ModRev = 19;
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
@@ -13,6 +9,8 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class EntityAIAmbushTarget extends EntityAIBase
|
||||
{
|
||||
private EntityNPCInterface theEntity;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.constants.EnumMovingType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class EntityAIAttackTarget extends EntityAIBase
|
||||
this.entityTarget = entitylivingbase;
|
||||
this.attacker.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(((EntityNPCInterface) this.attacker).stats.aggroRange);
|
||||
this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase);
|
||||
this.attacker.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(CustomNpcs.NpcNavRange);
|
||||
this.attacker.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(ConfigMain.NpcNavRange);
|
||||
return this.entityPathEntity != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.RandomPositionGenerator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.pathfinding.PathNavigate;
|
||||
@@ -14,6 +11,8 @@ import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.constants.EnumNavType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EntityAIAvoidTarget extends EntityAIBase
|
||||
{
|
||||
/** The entity we are attached to */
|
||||
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.ai;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.RandomPositionGenerator;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -9,6 +7,8 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class EntityAIFindShade extends EntityAIBase
|
||||
{
|
||||
private EntityCreature theCreature;
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.RandomPositionGenerator;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.pathfinding.PathPoint;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -9,6 +7,8 @@ import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.constants.EnumStandingType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class EntityAILook extends EntityAIBase{
|
||||
private final EntityNPCInterface npc;
|
||||
private int idle = 0;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -9,6 +7,8 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class EntityAIMoveIndoors extends EntityAIBase
|
||||
{
|
||||
private EntityCreature theCreature;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.constants.EnumMovingType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EntityAIMovingPath extends EntityAIBase
|
||||
{
|
||||
private EntityNPCInterface npc;
|
||||
|
||||
@@ -1,23 +1,13 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.pathfinding.PathPoint;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class EntityAIOrbitTarget extends EntityAIBase
|
||||
{
|
||||
private EntityNPCInterface theEntity;
|
||||
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.ai;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.RandomPositionGenerator;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IRangedAttackMob;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.constants.EnumNavType;
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.ai;
|
||||
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumMovingType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class EntityAIReturn extends EntityAIBase
|
||||
return false;
|
||||
}
|
||||
|
||||
if(npc.ai.movingType == EnumMovingType.MovingPath && npc.ai.getDistanceSqToPathPoint() < CustomNpcs.NpcNavRange * CustomNpcs.NpcNavRange)
|
||||
if(npc.ai.movingType == EnumMovingType.MovingPath && npc.ai.getDistanceSqToPathPoint() < ConfigMain.NpcNavRange * ConfigMain.NpcNavRange)
|
||||
return false;
|
||||
|
||||
if (npc.getNavigator().noPath() || (!npc.isAttacking() && wasAttacked)) {
|
||||
@@ -129,10 +129,10 @@ public class EntityAIReturn extends EntityAIBase
|
||||
double posY = endPosY;
|
||||
double posZ = endPosZ;
|
||||
double range = npc.getDistance(posX, posY, posZ);
|
||||
if(range > CustomNpcs.NpcNavRange || towards){
|
||||
if(range > ConfigMain.NpcNavRange || towards){
|
||||
int distance = (int) range;
|
||||
if(distance > CustomNpcs.NpcNavRange)
|
||||
distance = CustomNpcs.NpcNavRange / 2;
|
||||
if(distance > ConfigMain.NpcNavRange)
|
||||
distance = ConfigMain.NpcNavRange / 2;
|
||||
else
|
||||
distance /= 2;
|
||||
if(distance > 2){
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.constants.EnumNavType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class EntityAIStalkTarget extends EntityAIBase
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.NoppesStringUtils;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.Server;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class EntityAITransform extends EntityAIBase {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.ai.selector.NPCInteractSelector;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.controllers.data.Line;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class EntityAIWander extends EntityAIBase
|
||||
{
|
||||
private EntityNPCInterface entity;
|
||||
@@ -84,12 +84,12 @@ public class EntityAIWander extends EntityAIBase
|
||||
if(entity.ai.walkingRange > 0){
|
||||
double distance = this.entity.getDistanceSq(this.entity.getStartXPos(), this.entity.getStartYPos(), this.entity.getStartZPos());
|
||||
int range = (int) MathHelper.sqrt_double(this.entity.ai.walkingRange * this.entity.ai.walkingRange - distance);
|
||||
if(range > CustomNpcs.NpcNavRange)
|
||||
range = CustomNpcs.NpcNavRange;
|
||||
if(range > ConfigMain.NpcNavRange)
|
||||
range = ConfigMain.NpcNavRange;
|
||||
if(range < 3){
|
||||
range = this.entity.ai.walkingRange;
|
||||
if(range > CustomNpcs.NpcNavRange)
|
||||
range = CustomNpcs.NpcNavRange;
|
||||
if(range > ConfigMain.NpcNavRange)
|
||||
range = ConfigMain.NpcNavRange;
|
||||
Vec3 start = Vec3.createVectorHelper(this.entity.getStartXPos(), this.entity.getStartYPos(), this.entity.getStartZPos());
|
||||
return RandomPositionGeneratorAlt.findRandomTargetBlockTowards(this.entity, range / 2, range / 2 > 7?7:range / 2, start);
|
||||
}
|
||||
@@ -97,7 +97,7 @@ public class EntityAIWander extends EntityAIBase
|
||||
return RandomPositionGeneratorAlt.findRandomTarget(this.entity, range, range / 2 > 7?7:range / 2);
|
||||
}
|
||||
}
|
||||
return RandomPositionGeneratorAlt.findRandomTarget(this.entity, CustomNpcs.NpcNavRange, 7);
|
||||
return RandomPositionGeneratorAlt.findRandomTarget(this.entity, ConfigMain.NpcNavRange, 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,6 @@ package noppes.npcs.ai;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.RandomPositionGenerator;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.pathfinding.PathPoint;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class RandomPositionGeneratorAlt
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.pathfinding.PathFinder;
|
||||
import net.minecraft.pathfinding.PathPoint;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.IntHashMap;
|
||||
@@ -16,7 +15,6 @@ import net.minecraft.world.IBlockAccess;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.ai.pathfinder;
|
||||
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityMoveHelper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import noppes.npcs.entity.EntityNPCFlying;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.ai.pathfinder;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.pathfinding.PathPoint;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class NPCPath extends PathEntity{
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ChunkCache;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class PathNavigateFlying extends PathNavigate {
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package noppes.npcs.ai.selector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.potion.Potion;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.constants.EnumCompanionJobs;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.constants.EnumMovingType;
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
package noppes.npcs.ai.target;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAITarget;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class EntityAIClearTarget extends EntityAITarget
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package noppes.npcs.ai.target;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -11,9 +8,12 @@ import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAITarget;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class EntityAIClosestTarget extends EntityAITarget
|
||||
{
|
||||
private final Class targetClass;
|
||||
@@ -59,7 +59,7 @@ public class EntityAIClosestTarget extends EntityAITarget
|
||||
double d0 = this.getTargetDistance();
|
||||
List list = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand(d0, MathHelper.ceiling_double_int(d0 / 2.0D), d0), this.field_82643_g);
|
||||
Collections.sort(list, this.theNearestAttackableTargetSorter);
|
||||
taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(CustomNpcs.NpcNavRange);
|
||||
taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(ConfigMain.NpcNavRange);
|
||||
if (list.isEmpty())
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.ai.target;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAITarget;
|
||||
import net.minecraft.entity.passive.EntityTameable;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.ai.target;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAITarget;
|
||||
import net.minecraft.entity.passive.EntityTameable;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -21,8 +21,8 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.blocks.tiles.TileBanner;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockBanner extends BlockContainer{
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -16,6 +14,8 @@ import noppes.npcs.blocks.tiles.TileBarrel;
|
||||
import noppes.npcs.blocks.tiles.TileNpcContainer;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockBarrel extends BlockRotated{
|
||||
|
||||
public BlockBarrel() {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -13,6 +11,8 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.blocks.tiles.TileBeam;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockBeam extends BlockRotated{
|
||||
|
||||
public BlockBeam() {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -19,13 +19,9 @@ import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.Server;
|
||||
import noppes.npcs.blocks.tiles.TileBigSign;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBigSign extends BlockContainer{
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockEnchantmentTable;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.block.BlockFurnace;
|
||||
import net.minecraft.block.BlockGlowstone;
|
||||
import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -18,9 +15,6 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomItems;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBlood extends Block{
|
||||
|
||||
|
||||
@@ -2,27 +2,21 @@ package noppes.npcs.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.Server;
|
||||
import noppes.npcs.blocks.tiles.TileBorder;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
public class BlockBorder extends BlockContainer{
|
||||
public int renderId = -1;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -14,11 +14,9 @@ import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.blocks.tiles.TileCampfire;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockCampfire extends BlockLightable{
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -12,8 +11,8 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.blocks.tiles.TileCandle;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockCandle extends BlockLightable{
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
@@ -15,11 +13,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.blocks.tiles.TileBlockAnvil;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCarpentryBench extends BlockContainer
|
||||
{
|
||||
public int renderId = -1;
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -14,17 +9,12 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import noppes.npcs.blocks.tiles.TileChair;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.entity.EntityChairMount;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockChair extends BlockRotated{
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
@@ -22,8 +22,8 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileCouchWood;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCouchWood extends BlockContainer{
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
@@ -22,8 +22,8 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileCouchWool;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCouchWool extends BlockContainer{
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -16,6 +14,8 @@ import noppes.npcs.blocks.tiles.TileCrate;
|
||||
import noppes.npcs.blocks.tiles.TileNpcContainer;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCrate extends BlockRotated{
|
||||
|
||||
public BlockCrate() {
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBreakable;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -14,6 +10,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCrystal extends BlockBreakable{
|
||||
|
||||
public BlockCrystal() {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -10,8 +11,6 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileLamp;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockLamp extends BlockLightable{
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class BlockLightable extends BlockRotated{
|
||||
|
||||
protected BlockLightable(Block block, boolean lit) {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -21,8 +20,9 @@ import noppes.npcs.Server;
|
||||
import noppes.npcs.blocks.tiles.TileMailbox;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockMailbox extends BlockContainer{
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -18,8 +17,8 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileNpcContainer;
|
||||
import noppes.npcs.blocks.tiles.TilePedestal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockPedestal extends BlockTrigger{
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -11,8 +11,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockPlaceholder extends Block{
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -12,8 +14,6 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class BlockRotated extends BlockContainer{
|
||||
private Block block;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -14,6 +12,8 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileShelf;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockShelf extends BlockRotated{
|
||||
|
||||
public BlockShelf() {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -17,6 +15,8 @@ import noppes.npcs.blocks.tiles.TileBanner;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileSign;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSign extends BlockRotated{
|
||||
|
||||
public BlockSign() {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -16,13 +15,11 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileStool;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockStool extends BlockContainer{
|
||||
|
||||
|
||||
@@ -1,29 +1,15 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileTable;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockTable extends BlockRotated{
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -23,8 +22,8 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileTallLamp;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockTallLamp extends BlockContainer{
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -25,8 +25,8 @@ import noppes.npcs.blocks.tiles.TileBigSign;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileTombstone;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockTombstone extends BlockContainer{
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -21,8 +21,8 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.blocks.tiles.TileWallBanner;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockWallBanner extends BlockContainer{
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
package noppes.npcs.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,17 +10,14 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.blocks.tiles.TileNpcContainer;
|
||||
import noppes.npcs.blocks.tiles.TileWeaponRack;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockWeaponRack extends BlockTrigger{
|
||||
|
||||
|
||||
@@ -2,10 +2,6 @@ package noppes.npcs.blocks.tiles;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileBanner extends TileColorable {
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
|
||||
public class TileBeam extends TileColorable {
|
||||
|
||||
}
|
||||
@@ -1,16 +1,10 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import noppes.npcs.TextBlock;
|
||||
|
||||
public class TileBigSign extends TileEntity {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileBlockAnvil extends TileEntity {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityEnderPearl;
|
||||
@@ -16,6 +14,8 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import noppes.npcs.controllers.data.Availability;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TileBorder extends TileEntity implements IEntitySelector{
|
||||
public Availability availability = new Availability();
|
||||
public AxisAlignedBB boundingbox;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
|
||||
public class TileCandle extends TileLamp {
|
||||
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
|
||||
public class TileChair extends TileColorable {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
|
||||
public class TileCouchWool extends TileColorable {
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
public class TileCrate extends TileNpcContainer{
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package noppes.npcs.blocks.tiles;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -11,6 +9,8 @@ import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.blocks.BlockNpcRedstone;
|
||||
import noppes.npcs.controllers.data.Availability;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TileRedstoneBlock extends TileEntity {
|
||||
public int onRange = 6;
|
||||
public int offRange = 10;
|
||||
|
||||
Loaded 100 of 544 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user