Improvements
This commit is contained in:
parent
7dacc56bd7
commit
ba690bf99e
8 changed files with 33 additions and 33 deletions
|
@ -1,6 +1,6 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
//jcenter()
|
||||
maven { url = "http://files.minecraftforge.net/maven" }
|
||||
}
|
||||
dependencies {
|
||||
|
@ -9,15 +9,15 @@ buildscript {
|
|||
}
|
||||
|
||||
plugins {
|
||||
id 'io.franzbecker.gradle-lombok'
|
||||
id 'io.franzbecker.gradle-lombok' /*version '1.11'*/
|
||||
id 'java'
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
|
||||
group 'org.dimdev.annotatednbt'
|
||||
version '1.0'
|
||||
version '1.0.0-beta'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
|
@ -25,10 +25,6 @@ repositories {
|
|||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = "1.12.2-14.23.1.2555"
|
||||
mappings = "snapshot_20171007"
|
||||
|
|
|
@ -37,7 +37,6 @@ public class SavedToNBTProcessor extends AbstractProcessor {
|
|||
|
||||
private Map<String, Integer> varCounter = new HashMap<>();
|
||||
|
||||
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
|
||||
@Override
|
||||
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { // TODO: generics, inheritance, different exception for error type
|
||||
roundEnv.getElementsAnnotatedWith(SavedToNBT.class);
|
||||
|
|
34
build.gradle
34
build.gradle
|
@ -13,22 +13,35 @@ plugins {
|
|||
id 'java'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup.
|
||||
|
||||
ext.modversion = "3.0.0-b2"
|
||||
// Version info
|
||||
String baseversion = "3.0.0" // Set beta to 0 after changing this
|
||||
int beta = 2 // Set this to 0 for a non-beta release
|
||||
ext.mcversion = "1.12.2"
|
||||
ext.forgeversion = "14.23.1.2555"
|
||||
//spongeSchematicVersion = "1"
|
||||
String mcpversion = "snapshot_20171007"
|
||||
|
||||
version = mcversion + "-" + modversion
|
||||
group = "org.dimdev.dimdoors" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
String suffix = ""
|
||||
String shortSuffix = ""
|
||||
if (beta != 0) {
|
||||
suffix += "-beta$beta"
|
||||
shortSuffix = suffix
|
||||
if (System.getenv("TRAVIS_BUILD_NUMBER") != null && beta != 0) {
|
||||
suffix += "+${System.getenv("TRAVIS_BUILD_NUMBER")}"
|
||||
} else {
|
||||
suffix += "+UNOFFICIAL"
|
||||
}
|
||||
}
|
||||
version = ext.modversion = baseversion + suffix
|
||||
|
||||
group = "org.dimdev.dimdoors"
|
||||
archivesBaseName = "dimdoors"
|
||||
jar.archiveName = "dimdoors.jar" // Constant name for travis
|
||||
|
||||
sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly.
|
||||
sourceCompatibility = "1.8"
|
||||
compileJava {
|
||||
sourceCompatibility = targetCompatibility = "1.8"
|
||||
options.compilerArgs += [
|
||||
//"-proc:only", // TODO: have generated code available for debugging
|
||||
"-processor", "org.dimdev.ddutils.nbt.SavedToNBTProcessor,lombok.launch.AnnotationProcessorHider\$AnnotationProcessor"
|
||||
|
@ -36,11 +49,10 @@ compileJava {
|
|||
}
|
||||
|
||||
minecraft {
|
||||
version = "1.12.2-14.23.1.2555"
|
||||
version = "$mcversion-$forgeversion"
|
||||
runDir = "run"
|
||||
mappings = "snapshot_20171007"
|
||||
replace '${version}', project.version
|
||||
//replace '${spongeSchematicVersion}', spongeSchematicVersion
|
||||
mappings = mcpversion
|
||||
replace '${version}', baseversion + shortSuffix
|
||||
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
include 'AnnotatedNBT'
|
||||
|
||||
|
|
|
@ -6,12 +6,10 @@ import lombok.ToString;
|
|||
import lombok.Value;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
/**
|
||||
* @author Robijnvogel
|
||||
|
@ -48,7 +46,7 @@ public class Location implements Serializable {
|
|||
}
|
||||
|
||||
public IBlockState getBlockState() {
|
||||
return getWorld().getBlockState(this.pos);
|
||||
return getWorld().getBlockState(pos);
|
||||
}
|
||||
|
||||
public WorldServer getWorld() {
|
||||
|
|
|
@ -6,7 +6,6 @@ import org.dimdev.dimdoors.shared.rifts.RiftRegistry;
|
|||
import org.dimdev.dimdoors.shared.tileentities.TileEntityEntranceRift;
|
||||
import org.dimdev.dimdoors.shared.tileentities.TileEntityFloatingRift;
|
||||
import org.dimdev.dimdoors.shared.rifts.TileEntityRift;
|
||||
import org.dimdev.ddutils.Location;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -16,7 +15,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -31,9 +29,8 @@ public abstract class BlockDimensionalDoor extends BlockDoor implements IRiftPro
|
|||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
|
||||
if (world.isRemote) return;
|
||||
if (state.getValue(HALF) == EnumDoorHalf.UPPER) pos = pos.down();
|
||||
IBlockState doorState = world.getBlockState(pos);
|
||||
if (!(doorState.getBlock() instanceof BlockDoor)) return;
|
||||
|
||||
IBlockState doorState = world.getBlockState(state.getValue(HALF) == EnumDoorHalf.UPPER ? pos.down() : pos); // .down() because only the bottom block has open=true
|
||||
|
||||
// Check that it's a door and that the entity portal timer is 0
|
||||
if (doorState.getValue(BlockDoor.OPEN) && entity.timeUntilPortal == 0) {
|
||||
|
|
|
@ -13,9 +13,7 @@ import lombok.experimental.Wither;
|
|||
import org.dimdev.dimdoors.DimDoors;
|
||||
import org.dimdev.dimdoors.shared.VirtualLocation;
|
||||
import org.dimdev.dimdoors.shared.rifts.RiftRegistry.RiftInfo.AvailableLinkInfo;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.storage.MapStorage;
|
||||
import net.minecraft.world.storage.WorldSavedData;
|
||||
|
@ -217,7 +215,7 @@ import java.util.*;
|
|||
List<Location> entrances = privatePocketEntranceLists.computeIfAbsent(playerUUID, k -> new ArrayList<>());
|
||||
while ((entrance == null || !(entrance.getTileEntity() instanceof TileEntityRift)) && entrances.size() > 0) {
|
||||
if (entrance != null) entrances.remove(entrance);
|
||||
entrance = entrances.get(0);
|
||||
if (entrances.size() > 0) entrance = entrances.get(0);
|
||||
}
|
||||
privatePocketEntrances.put(playerUUID, entrance);
|
||||
return entrance;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dimdev.dimdoors.shared.tools;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import org.dimdev.dimdoors.DimDoors;
|
||||
import org.dimdev.dimdoors.server.DDProxyServer;
|
||||
import org.dimdev.dimdoors.shared.blocks.BlockDimensionalDoor;
|
||||
|
@ -46,7 +47,7 @@ public final class PocketSchematicGenerator {
|
|||
ModContainer mc = new DummyModContainer(md);
|
||||
Loader.instance().setupTestHarness(mc);
|
||||
Loader.instance().setActiveModContainer(mc);
|
||||
ModBlocks.registerBlocks(new RegistryEvent.Register(GameData.BLOCKS, RegistryManager.ACTIVE.getRegistry(GameData.BLOCKS)));
|
||||
ModBlocks.registerBlocks(new RegistryEvent.Register<Block>(GameData.BLOCKS, RegistryManager.ACTIVE.getRegistry(GameData.BLOCKS)));
|
||||
new DDProxyServer().registerTileEntities();
|
||||
new DDProxyServer().registerRiftDestinations();
|
||||
Loader.instance().setActiveModContainer(null);
|
||||
|
|
Loading…
Reference in a new issue