-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a41e56b
commit cf37a0c
Showing
17 changed files
with
104 additions
and
93 deletions.
There are no files selected for viewing
102 changes: 51 additions & 51 deletions
102
...amerforea/ttinkerer/NoDupeProperties.java → ...tinkerer/properties/NoDupeProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
package com.gamerforea.ttinkerer; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.common.IExtendedEntityProperties; | ||
import net.minecraftforge.common.util.Constants; | ||
import thaumic.tinkerer.common.lib.LibMisc; | ||
|
||
public final class NoDupeProperties implements IExtendedEntityProperties | ||
{ | ||
public static final String PROP_NAME = LibMisc.MOD_ID + "_NoDupeData"; | ||
private boolean denyDropAspect; | ||
|
||
@Override | ||
public void saveNBTData(NBTTagCompound compound) | ||
{ | ||
NBTTagCompound nbt = new NBTTagCompound(); | ||
nbt.setBoolean("DenyDropAspect", this.denyDropAspect); | ||
compound.setTag(PROP_NAME, nbt); | ||
} | ||
|
||
@Override | ||
public void loadNBTData(NBTTagCompound compound) | ||
{ | ||
if (compound.hasKey(PROP_NAME, Constants.NBT.TAG_COMPOUND)) | ||
{ | ||
NBTTagCompound nbt = compound.getCompoundTag(PROP_NAME); | ||
this.denyDropAspect = nbt.getBoolean("DenyDropAspect"); | ||
} | ||
} | ||
|
||
@Override | ||
public void init(Entity entity, World world) | ||
{ | ||
} | ||
|
||
public static boolean canDropAspect(Entity entity) | ||
{ | ||
NoDupeProperties prop = (NoDupeProperties) entity.getExtendedProperties(PROP_NAME); | ||
return prop == null || !prop.denyDropAspect; | ||
} | ||
|
||
public static void denyDropAspect(Entity entity) | ||
{ | ||
NoDupeProperties prop = (NoDupeProperties) entity.getExtendedProperties(PROP_NAME); | ||
if (prop == null) | ||
entity.registerExtendedProperties(PROP_NAME, prop = new NoDupeProperties()); | ||
prop.denyDropAspect = true; | ||
} | ||
} | ||
package com.gamerforea.ttinkerer.properties; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.common.IExtendedEntityProperties; | ||
import net.minecraftforge.common.util.Constants; | ||
import thaumic.tinkerer.common.lib.LibMisc; | ||
|
||
public final class NoDupeProperties implements IExtendedEntityProperties | ||
{ | ||
private static final String PROP_NAME = LibMisc.MOD_ID + "_NoDupeData"; | ||
private boolean denyDropAspect; | ||
|
||
@Override | ||
public void saveNBTData(NBTTagCompound compound) | ||
{ | ||
NBTTagCompound nbt = new NBTTagCompound(); | ||
nbt.setBoolean("DenyDropAspect", this.denyDropAspect); | ||
compound.setTag(PROP_NAME, nbt); | ||
} | ||
|
||
@Override | ||
public void loadNBTData(NBTTagCompound compound) | ||
{ | ||
if (compound.hasKey(PROP_NAME, Constants.NBT.TAG_COMPOUND)) | ||
{ | ||
NBTTagCompound nbt = compound.getCompoundTag(PROP_NAME); | ||
this.denyDropAspect = nbt.getBoolean("DenyDropAspect"); | ||
} | ||
} | ||
|
||
@Override | ||
public void init(Entity entity, World world) | ||
{ | ||
} | ||
|
||
public static boolean canDropAspect(Entity entity) | ||
{ | ||
NoDupeProperties prop = (NoDupeProperties) entity.getExtendedProperties(PROP_NAME); | ||
return prop == null || !prop.denyDropAspect; | ||
} | ||
|
||
public static void denyDropAspect(Entity entity) | ||
{ | ||
NoDupeProperties prop = (NoDupeProperties) entity.getExtendedProperties(PROP_NAME); | ||
if (prop == null) | ||
entity.registerExtendedProperties(PROP_NAME, prop = new NoDupeProperties()); | ||
prop.denyDropAspect = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.