base mod created

This commit is contained in:
Mohammad-Ali Minaie
2018-10-08 09:07:47 -04:00
parent 0a7700c356
commit b86dedad2f
7848 changed files with 584664 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
package net.minecraft.util;
import net.minecraft.nbt.NBTTagCompound;
public class WeightedSpawnerEntity extends WeightedRandom.Item
{
private final NBTTagCompound nbt;
public WeightedSpawnerEntity()
{
super(1);
this.nbt = new NBTTagCompound();
this.nbt.setString("id", "minecraft:pig");
}
public WeightedSpawnerEntity(NBTTagCompound nbtIn)
{
this(nbtIn.hasKey("Weight", 99) ? nbtIn.getInteger("Weight") : 1, nbtIn.getCompoundTag("Entity"));
}
public WeightedSpawnerEntity(int itemWeightIn, NBTTagCompound nbtIn)
{
super(itemWeightIn);
this.nbt = nbtIn;
}
public NBTTagCompound toCompoundTag()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
if (!this.nbt.hasKey("id", 8))
{
this.nbt.setString("id", "minecraft:pig");
}
else if (!this.nbt.getString("id").contains(":"))
{
this.nbt.setString("id", (new ResourceLocation(this.nbt.getString("id"))).toString());
}
nbttagcompound.setTag("Entity", this.nbt);
nbttagcompound.setInteger("Weight", this.itemWeight);
return nbttagcompound;
}
public NBTTagCompound getNbt()
{
return this.nbt;
}
}