item changes
|
@ -110,6 +110,8 @@ import common.collect.Lists;
|
|||
import common.collect.Maps;
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Space;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.Entity;
|
||||
import common.entity.animal.EntityHorse;
|
||||
import common.entity.npc.Energy;
|
||||
|
@ -161,8 +163,6 @@ import common.packet.CPacketCheat;
|
|||
import common.packet.CPacketMessage;
|
||||
import common.packet.HPacketHandshake;
|
||||
import common.packet.CPacketAction.Action;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.properties.Property;
|
||||
import common.sound.EventType;
|
||||
import common.sound.PositionedSound;
|
||||
|
|
|
@ -411,9 +411,9 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
|
|||
}, IPlayer.VALID_NICK, this.gm.player == null ? "" : this.gm.player.getCustomNameTag()));
|
||||
this.templateButton.enabled = false;
|
||||
this.dimension = new Random().zrange(UniverseRegistry.getBaseDimensions().size());
|
||||
EntityInfo egg = EntityRegistry.SPAWN_EGGS.get(this.gm.player == null ? EntityRegistry.getEntityString(EntityHuman.class) : EntityRegistry.getEntityString(this.gm.player));
|
||||
if(egg != null && egg.origin() != null) {
|
||||
Dimension dim = UniverseRegistry.getDimension(egg.origin());
|
||||
EntityInfo info = EntityRegistry.DNA.get(this.gm.player == null ? EntityRegistry.getEntityString(EntityHuman.class) : EntityRegistry.getEntityString(this.gm.player));
|
||||
if(info != null && info.origin() != null) {
|
||||
Dimension dim = UniverseRegistry.getDimension(info.origin());
|
||||
if(dim != null) {
|
||||
for(int z = 0; z < UniverseRegistry.getBaseDimensions().size(); z++) {
|
||||
if(UniverseRegistry.getBaseDimensions().get(z) == dim) {
|
||||
|
|
|
@ -127,6 +127,10 @@ public abstract class GuiContainer extends Gui
|
|||
s = s + TextColor.RESET;
|
||||
list.add(s);
|
||||
stack.getItem().addInformation(stack, this.gm.player, list);
|
||||
if(stack.getItem().isAdminItem())
|
||||
list.add(TextColor.RED + "Admin-Gegenstand");
|
||||
if(stack.getItem().isMagnetic())
|
||||
list.add(TextColor.LGRAY + "Magnetisch");
|
||||
if(stack.getItem().canBeDyed())
|
||||
list.add("Farbe: #" + Integer.toHexString(stack.getDyeColor()).toUpperCase());
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import client.world.WorldClient;
|
|||
import common.block.Block;
|
||||
import common.block.tech.BlockWorkbench;
|
||||
import common.dimension.Dimension;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.DataWatcher;
|
||||
import common.entity.Entity;
|
||||
import common.entity.effect.EntityLightning;
|
||||
|
@ -116,7 +117,6 @@ import common.packet.SPacketTrades;
|
|||
import common.packet.SPacketUpdateDisplay;
|
||||
import common.packet.SPacketUpdateHealth;
|
||||
import common.packet.SPacketWorld;
|
||||
import common.potion.StatusEffect;
|
||||
import common.rng.Random;
|
||||
import common.sound.Sound;
|
||||
import common.tileentity.TileEntity;
|
||||
|
|
|
@ -16,6 +16,7 @@ import client.world.WorldClient;
|
|||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.effect.Effect;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityAnimal;
|
||||
|
@ -24,7 +25,6 @@ import common.init.Blocks;
|
|||
import common.init.Items;
|
||||
import common.init.SoundEvent;
|
||||
import common.model.BlockLayer;
|
||||
import common.potion.Effect;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
|
|
BIN
client/src/main/resources/textures/items/dna_sample.png
Executable file
After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
BIN
client/src/main/resources/textures/items/dna_sample_overlay.png
Executable file
After Width: | Height: | Size: 5.3 KiB |
BIN
client/src/main/resources/textures/items/editor.png
Executable file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB |
BIN
client/src/main/resources/textures/items/scanner.png
Executable file
After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 402 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -1,4 +1,4 @@
|
|||
package common.potion;
|
||||
package common.effect;
|
||||
|
||||
import java.util.Map;
|
||||
import common.collect.Maps;
|
||||
|
@ -7,6 +7,7 @@ import common.entity.DamageSource;
|
|||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.projectile.EntityPotion;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.item.ItemStack;
|
||||
import common.vars.Vars;
|
||||
|
||||
public enum Effect {
|
||||
|
@ -143,7 +144,36 @@ public enum Effect {
|
|||
if(entity instanceof EntityNPC npc)
|
||||
npc.healMana(Math.max((int)(effect * (double)(4 << amp) + 0.5D), 0));
|
||||
}
|
||||
};
|
||||
},
|
||||
ITEM_REGENERATION("item_regeneration", "Unendlichkeit", "Trank der Unendlichkeit", false, 0x3f00ff) {
|
||||
public void onUpdate(EntityLiving entity, int duration, int amp) {
|
||||
if(!(entity instanceof EntityNPC npc))
|
||||
return;
|
||||
int k = 40 >> amp;
|
||||
if(k > 0 && duration % k != 0)
|
||||
return;
|
||||
for(ItemStack stack : npc.inventory.mainInventory) {
|
||||
if(stack != null && !stack.isEmpty()) {
|
||||
if(!stack.isFull())
|
||||
stack.incrSize();
|
||||
if(stack.getRepairCost() > 0)
|
||||
stack.setRepairCost(stack.getRepairCost() - 1);
|
||||
if(stack.isItemStackDamageable() && stack.getItemDamage() > 0)
|
||||
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||
}
|
||||
}
|
||||
for(ItemStack stack : npc.inventory.armorInventory) {
|
||||
if(stack != null && !stack.isEmpty()) {
|
||||
if(!stack.isFull())
|
||||
stack.incrSize();
|
||||
if(stack.getRepairCost() > 0)
|
||||
stack.setRepairCost(stack.getRepairCost() - 1);
|
||||
if(stack.isItemStackDamageable() && stack.getItemDamage() > 0)
|
||||
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},;
|
||||
|
||||
private static final Map<String, Effect> LOOKUP = Maps.newHashMap();
|
||||
private static final String[] POTENCIES = new String[] {"II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"};
|
|
@ -1,4 +1,4 @@
|
|||
package common.potion;
|
||||
package common.effect;
|
||||
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.log.Log;
|
|
@ -2624,9 +2624,9 @@ public abstract class Entity
|
|||
|
||||
public Item getItem() {
|
||||
String id = EntityRegistry.getEntityString(this);
|
||||
if(!EntityRegistry.SPAWN_EGGS.containsKey(id))
|
||||
if(!EntityRegistry.DNA.containsKey(id))
|
||||
return null;
|
||||
return ItemRegistry.byName(id.toLowerCase() + "_spawner");
|
||||
return ItemRegistry.byName("dna_sample_" + id.toLowerCase());
|
||||
}
|
||||
|
||||
public Position getPos() {
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import common.collect.Sets;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.projectile.EntityArrow;
|
||||
import common.entity.types.EntityLiving;
|
||||
|
@ -24,7 +25,6 @@ import common.packet.SPacketEntityVelocity;
|
|||
import common.packet.SPacketSpawnMob;
|
||||
import common.packet.SPacketSpawnObject;
|
||||
import common.packet.SPacketSpawnPlayer;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tags.TagObject;
|
||||
import common.util.ExtMath;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package common.entity.animal;
|
|||
import java.util.List;
|
||||
|
||||
import common.collect.Lists;
|
||||
import common.effect.Effect;
|
||||
import common.entity.DamageSource;
|
||||
import common.entity.Entity;
|
||||
import common.entity.EntityType;
|
||||
|
@ -11,7 +12,6 @@ import common.entity.npc.EntityNPC;
|
|||
import common.entity.types.EntityLiving;
|
||||
import common.entity.types.IEntityMultiPart;
|
||||
import common.init.SoundEvent;
|
||||
import common.potion.Effect;
|
||||
import common.util.ExtMath;
|
||||
import common.util.ParticleType;
|
||||
import common.util.Vec3;
|
||||
|
|
|
@ -13,6 +13,7 @@ import common.ai.EntityAIWatchClosest;
|
|||
import common.block.Block;
|
||||
import common.block.SoundType;
|
||||
import common.collect.Lists;
|
||||
import common.effect.Effect;
|
||||
import common.entity.DamageSource;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -26,9 +27,8 @@ import common.inventory.IInvBasic;
|
|||
import common.inventory.InventoryBasic;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.spawner.ItemMonsterPlacer;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.pathfinding.PathNavigateGround;
|
||||
import common.potion.Effect;
|
||||
import common.tags.TagObject;
|
||||
import java.util.List;
|
||||
import common.util.BlockPos;
|
||||
|
@ -794,7 +794,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
|
|||
{
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemMonsterPlacer)
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemMobTemplate)
|
||||
{
|
||||
return super.interact(player);
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@ import common.ai.EntityJumpHelper;
|
|||
import common.ai.EntityMoveHelper;
|
||||
import common.block.Block;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.DamageSource;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.Alignment;
|
||||
|
@ -31,8 +33,6 @@ import common.item.Item;
|
|||
import common.item.ItemStack;
|
||||
import common.pathfinding.PathEntity;
|
||||
import common.pathfinding.PathNavigateGround;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tags.TagObject;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
|
|
|
@ -4,14 +4,14 @@ import common.init.SpeciesRegistry;
|
|||
import common.item.ItemStack;
|
||||
|
||||
public class CharacterInfo extends NpcInfo {
|
||||
public final boolean spawner;
|
||||
public final boolean dna;
|
||||
public final SpeciesInfo species;
|
||||
public final int color1;
|
||||
public final int color2;
|
||||
|
||||
public CharacterInfo(SpeciesInfo species, Enum type, String name, String skin, Alignment align, float height, int color1, int color2, boolean spawner) {
|
||||
super(type, name, skin, align, height, (ItemStack[])null);
|
||||
this.spawner = spawner;
|
||||
this.dna = spawner;
|
||||
this.species = species;
|
||||
this.color1 = color1;
|
||||
this.color2 = color2;
|
||||
|
|
|
@ -2,12 +2,12 @@ package common.entity.npc;
|
|||
|
||||
import common.ai.EntityAIAttackOnCollide;
|
||||
import common.ai.EntityAILeapAtTarget;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.Entity;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.pathfinding.PathNavigate;
|
||||
import common.pathfinding.PathNavigateClimber;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.world.World;
|
||||
|
|
|
@ -3,8 +3,8 @@ package common.entity.npc;
|
|||
import common.ai.EntityAIBase;
|
||||
import common.ai.EntityMoveHelper;
|
||||
import common.block.Block;
|
||||
import common.effect.Effect;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.potion.Effect;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package common.entity.npc;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.effect.EntityLightning;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.Items;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemPotion;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.rng.Random;
|
||||
import common.util.ExtMath;
|
||||
import common.world.World;
|
||||
|
|
|
@ -27,6 +27,8 @@ import common.collect.Lists;
|
|||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
import common.dimension.Space;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.enchantment.Enchantment;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.entity.DamageSource;
|
||||
|
@ -81,8 +83,6 @@ import common.packet.CPacketPlayer;
|
|||
import common.packet.SPacketEntityEquipment;
|
||||
import common.packet.SPacketEntityVelocity;
|
||||
import common.pathfinding.PathNavigateGround;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.rng.Random;
|
||||
import common.sound.MovingSoundMinecartRiding;
|
||||
import common.tags.TagObject;
|
||||
|
@ -4538,8 +4538,8 @@ public abstract class EntityNPC extends EntityLiving
|
|||
|
||||
public Item getItem() {
|
||||
for(int z = 0; z < this.species.chars.length; z++) {
|
||||
if(this.species.chars[z].spawner && this.species.chars[z].skin.equals(this.getChar())) {
|
||||
return ItemRegistry.byName(this.species.chars[z].skin + "_spawner");
|
||||
if(this.species.chars[z].dna && this.species.chars[z].skin.equals(this.getChar())) {
|
||||
return ItemRegistry.byName("dna_sample_" + this.species.chars[z].skin);
|
||||
}
|
||||
}
|
||||
return super.getItem();
|
||||
|
@ -4566,6 +4566,7 @@ public abstract class EntityNPC extends EntityLiving
|
|||
this.removeEffect(Effect.FIRE_RESISTANCE);
|
||||
this.removeEffect(Effect.FLYING);
|
||||
this.removeEffect(Effect.MANA_GENERATION);
|
||||
this.removeEffect(Effect.ITEM_REGENERATION);
|
||||
}
|
||||
else {
|
||||
this.extinguish();
|
||||
|
@ -4577,6 +4578,7 @@ public abstract class EntityNPC extends EntityLiving
|
|||
this.addEffect(new StatusEffect(Effect.FIRE_RESISTANCE, Integer.MAX_VALUE, 0));
|
||||
this.addEffect(new StatusEffect(Effect.FLYING, Integer.MAX_VALUE, 1));
|
||||
this.addEffect(new StatusEffect(Effect.MANA_GENERATION, Integer.MAX_VALUE, 255));
|
||||
this.addEffect(new StatusEffect(Effect.ITEM_REGENERATION, Integer.MAX_VALUE, 255));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package common.entity.projectile;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.DamageSource;
|
||||
import common.entity.npc.EntityGargoyle;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.util.HitPosition;
|
||||
import common.vars.Vars;
|
||||
import common.world.World;
|
||||
|
|
|
@ -2,6 +2,8 @@ package common.entity.projectile;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.entity.types.EntityThrowable;
|
||||
import common.entity.types.IObjectData;
|
||||
|
@ -9,8 +11,6 @@ import common.init.ItemRegistry;
|
|||
import common.init.Items;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemPotion;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tags.TagObject;
|
||||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
|
|
|
@ -20,6 +20,8 @@ import common.block.SoundType;
|
|||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.entity.DamageSource;
|
||||
import common.entity.Entity;
|
||||
|
@ -40,7 +42,7 @@ import common.init.Items;
|
|||
import common.init.SoundEvent;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.spawner.ItemMonsterPlacer;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.tool.ItemArmor;
|
||||
import common.network.IPlayer;
|
||||
import common.packet.SPacketEntityAttach;
|
||||
|
@ -48,8 +50,6 @@ import common.packet.SPacketAnimation;
|
|||
import common.packet.SPacketCollectItem;
|
||||
import common.pathfinding.PathNavigate;
|
||||
import common.pathfinding.PathNavigateGround;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.rng.Random;
|
||||
import common.tags.TagObject;
|
||||
import common.util.BlockPos;
|
||||
|
@ -3041,7 +3041,7 @@ public abstract class EntityLiving extends Entity
|
|||
{
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemMonsterPlacer)
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemMobTemplate)
|
||||
{
|
||||
if (!this.worldObj.client)
|
||||
{
|
||||
|
@ -3049,7 +3049,7 @@ public abstract class EntityLiving extends Entity
|
|||
// .getSpawnedId());
|
||||
String oclass = EntityRegistry.getEntityString(this);
|
||||
|
||||
if (oclass != null && oclass.equals(((ItemMonsterPlacer)itemstack.getItem()).getSpawnedId()))
|
||||
if (oclass != null && oclass.equals(((ItemMobTemplate)itemstack.getItem()).getSpawnedId()))
|
||||
{
|
||||
EntityLiving child = this.createChild(this);
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@ import common.entity.projectile.EntityPotion;
|
|||
import common.entity.projectile.EntitySnowball;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.entity.types.IObjectData;
|
||||
import common.item.spawner.ItemMonsterPlacer;
|
||||
import common.item.spawner.ItemNpcSpawner;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.spawner.ItemCharTemplate;
|
||||
import common.log.Log;
|
||||
import common.tags.TagObject;
|
||||
import common.world.World;
|
||||
|
@ -58,7 +58,7 @@ public abstract class EntityRegistry {
|
|||
private static final Map<Class<? extends Entity>, String> CLASS_TO_STRING = Maps.<Class<? extends Entity>, String>newHashMap();
|
||||
private static final Map<Integer, Class<? extends Entity>> ID_TO_CLASS = Maps.<Integer, Class<? extends Entity>>newHashMap();
|
||||
private static final Map<Class<? extends Entity>, Integer> CLASS_TO_ID = Maps.<Class<? extends Entity>, Integer>newHashMap();
|
||||
public static final Map<String, EntityInfo> SPAWN_EGGS = Maps.<String, EntityInfo>newLinkedHashMap();
|
||||
public static final Map<String, EntityInfo> DNA = Maps.<String, EntityInfo>newLinkedHashMap();
|
||||
private static final Map<String, String> STRING_TO_NAME = Maps.<String, String>newHashMap();
|
||||
|
||||
private static boolean register;
|
||||
|
@ -83,7 +83,7 @@ public abstract class EntityRegistry {
|
|||
registerEntity(name, clazz, typename);
|
||||
}
|
||||
else {
|
||||
SPAWN_EGGS.put(name, new EntityInfo(name, origin, eggColor, spotColor));
|
||||
DNA.put(name, new EntityInfo(name, origin, eggColor, spotColor));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -265,10 +265,10 @@ public abstract class EntityRegistry {
|
|||
|
||||
registerEggs();
|
||||
|
||||
for(ItemMonsterPlacer item : ItemMonsterPlacer.SPAWNERS) {
|
||||
for(ItemMobTemplate item : ItemMobTemplate.TEMPLATES) {
|
||||
item.delegateSetDisplay();
|
||||
}
|
||||
for(ItemNpcSpawner item : ItemNpcSpawner.SPAWNERS) {
|
||||
for(ItemCharTemplate item : ItemCharTemplate.TEMPLATES) {
|
||||
item.delegateSetDisplay();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@ import common.collect.HashBiMap;
|
|||
import common.collect.Lists;
|
||||
import common.color.DyeColor;
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.enchantment.Enchantment;
|
||||
import common.entity.item.EntityCart;
|
||||
import common.entity.npc.CharacterInfo;
|
||||
|
@ -40,8 +42,8 @@ import common.item.material.ItemNugget;
|
|||
import common.item.material.ItemRecord;
|
||||
import common.item.spawner.ItemBoat;
|
||||
import common.item.spawner.ItemMinecart;
|
||||
import common.item.spawner.ItemMonsterPlacer;
|
||||
import common.item.spawner.ItemNpcSpawner;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.spawner.ItemCharTemplate;
|
||||
import common.item.tool.ItemAmmo;
|
||||
import common.item.tool.ItemAppleGold;
|
||||
import common.item.tool.ItemArmor;
|
||||
|
@ -57,7 +59,7 @@ import common.item.tool.ItemCarrotOnAStick;
|
|||
import common.item.tool.ItemChargedOrb;
|
||||
import common.item.tool.ItemDie;
|
||||
import common.item.tool.ItemDynamite;
|
||||
import common.item.tool.ItemEditWand;
|
||||
import common.item.tool.ItemEditor;
|
||||
import common.item.tool.ItemEgg;
|
||||
import common.item.tool.ItemExpBottle;
|
||||
import common.item.tool.ItemExterminator;
|
||||
|
@ -70,10 +72,10 @@ import common.item.tool.ItemFood;
|
|||
import common.item.tool.ItemGlassBottle;
|
||||
import common.item.tool.ItemHoe;
|
||||
import common.item.tool.ItemHorseArmor;
|
||||
import common.item.tool.ItemInfoWand;
|
||||
import common.item.tool.ItemScanner;
|
||||
import common.item.tool.ItemKey;
|
||||
import common.item.tool.ItemLead;
|
||||
import common.item.tool.ItemLightning;
|
||||
import common.item.tool.ItemTrident;
|
||||
import common.item.tool.ItemMagnet;
|
||||
import common.item.tool.ItemNameTag;
|
||||
import common.item.tool.ItemPickaxe;
|
||||
|
@ -87,8 +89,6 @@ import common.item.tool.ItemSpaceNavigator;
|
|||
import common.item.tool.ItemSword;
|
||||
import common.item.tool.ItemWeatherToken;
|
||||
import common.log.Log;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.util.Pair;
|
||||
import common.util.Util;
|
||||
import common.world.Weather;
|
||||
|
@ -194,21 +194,21 @@ public abstract class ItemRegistry {
|
|||
register("hopper_minecart", (new ItemMinecart(EntityCart.EnumMinecartType.HOPPER)).setDisplay("Trichterlore"));
|
||||
register("tnt_minecart", (new ItemMinecart(EntityCart.EnumMinecartType.TNT)).setDisplay("TNT-Lore")
|
||||
.setColor(TextColor.RED));
|
||||
for(EntityInfo egg : EntityRegistry.SPAWN_EGGS.values()) {
|
||||
register(egg.id().toLowerCase() + "_spawner", (new ItemMonsterPlacer(egg.id()))
|
||||
for(EntityInfo egg : EntityRegistry.DNA.values()) {
|
||||
register("dna_sample_" + egg.id().toLowerCase(), (new ItemMobTemplate(egg.id()))
|
||||
.setMaxAmount(StackSize.L));
|
||||
}
|
||||
for(SpeciesInfo species : SpeciesRegistry.SPECIMEN) {
|
||||
for(CharacterInfo charinfo : species.chars) {
|
||||
if(charinfo.spawner)
|
||||
register(charinfo.skin + "_spawner", (new ItemNpcSpawner(charinfo))
|
||||
if(charinfo.dna)
|
||||
register("dna_sample_" + charinfo.skin, (new ItemCharTemplate(charinfo))
|
||||
.setMaxAmount(StackSize.L));
|
||||
}
|
||||
}
|
||||
|
||||
register("wand", (new ItemEditWand()).setDisplay("Bearbeitungswerkzeug"));
|
||||
register("info_wand", (new ItemInfoWand()).setDisplay("Infowerkzeug"));
|
||||
register("lightning_wand", (new ItemLightning()).setDisplay("Geladenes Zepter"));
|
||||
register("editor", (new ItemEditor()).setDisplay("Bearbeitungswerkzeug"));
|
||||
register("scanner", (new ItemScanner()).setDisplay("Infowerkzeug"));
|
||||
register("trident", (new ItemTrident()).setDisplay("Geladenes Zepter"));
|
||||
register("banhammer", (new ItemBanHammer()).setDisplay("Hammer der Verbannung"));
|
||||
register("key", (new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
|
||||
for(Pair<Integer, TextColor> sides : ItemDie.DIE_SIDES) {
|
||||
|
|
|
@ -39,8 +39,8 @@ import common.item.material.ItemNugget;
|
|||
import common.item.material.ItemRecord;
|
||||
import common.item.spawner.ItemBoat;
|
||||
import common.item.spawner.ItemMinecart;
|
||||
import common.item.spawner.ItemMonsterPlacer;
|
||||
import common.item.spawner.ItemNpcSpawner;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.spawner.ItemCharTemplate;
|
||||
import common.item.tool.ItemAmmo;
|
||||
import common.item.tool.ItemAppleGold;
|
||||
import common.item.tool.ItemArmor;
|
||||
|
@ -55,7 +55,7 @@ import common.item.tool.ItemCarrotOnAStick;
|
|||
import common.item.tool.ItemChargedOrb;
|
||||
import common.item.tool.ItemDie;
|
||||
import common.item.tool.ItemDynamite;
|
||||
import common.item.tool.ItemEditWand;
|
||||
import common.item.tool.ItemEditor;
|
||||
import common.item.tool.ItemEgg;
|
||||
import common.item.tool.ItemExpBottle;
|
||||
import common.item.tool.ItemExterminator;
|
||||
|
@ -68,10 +68,10 @@ import common.item.tool.ItemFood;
|
|||
import common.item.tool.ItemGlassBottle;
|
||||
import common.item.tool.ItemHoe;
|
||||
import common.item.tool.ItemHorseArmor;
|
||||
import common.item.tool.ItemInfoWand;
|
||||
import common.item.tool.ItemScanner;
|
||||
import common.item.tool.ItemKey;
|
||||
import common.item.tool.ItemLead;
|
||||
import common.item.tool.ItemLightning;
|
||||
import common.item.tool.ItemTrident;
|
||||
import common.item.tool.ItemMagnet;
|
||||
import common.item.tool.ItemNameTag;
|
||||
import common.item.tool.ItemPickaxe;
|
||||
|
@ -88,8 +88,8 @@ import common.util.Util;
|
|||
|
||||
|
||||
public abstract class Items {
|
||||
public static final ItemMonsterPlacer fox_spawner = get("fox_spawner");
|
||||
public static final ItemNpcSpawner highelf_spawner = get("highelf_spawner");
|
||||
public static final ItemMobTemplate dna_sample_fox = get("dna_sample_fox");
|
||||
public static final ItemCharTemplate dna_sample_highelf = get("dna_sample_highelf");
|
||||
public static final ItemDoor acacia_door = get("acacia_door");
|
||||
public static final ItemFence acacia_fence = get("acacia_fence");
|
||||
public static final ItemBlock acacia_fence_gate = get("acacia_fence_gate");
|
||||
|
@ -438,7 +438,7 @@ public abstract class Items {
|
|||
public static final ItemBlock houstonia = get("houstonia");
|
||||
public static final ItemBucket hydrogen_bucket = get("hydrogen_bucket");
|
||||
public static final ItemBlock ice = get("ice");
|
||||
public static final ItemInfoWand info_wand = get("info_wand");
|
||||
public static final ItemScanner scanner = get("scanner");
|
||||
public static final ItemDye ink_sack = get("ink_sack");
|
||||
public static final ItemMetalBlock iodine_block = get("iodine_block");
|
||||
public static final ItemMetalBlock iodine_ore = get("iodine_ore");
|
||||
|
@ -500,7 +500,7 @@ public abstract class Items {
|
|||
public static final ItemBlock light_blue_glass_pane = get("light_blue_glass_pane");
|
||||
public static final ItemBlock light_blue_wool = get("light_blue_wool");
|
||||
public static final ItemPressurePlate light_weighted_pressure_plate = get("light_weighted_pressure_plate");
|
||||
public static final ItemLightning lightning_wand = get("lightning_wand");
|
||||
public static final ItemTrident trident = get("trident");
|
||||
public static final ItemBlock lime_carpet = get("lime_carpet");
|
||||
public static final ItemBlock lime_clay = get("lime_clay");
|
||||
public static final ItemDye lime_dye = get("lime_dye");
|
||||
|
@ -843,7 +843,7 @@ public abstract class Items {
|
|||
public static final ItemMetal vanadium_ingot = get("vanadium_ingot");
|
||||
public static final ItemMetalBlock vanadium_ore = get("vanadium_ore");
|
||||
public static final ItemColored vine = get("vine");
|
||||
public static final ItemEditWand wand = get("wand");
|
||||
public static final ItemEditor editor = get("editor");
|
||||
public static final ItemBlock warp_chest = get("warp_chest");
|
||||
public static final ItemBucket water_bucket = get("water_bucket");
|
||||
public static final ItemLilyPad waterlily = get("waterlily");
|
||||
|
@ -1028,7 +1028,7 @@ public abstract class Items {
|
|||
}
|
||||
for(Iterator<Item> iter = items.iterator(); iter.hasNext();) {
|
||||
Item item = iter.next();
|
||||
if(item instanceof ItemNpcSpawner || item instanceof ItemMonsterPlacer)
|
||||
if(item instanceof ItemCharTemplate || item instanceof ItemMobTemplate)
|
||||
iter.remove();
|
||||
}
|
||||
if(!items.isEmpty()) {
|
||||
|
|
|
@ -62,14 +62,14 @@ public enum CheatTab {
|
|||
return Items.minecart;
|
||||
}
|
||||
},
|
||||
SPAWNERS("Mob & Itemspawner", false) {
|
||||
SPAWNERS("Mob-DNA-Proben", false) {
|
||||
protected Item getIconItem() {
|
||||
return Items.fox_spawner;
|
||||
return Items.dna_sample_fox;
|
||||
}
|
||||
},
|
||||
NPCS("Charakterspawner", false) {
|
||||
NPCS("Charakter-DNA-Proben", false) {
|
||||
protected Item getIconItem() {
|
||||
return Items.highelf_spawner;
|
||||
return Items.dna_sample_highelf;
|
||||
}
|
||||
},
|
||||
TOOLS("Werkzeug", false) {
|
||||
|
|
|
@ -243,6 +243,10 @@ public class Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean isAdminItem() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getHotbarText(EntityNPC player, ItemStack stack) {
|
||||
return stack.getColoredName();
|
||||
}
|
||||
|
|
|
@ -20,32 +20,29 @@ import common.item.Item;
|
|||
import common.item.ItemStack;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.util.HitPosition;
|
||||
import common.util.Vec3;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemNpcSpawner extends Item
|
||||
public class ItemCharTemplate extends Item
|
||||
{
|
||||
public static final List<ItemNpcSpawner> SPAWNERS = Lists.newArrayList();
|
||||
public static final List<ItemCharTemplate> TEMPLATES = Lists.newArrayList();
|
||||
|
||||
private final CharacterInfo spawned;
|
||||
|
||||
public ItemNpcSpawner(CharacterInfo spawned)
|
||||
public ItemCharTemplate(CharacterInfo spawned)
|
||||
{
|
||||
// this.setHasSubtypes(true);
|
||||
this.setTab(CheatTab.NPCS);
|
||||
this.spawned = spawned;
|
||||
this.setDisplay("delegate");
|
||||
SPAWNERS.add(this);
|
||||
TEMPLATES.add(this);
|
||||
}
|
||||
|
||||
public void delegateSetDisplay() {
|
||||
this.setDisplay("Erschaffe " + this.getCharName());
|
||||
this.setDisplay("DNA-Probe von " + this.getCharName());
|
||||
}
|
||||
|
||||
public CharacterInfo getSpawnedChar() {
|
||||
|
@ -77,7 +74,7 @@ public class ItemNpcSpawner extends Item
|
|||
{
|
||||
return true;
|
||||
}
|
||||
else if (!playerIn.canPlayerEdit(pos.offset(side), side, stack))
|
||||
else if (!playerIn.connection.isAdmin() || !playerIn.canPlayerEdit(pos.offset(side), side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -106,7 +103,6 @@ public class ItemNpcSpawner extends Item
|
|||
|
||||
// if (!playerIn.creative)
|
||||
// {
|
||||
stack.decrSize();
|
||||
// }
|
||||
}
|
||||
// }
|
||||
|
@ -140,7 +136,7 @@ public class ItemNpcSpawner extends Item
|
|||
return itemStackIn;
|
||||
}
|
||||
|
||||
if (!playerIn.canPlayerEdit(blockpos, movingobjectposition.side, itemStackIn))
|
||||
if (!playerIn.connection.isAdmin() || !playerIn.canPlayerEdit(blockpos, movingobjectposition.side, itemStackIn))
|
||||
{
|
||||
return itemStackIn;
|
||||
}
|
||||
|
@ -160,7 +156,6 @@ public class ItemNpcSpawner extends Item
|
|||
|
||||
// if (!playerIn.creative)
|
||||
// {
|
||||
itemStackIn.decrSize();
|
||||
// }
|
||||
|
||||
// if(z == 0)
|
||||
|
@ -193,42 +188,8 @@ public class ItemNpcSpawner extends Item
|
|||
worldIn.spawnEntityInWorld(entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
// public void getSubItems(Item itemIn, CreativeTab tab, List<ItemStack> subItems)
|
||||
// {
|
||||
// for (int z = 0; z < SpeciesRegistry.CHARACTERS.size(); z++)
|
||||
// {
|
||||
// subItems.add(new ItemStack(itemIn, 1, z));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public ItemMeshDefinition getMesher() {
|
||||
// return new ItemMeshDefinition()
|
||||
// {
|
||||
// public String getModelLocation(ItemStack stack)
|
||||
// {
|
||||
// return "item/npc_spawner#0" + '#' + "inventory";
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
//
|
||||
// public void getRenderItems(Item itemIn, List<ItemStack> subItems) {
|
||||
// subItems.add(new ItemStack(itemIn, 1, 0));
|
||||
// }
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.getTransform(), "npc_spawner", "npc_spawner_overlay");
|
||||
}
|
||||
|
||||
public ItemStack dispenseStack(World world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack)
|
||||
{
|
||||
double d0 = blockpos.getX() + 0.5 + (double)facing.getFrontOffsetX();
|
||||
double d1 = blockpos.getY() + 0.2;
|
||||
double d2 = blockpos.getZ() + 0.5 + (double)facing.getFrontOffsetZ();
|
||||
Entity entity = spawnNpc(world, this.spawned, d0, d1, d2, false);
|
||||
if (entity instanceof EntityLiving && stack.hasDisplayName())
|
||||
((EntityLiving)entity).setCustomNameTag(stack.getDisplayName());
|
||||
stack.split(1);
|
||||
return stack;
|
||||
return provider.getModel(this.getTransform(), "dna_sample_char", "dna_sample_char_overlay");
|
||||
}
|
||||
}
|
|
@ -18,32 +18,29 @@ import common.item.Item;
|
|||
import common.item.ItemStack;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.util.HitPosition;
|
||||
import common.util.Vec3;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemMonsterPlacer extends Item
|
||||
public class ItemMobTemplate extends Item
|
||||
{
|
||||
public static final List<ItemMonsterPlacer> SPAWNERS = Lists.newArrayList();
|
||||
public static final List<ItemMobTemplate> TEMPLATES = Lists.newArrayList();
|
||||
|
||||
private final String entityId;
|
||||
|
||||
public ItemMonsterPlacer(String entityId)
|
||||
public ItemMobTemplate(String entityId)
|
||||
{
|
||||
// this.setHasSubtypes(true);
|
||||
this.setTab(CheatTab.SPAWNERS);
|
||||
this.entityId = entityId;
|
||||
this.setDisplay("delegate");
|
||||
SPAWNERS.add(this);
|
||||
TEMPLATES.add(this);
|
||||
}
|
||||
|
||||
public void delegateSetDisplay() {
|
||||
this.setDisplay("Erschaffe " + EntityRegistry.getEntityName(this.entityId));
|
||||
this.setDisplay("DNA-Probe von " + EntityRegistry.getEntityName(this.entityId));
|
||||
}
|
||||
|
||||
public String getSpawnedId() {
|
||||
|
@ -52,12 +49,12 @@ public class ItemMonsterPlacer extends Item
|
|||
|
||||
public int getColorFromItemStack(ItemStack stack, int renderPass)
|
||||
{
|
||||
EntityInfo egg = EntityRegistry.SPAWN_EGGS.get(this.entityId);
|
||||
EntityInfo egg = EntityRegistry.DNA.get(this.entityId);
|
||||
return egg != null ? (renderPass == 0 ? egg.color1() : egg.color2()) : 16777215;
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC player, List<String> tooltip) {
|
||||
EntityInfo egg = EntityRegistry.SPAWN_EGGS.get(this.entityId);
|
||||
EntityInfo egg = EntityRegistry.DNA.get(this.entityId);
|
||||
if(egg != null) {
|
||||
Dimension dim = egg.origin() == null ? null : UniverseRegistry.getDimension(egg.origin());
|
||||
tooltip.add(TextColor.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getFormattedName(false)));
|
||||
|
@ -73,7 +70,7 @@ public class ItemMonsterPlacer extends Item
|
|||
{
|
||||
return true;
|
||||
}
|
||||
else if (!playerIn.canPlayerEdit(pos.offset(side), side, stack))
|
||||
else if (!playerIn.connection.isAdmin() || !playerIn.canPlayerEdit(pos.offset(side), side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -108,7 +105,6 @@ public class ItemMonsterPlacer extends Item
|
|||
|
||||
// if (!playerIn.creative)
|
||||
// {
|
||||
stack.decrSize();
|
||||
// }
|
||||
}
|
||||
// }
|
||||
|
@ -145,7 +141,7 @@ public class ItemMonsterPlacer extends Item
|
|||
return itemStackIn;
|
||||
}
|
||||
|
||||
if (!playerIn.canPlayerEdit(blockpos, movingobjectposition.side, itemStackIn))
|
||||
if (!playerIn.connection.isAdmin() || !playerIn.canPlayerEdit(blockpos, movingobjectposition.side, itemStackIn))
|
||||
{
|
||||
return itemStackIn;
|
||||
}
|
||||
|
@ -170,7 +166,6 @@ public class ItemMonsterPlacer extends Item
|
|||
|
||||
// if (!playerIn.creative)
|
||||
// {
|
||||
itemStackIn.decrSize();
|
||||
// }
|
||||
|
||||
// if(z == 0)
|
||||
|
@ -186,7 +181,7 @@ public class ItemMonsterPlacer extends Item
|
|||
}
|
||||
|
||||
public static EntityLiving spawnCreature(World worldIn, String entityID, double x, double y, double z, boolean check) {
|
||||
if (!EntityRegistry.SPAWN_EGGS.containsKey(entityID))
|
||||
if (!EntityRegistry.DNA.containsKey(entityID))
|
||||
return null;
|
||||
Entity entity = EntityRegistry.createEntityByName(entityID, worldIn);
|
||||
if(!(entity instanceof EntityLiving living))
|
||||
|
@ -202,44 +197,7 @@ public class ItemMonsterPlacer extends Item
|
|||
return living;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
||||
// */
|
||||
// public void getSubItems(Item itemIn, CreativeTab tab, List<ItemStack> subItems)
|
||||
// {
|
||||
// for (EntityEggInfo entitylist$entityegginfo : EntityRegistry.SPAWN_EGGS.values())
|
||||
// {
|
||||
// subItems.add(new ItemStack(itemIn, 1, entitylist$entityegginfo.spawnedID));
|
||||
// }
|
||||
// }
|
||||
|
||||
// public ItemMeshDefinition getMesher() {
|
||||
// return new ItemMeshDefinition()
|
||||
// {
|
||||
// public String getModelLocation(ItemStack stack)
|
||||
// {
|
||||
// return "item/spawn_egg#0" + '#' + "inventory";
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
|
||||
// public void getRenderItems(Item itemIn, List<ItemStack> subItems) {
|
||||
// subItems.add(new ItemStack(itemIn, 1, 0));
|
||||
// }
|
||||
|
||||
public Model getModel(ModelProvider provider, String name) {
|
||||
return provider.getModel(this.getTransform(), "spawn_egg", "spawn_egg_overlay");
|
||||
}
|
||||
|
||||
public ItemStack dispenseStack(World world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack)
|
||||
{
|
||||
double d0 = blockpos.getX() + 0.5 + (double)facing.getFrontOffsetX();
|
||||
double d1 = blockpos.getY() + 0.2;
|
||||
double d2 = blockpos.getZ() + 0.5 + (double)facing.getFrontOffsetZ();
|
||||
Entity entity = spawnCreature(world, this.entityId, d0, d1, d2, false);
|
||||
if (entity instanceof EntityLiving && stack.hasDisplayName())
|
||||
((EntityLiving)entity).setCustomNameTag(stack.getDisplayName());
|
||||
stack.split(1);
|
||||
return stack;
|
||||
return provider.getModel(this.getTransform(), "dna_sample", "dna_sample_overlay");
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.ItemStack;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemAppleGold extends ItemFood
|
||||
|
|
|
@ -9,29 +9,16 @@ import common.model.Transforms;
|
|||
import common.util.BlockPos;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemEditWand extends Item {
|
||||
public ItemEditWand() {
|
||||
public class ItemEditor extends Item {
|
||||
public ItemEditor() {
|
||||
this.setUnstackable();
|
||||
this.setTab(CheatTab.TOOLS);
|
||||
}
|
||||
|
||||
// public boolean canBreakBlocks() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// public boolean ignoresBlocks() {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
public boolean hasEffect(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
public boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) {
|
||||
if(!world.client && control == ItemControl.TERTIARY && player.connection.isAdmin())
|
||||
player.connection.setSelectMode();
|
||||
|
@ -43,4 +30,8 @@ public class ItemEditWand extends Item {
|
|||
public Transforms getTransform() {
|
||||
return Transforms.TOOL;
|
||||
}
|
||||
|
||||
public boolean isAdminItem() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -17,12 +17,8 @@ public class ItemExterminator extends ItemMagnetic {
|
|||
this.setTab(CheatTab.WEAPONS);
|
||||
}
|
||||
|
||||
// public final boolean canUseInAir() {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityNPC player) {
|
||||
if(!world.client) {
|
||||
if(!world.client && player.connection.isAdmin()) {
|
||||
world.playSoundAtEntity(player, SoundEvent.CLICK, 1.0F);
|
||||
if(world.dimension == Space.INSTANCE)
|
||||
player.connection.addHotbar(TextColor.RED + "Der Weltraum kann nicht zerstört werden (lol)");
|
||||
|
@ -42,4 +38,8 @@ public class ItemExterminator extends ItemMagnetic {
|
|||
// player.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]);
|
||||
return stack;
|
||||
}
|
||||
|
||||
public boolean isAdminItem() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.ItemStack;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemFishFood extends ItemFood
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.SoundEvent;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemAction;
|
||||
import common.item.ItemStack;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemFood extends Item
|
||||
|
|
|
@ -4,6 +4,8 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
import common.collect.Lists;
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.projectile.EntityPotion;
|
||||
import common.init.ItemRegistry;
|
||||
|
@ -17,8 +19,6 @@ import common.item.ItemStack;
|
|||
import common.item.StackSize;
|
||||
import common.model.Model;
|
||||
import common.model.ModelProvider;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
|
|
|
@ -8,8 +8,8 @@ import common.util.BlockPos;
|
|||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class ItemInfoWand extends ItemWand {
|
||||
public ItemInfoWand() {
|
||||
public class ItemScanner extends ItemWand {
|
||||
public ItemScanner() {
|
||||
this.setColor(TextColor.BLUE);
|
||||
}
|
||||
|
|
@ -7,8 +7,8 @@ import common.item.ItemStack;
|
|||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class ItemLightning extends ItemWand {
|
||||
public ItemLightning() {
|
||||
public class ItemTrident extends ItemWand {
|
||||
public ItemTrident() {
|
||||
this.setColor(TextColor.NEON);
|
||||
this.setTab(CheatTab.WEAPONS);
|
||||
}
|
|
@ -3,6 +3,7 @@ package common.network;
|
|||
import java.util.List;
|
||||
|
||||
import common.dimension.Dimension;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
|
@ -23,7 +24,6 @@ import common.packet.CPacketPlace;
|
|||
import common.packet.CPacketPlayer;
|
||||
import common.packet.CPacketSign;
|
||||
import common.packet.CPacketSkin;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tileentity.IInteractionObject;
|
||||
import common.tileentity.TileEntitySign;
|
||||
import common.util.BlockPos;
|
||||
|
|
|
@ -2,11 +2,11 @@ package common.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.network.IClientPlayer;
|
||||
import common.network.Packet;
|
||||
import common.network.PacketBuffer;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
|
||||
public class SPacketEntityEffect implements Packet<IClientPlayer>
|
||||
{
|
||||
|
|
|
@ -2,11 +2,11 @@ package common.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.network.IClientPlayer;
|
||||
import common.network.Packet;
|
||||
import common.network.PacketBuffer;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
|
||||
public class SPacketRemoveEntityEffect implements Packet<IClientPlayer>
|
||||
{
|
||||
|
|
|
@ -5,10 +5,10 @@ import java.util.List;
|
|||
import common.block.Block;
|
||||
import common.block.artificial.BlockStainedGlass;
|
||||
import common.block.artificial.BlockStainedGlassPane;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.Blocks;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tags.TagObject;
|
||||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
|
||||
import common.block.tech.BlockBrewingStand;
|
||||
import common.collect.Lists;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.BrewingRegistry;
|
||||
import common.init.Items;
|
||||
|
@ -15,7 +16,6 @@ import common.inventory.InventoryPlayer;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemPotion;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tags.TagObject;
|
||||
import common.util.Facing;
|
||||
import common.world.State;
|
||||
|
|
|
@ -4,8 +4,8 @@ import common.entity.types.EntityLiving;
|
|||
import common.init.EntityRegistry;
|
||||
import common.inventory.ContainerTile;
|
||||
import common.item.ItemStack;
|
||||
import common.item.spawner.ItemMonsterPlacer;
|
||||
import common.item.spawner.ItemNpcSpawner;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.spawner.ItemCharTemplate;
|
||||
import common.tags.TagObject;
|
||||
import common.vars.Vars;
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class TileEntityMobSpawner extends TileEntityDevice implements ITickable
|
|||
private int spawnRange = 4;
|
||||
|
||||
public boolean isItemValidForSlot(int index, ItemStack stack) {
|
||||
return index == 0 ? stack.getItem() instanceof ItemMonsterPlacer || stack.getItem() instanceof ItemNpcSpawner : false;
|
||||
return index == 0 ? stack.getItem() instanceof ItemMobTemplate || stack.getItem() instanceof ItemCharTemplate : false;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
@ -35,8 +35,8 @@ public class TileEntityMobSpawner extends TileEntityDevice implements ITickable
|
|||
public String formatDisplay(ContainerTile inv) {
|
||||
ItemStack stack = inv.getSlot(0).getStack();
|
||||
if(stack == null)
|
||||
return "Kein Spawner vorhanden";
|
||||
return String.format("Erschaffe: %s", stack.getItem() instanceof ItemMonsterPlacer egg ? EntityRegistry.getEntityName(egg.getSpawnedId()) : ((stack.getItem() instanceof ItemNpcSpawner egg ? egg.getCharName() : "<?>")));
|
||||
return "Keine DNA-Probe vorhanden";
|
||||
return String.format("Erschaffe: %s", stack.getItem() instanceof ItemMobTemplate egg ? EntityRegistry.getEntityName(egg.getSpawnedId()) : ((stack.getItem() instanceof ItemCharTemplate egg ? egg.getCharName() : "<?>")));
|
||||
}
|
||||
|
||||
protected boolean executeFunction() {
|
||||
|
@ -55,10 +55,10 @@ public class TileEntityMobSpawner extends TileEntityDevice implements ITickable
|
|||
double y = (double)(this.pos.getY() + this.worldObj.rand.zrange(3) - 1);
|
||||
double z = (double)this.pos.getZ() + (this.worldObj.rand.doublev() - this.worldObj.rand.doublev()) * (double)this.spawnRange + 0.5D;
|
||||
EntityLiving entity = null;
|
||||
if(stack.getItem() instanceof ItemMonsterPlacer egg)
|
||||
entity = ItemMonsterPlacer.spawnCreature(this.worldObj, egg.getSpawnedId(), x, y, z, true);
|
||||
else if(stack.getItem() instanceof ItemNpcSpawner egg)
|
||||
entity = ItemNpcSpawner.spawnNpc(this.worldObj, egg.getSpawnedChar(), x, y, z, true);
|
||||
if(stack.getItem() instanceof ItemMobTemplate egg)
|
||||
entity = ItemMobTemplate.spawnCreature(this.worldObj, egg.getSpawnedId(), x, y, z, true);
|
||||
else if(stack.getItem() instanceof ItemCharTemplate egg)
|
||||
entity = ItemCharTemplate.spawnNpc(this.worldObj, egg.getSpawnedChar(), x, y, z, true);
|
||||
if (entity == null)
|
||||
return true;
|
||||
this.decrStackSize(0, 1);
|
||||
|
|
|
@ -33,6 +33,7 @@ import common.collect.Maps;
|
|||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
import common.dimension.Space;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityHuman;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -80,7 +81,6 @@ import common.packet.SPacketSetExperience;
|
|||
import common.packet.SPacketSkin;
|
||||
import common.packet.SPacketTimeUpdate;
|
||||
import common.packet.SPacketWorld;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tags.TagObject;
|
||||
import common.util.BlockPos;
|
||||
import common.util.EncryptUtil;
|
||||
|
|
|
@ -3,8 +3,8 @@ package server.command.commands;
|
|||
import java.util.List;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.potion.Effect;
|
||||
import server.command.Command;
|
||||
import server.command.CommandEnvironment;
|
||||
import server.command.Executor;
|
||||
|
|
|
@ -3,8 +3,8 @@ package server.command.commands;
|
|||
import java.util.List;
|
||||
|
||||
import common.collect.Lists;
|
||||
import common.effect.Effect;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.potion.Effect;
|
||||
import server.command.Command;
|
||||
import server.command.CommandEnvironment;
|
||||
import server.command.Executor;
|
||||
|
|
|
@ -2,9 +2,9 @@ package server.command.commands;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import server.command.Command;
|
||||
import server.command.CommandEnvironment;
|
||||
import server.command.Executor;
|
||||
|
|
|
@ -14,6 +14,8 @@ import common.block.artificial.BlockWall;
|
|||
import common.collect.Lists;
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.Entity;
|
||||
import common.entity.animal.EntityHorse;
|
||||
import common.entity.item.EntityItem;
|
||||
|
@ -97,8 +99,6 @@ import common.packet.SPacketTrades;
|
|||
import common.packet.SPacketUpdateHealth;
|
||||
import common.packet.CPacketAction.Action;
|
||||
import common.packet.SPacketMessage.Type;
|
||||
import common.potion.Effect;
|
||||
import common.potion.StatusEffect;
|
||||
import common.tags.TagObject;
|
||||
import common.tileentity.IInteractionObject;
|
||||
import common.tileentity.ILockableContainer;
|
||||
|
|