mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-14 17:14:46 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d11034e4aa | ||
|
|
cc64b09ad4 | ||
|
|
d5ebc02999 | ||
|
|
8415b657f2 |
No files matched your search
+2
-2
@@ -1,5 +1,5 @@
|
||||
mcversion=1.7.10
|
||||
forgeversion=10.13.4.1541-1.7.10
|
||||
forgeversion=10.13.4.1566-1.7.10
|
||||
version_major=4
|
||||
version_minor=2
|
||||
version_patch=2
|
||||
version_patch=3
|
||||
@@ -59,7 +59,7 @@ import forestry.plugins.PluginManager;
|
||||
name = "Forestry",
|
||||
version = Version.VERSION,
|
||||
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
|
||||
dependencies = "required-after:Forge@[10.13.4.1448,);"
|
||||
dependencies = "required-after:Forge@[10.13.4.1566,);"
|
||||
+ "after:Buildcraft|Core@[6.1.7,);"
|
||||
+ "after:ExtrabiomesXL;"
|
||||
+ "after:BiomesOPlenty;"
|
||||
|
||||
@@ -113,4 +113,9 @@ public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implement
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerMinecartBeehouse(player.inventory, this, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdOfEntity() {
|
||||
return getEntityId();
|
||||
}
|
||||
}
|
||||
@@ -98,4 +98,9 @@ public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase {
|
||||
public Object getContainer(EntityPlayer player, int data) {
|
||||
return new ContainerMinecartBeehouse(player.inventory, this, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdOfEntity() {
|
||||
return getEntityId();
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ public abstract class BreedingTracker extends WorldSavedData implements IBreedin
|
||||
}
|
||||
|
||||
private void syncToPlayer(Collection<String> discoveredSpecies, Collection<String> discoveredMutations, Collection<String> researchedMutations) {
|
||||
if (world != null && username != null) {
|
||||
if (world != null && username != null && username.getName() != null) {
|
||||
EntityPlayer player = world.getPlayerEntityByName(username.getName());
|
||||
if (player instanceof EntityPlayerMP && !(player instanceof FakePlayer)) {
|
||||
IBreedingTracker breedingTracker = getBreedingTracker(player);
|
||||
|
||||
@@ -29,7 +29,7 @@ public class GuiHandler implements IGuiHandler {
|
||||
|
||||
public static void openGui(EntityPlayer entityplayer, IGuiHandlerEntity guiHandler, short data) {
|
||||
int guiData = encodeGuiData(guiHandler, data);
|
||||
entityplayer.openGui(ForestryAPI.instance, guiData, entityplayer.worldObj, guiHandler.getEntityId(), 0, 0);
|
||||
entityplayer.openGui(ForestryAPI.instance, guiData, entityplayer.worldObj, guiHandler.getIdOfEntity(), 0, 0);
|
||||
}
|
||||
|
||||
public static void openGui(EntityPlayer entityplayer, IGuiHandlerItem guiHandler) {
|
||||
|
||||
@@ -17,5 +17,6 @@ public interface IGuiHandlerEntity extends IGuiHandlerForestry {
|
||||
|
||||
Object getContainer(EntityPlayer player, int data);
|
||||
|
||||
int getEntityId();
|
||||
// can't be named getEntityId() for obfuscation reasons
|
||||
int getIdOfEntity();
|
||||
}
|
||||
@@ -21,11 +21,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.FuelBurnTimeEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry;
|
||||
@@ -38,6 +42,7 @@ import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.ICrateRegistry;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.VillageHandlerArboriculture;
|
||||
import forestry.arboriculture.WoodItemAccess;
|
||||
import forestry.arboriculture.blocks.BlockArboricultureType;
|
||||
@@ -119,6 +124,9 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
// register for FuelBurnTimeEvent
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
for (EnumWoodType woodType : EnumWoodType.VALUES) {
|
||||
WoodItemAccess.registerLog(blocks.logs, woodType, false);
|
||||
WoodItemAccess.registerPlanks(blocks.planks, woodType, false);
|
||||
@@ -411,11 +419,24 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
return 100;
|
||||
}
|
||||
|
||||
if (blocks.slabs == Block.getBlockFromItem(item)) {
|
||||
return 150;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void fuelBurnTimeEvent(FuelBurnTimeEvent fuelBurnTimeEvent) {
|
||||
Item item = fuelBurnTimeEvent.fuel.getItem();
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
|
||||
if (block instanceof IWoodTyped) {
|
||||
IWoodTyped woodTypedBlock = (IWoodTyped) block;
|
||||
if (woodTypedBlock.isFireproof()) {
|
||||
fuelBurnTimeEvent.burnTime = 0;
|
||||
fuelBurnTimeEvent.setResult(Event.Result.DENY);
|
||||
} else if (blocks.slabs == block) {
|
||||
fuelBurnTimeEvent.burnTime = 150;
|
||||
fuelBurnTimeEvent.setResult(Event.Result.DENY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user