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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
package net.minecraft.entity.player;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public enum EnumPlayerModelParts
{
CAPE(0, "cape"),
JACKET(1, "jacket"),
LEFT_SLEEVE(2, "left_sleeve"),
RIGHT_SLEEVE(3, "right_sleeve"),
LEFT_PANTS_LEG(4, "left_pants_leg"),
RIGHT_PANTS_LEG(5, "right_pants_leg"),
HAT(6, "hat");
private final int partId;
private final int partMask;
private final String partName;
private final ITextComponent name;
private EnumPlayerModelParts(int partIdIn, String partNameIn)
{
this.partId = partIdIn;
this.partMask = 1 << partIdIn;
this.partName = partNameIn;
this.name = new TextComponentTranslation("options.modelPart." + partNameIn, new Object[0]);
}
public int getPartMask()
{
return this.partMask;
}
public int getPartId()
{
return this.partId;
}
public String getPartName()
{
return this.partName;
}
public ITextComponent getName()
{
return this.name;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,79 @@
package net.minecraft.entity.player;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class PlayerCapabilities
{
/** Disables player damage. */
public boolean disableDamage;
/** Sets/indicates whether the player is flying. */
public boolean isFlying;
/** whether or not to allow the player to fly when they double jump. */
public boolean allowFlying;
/** Used to determine if creative mode is enabled, and therefore if items should be depleted on usage */
public boolean isCreativeMode;
/** Indicates whether the player is allowed to modify the surroundings */
public boolean allowEdit = true;
private float flySpeed = 0.05F;
private float walkSpeed = 0.1F;
public void writeCapabilitiesToNBT(NBTTagCompound tagCompound)
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setBoolean("invulnerable", this.disableDamage);
nbttagcompound.setBoolean("flying", this.isFlying);
nbttagcompound.setBoolean("mayfly", this.allowFlying);
nbttagcompound.setBoolean("instabuild", this.isCreativeMode);
nbttagcompound.setBoolean("mayBuild", this.allowEdit);
nbttagcompound.setFloat("flySpeed", this.flySpeed);
nbttagcompound.setFloat("walkSpeed", this.walkSpeed);
tagCompound.setTag("abilities", nbttagcompound);
}
public void readCapabilitiesFromNBT(NBTTagCompound tagCompound)
{
if (tagCompound.hasKey("abilities", 10))
{
NBTTagCompound nbttagcompound = tagCompound.getCompoundTag("abilities");
this.disableDamage = nbttagcompound.getBoolean("invulnerable");
this.isFlying = nbttagcompound.getBoolean("flying");
this.allowFlying = nbttagcompound.getBoolean("mayfly");
this.isCreativeMode = nbttagcompound.getBoolean("instabuild");
if (nbttagcompound.hasKey("flySpeed", 99))
{
this.flySpeed = nbttagcompound.getFloat("flySpeed");
this.walkSpeed = nbttagcompound.getFloat("walkSpeed");
}
if (nbttagcompound.hasKey("mayBuild", 1))
{
this.allowEdit = nbttagcompound.getBoolean("mayBuild");
}
}
}
public float getFlySpeed()
{
return this.flySpeed;
}
@SideOnly(Side.CLIENT)
public void setFlySpeed(float speed)
{
this.flySpeed = speed;
}
public float getWalkSpeed()
{
return this.walkSpeed;
}
@SideOnly(Side.CLIENT)
public void setPlayerWalkSpeed(float speed)
{
this.walkSpeed = speed;
}
}

View File

@@ -0,0 +1,7 @@
// Auto generated package-info by MCP
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package net.minecraft.entity.player;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;